]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Only set the window icon if the icon file exists
authorDirk Hohndel <dirk@hohndel.org>
Tue, 3 Jan 2012 04:15:24 +0000 (20:15 -0800)
committerDirk Hohndel <dirk@hohndel.org>
Tue, 3 Jan 2012 04:15:24 +0000 (20:15 -0800)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
gtk-gui.c

index ddae481b16aa9e353ffc41fd849144c02ef263f4..ee99f01eb48167e29aef0e339d13f59ee2fd32e9 100644 (file)
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -694,8 +694,11 @@ void init_ui(int *argcp, char ***argvp)
                        gtk_window_set_default_icon_name ("subsurface");
                }
        }
-       if (need_icon)
-               gtk_window_set_icon_from_file(GTK_WINDOW(win), subsurface_icon_name(), NULL);
+       if (need_icon) {
+               const char *icon_name = subsurface_icon_name();
+               if (!access(icon_name, R_OK))
+                       gtk_window_set_icon_from_file(GTK_WINDOW(win), icon_name, NULL);
+       }
        g_signal_connect(G_OBJECT(win), "delete-event", G_CALLBACK(on_delete), NULL);
        g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(on_destroy), NULL);
        main_window = win;