1
0
mirror of https://github.com/moparisthebest/FireTray synced 2024-12-22 22:08:49 -05:00

detect inexisting file in setIconImage()

This commit is contained in:
foudfou 2012-02-07 18:42:27 +01:00
parent c2203c063f
commit 771d6df3b3
2 changed files with 6 additions and 3 deletions

View File

@ -37,7 +37,7 @@
*
* ***** END LICENSE BLOCK ***** */
var EXPORTED_SYMBOLS = [ "gdk", "glib" ];
var EXPORTED_SYMBOLS = [ "gdk" ];
const GDK_LIBNAME = "gdk-x11-2.0";
const GDK_ABIS = [ 0 ];

View File

@ -111,9 +111,12 @@ firetray.Handler.setIconImage = function(filename) {
return false;
LOG(filename);
let pixbuf = gdk.gdk_pixbuf_new_from_file(filename, null);
if (strEquals(pixbuf, gdk.GdkPixbuf.ptr(null)))
return false;
try {
gtk.gtk_status_icon_set_from_file(firetray.StatusIcon.trayIcon,
filename);
gtk.gtk_status_icon_set_from_pixbuf(firetray.StatusIcon.trayIcon, pixbuf);
} catch (x) {
ERROR(x);
return false;