1
0
mirror of https://github.com/moparisthebest/FireTray synced 2025-01-06 11:08:04 -05:00

* ctypes-utils: just log 'Info' if lib not found.

* Cleaning
This commit is contained in:
foudfou 2014-11-11 14:52:14 +01:00
parent f2acc43dce
commit 2b0084b69a
3 changed files with 28 additions and 24 deletions

View File

@ -23,7 +23,7 @@ var firetrayChrome = { // each new window gets a new firetrayChrome !
firetray_log.debug("Handler initialized: "+firetray.Handler.initialized);
let init = firetray.Handler.initialized || firetray.Handler.init();
firetray_log.debug("ONLOAD"); firetray.Handler.dumpWindows();
firetray_log.debug("ONLOAD");
this.winId = firetray.Handler.registerWindow(win);
win.addEventListener('close', firetrayChrome.onClose, true);
@ -39,7 +39,7 @@ var firetrayChrome = { // each new window gets a new firetrayChrome !
onQuit: function(win) {
win.removeEventListener('close', firetrayChrome.onClose, true);
firetray.Handler.unregisterWindow(win);
firetray_log.info("windowsCount="+firetray.Handler.windowsCount+", visibleWindowsCount="+firetray.Handler.visibleWindowsCount);
firetray_log.debug("windowsCount="+firetray.Handler.windowsCount+", visibleWindowsCount="+firetray.Handler.visibleWindowsCount);
firetray_log.debug('Firetray UNLOADED !');
},

View File

@ -119,17 +119,15 @@ function ctypes_library(aName, aABIs, aDefines, aGlobal) {
for each (let abi in aABIs) {
// FIXME: ABI is in fact SO_VER. Now we're mixing .so versions and the
// .dll extension :(
let soname = abi === 'dll' ? aName :
let libname = abi === 'dll' ? aName :
"lib" + aName + ".so." + abi.toString();
log.debug("Trying " + soname);
log.debug("Trying " + libname);
try {
library = ctypes.open(soname);
library = ctypes.open(libname);
this.ABI = abi;
log.debug("Successfully loaded " + soname);
log.debug("Successfully loaded " + libname);
break;
} catch(e) {
log.warn(soname+" unfound.");
}
} catch(e) {}
}
this.name = aName;
@ -153,7 +151,7 @@ function ctypes_library(aName, aABIs, aDefines, aGlobal) {
};
if (!library) {
log.debug("Failed to load library: " + aName);
log.info("Library does not exist: " + aName);
this.ABI = -1;
return;
}

View File

@ -54,20 +54,19 @@ firetray.StatusIcon = {
if (!firetray.PopupMenu.init())
return false;
// FIXME: we may want to split into 2 separate modules: GtkStatusIcon and
// AppIndicator.
Cu.import("resource://firetray/ctypes/linux/appindicator.jsm");
if (appind3.available() && this.dbusNotificationWatcherReady()) {
firetray.Handler.subscribeLibsForClosing([appind3]);
// FIXME: we may want to split into 2 separate modules: GtkStatusIcon and
// AppIndicator.
this.indicatorInit();
} else {
this.trayIcon = gtk.gtk_status_icon_new();
firetray.Handler.setIconImageDefault();
firetray.Handler.setIconTooltipDefault();
this.addCallbacks();
}
this.trayIcon = gtk.gtk_status_icon_new();
firetray.Handler.setIconImageDefault();
firetray.Handler.setIconTooltipDefault();
this.addCallbacks();
this.initialized = true;
return true;
},
@ -246,10 +245,18 @@ firetray.StatusIcon = {
dbusNotificationWatcherReady: function() {
let watcherReady = false;
function error(e) {
if (!e.isNull()) {
log.error(e.contents.message);
glib.g_error_free(e);
}
}
let conn = new gio.GDBusConnection.ptr;
let error = new glib.GError.ptr(null);
conn = gio.g_bus_get_sync(gio.G_BUS_TYPE_SESSION, null, error.address());
firetray.js.assert(error.isNull());
let err = new glib.GError.ptr(null);
conn = gio.g_bus_get_sync(gio.G_BUS_TYPE_SESSION, null, err.address());
if (error(err)) return watcherReady;
if (!conn.isNull()) {
let flags = gio.G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START |
gio.G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
@ -263,8 +270,8 @@ firetray.StatusIcon = {
appind3.NOTIFICATION_WATCHER_DBUS_OBJ,
appind3.NOTIFICATION_WATCHER_DBUS_IFACE,
null, /* GCancellable */
error.address());
firetray.js.assert(error.isNull());
err.address());
if (error(err)) return watcherReady;
if (!proxy.isNull()) {
let owner = gio.g_dbus_proxy_get_name_owner(proxy);
@ -276,7 +283,6 @@ firetray.StatusIcon = {
gobject.g_object_unref(conn);
}
glib.g_error_free(error);
return watcherReady;
}