From a0c0061cd680a3a92b820969b093cc4780dfb10c Mon Sep 17 00:00:00 2001 From: foudfou Date: Mon, 10 Nov 2014 15:06:49 +0100 Subject: [PATCH] * Linux: add debug for icon theme search path. * Logging: fix superfluous newline, and expose Log module. The additional newline was introduced by Log.jsm in FF32 (see https://bugzilla.mozilla.org/show_bug.cgi?id=966674). --- src/modules/ctypes/linux/glib.jsm | 2 ++ src/modules/ctypes/linux/gtk.jsm | 1 + src/modules/linux/FiretrayGtkIcons.jsm | 17 +++++++++++++++++ src/modules/log4moz.js | 4 ++-- src/modules/logging.jsm | 26 +++++++++++++------------- 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/src/modules/ctypes/linux/glib.jsm b/src/modules/ctypes/linux/glib.jsm index a411d4a..e1d5d71 100644 --- a/src/modules/ctypes/linux/glib.jsm +++ b/src/modules/ctypes/linux/glib.jsm @@ -16,6 +16,8 @@ function glib_defines(lib) { /* mutual inclusion not possible */ this.GQuark = ctypes.uint32_t; // this.GQuark = gobject.guint32; this.GError = ctypes.StructType("GError"); + + lib.lazy_bind("g_strfreev", ctypes.void_t, ctypes.char.ptr.ptr); }; new ctypes_library(GLIB_LIBNAME, GLIB_ABIS, glib_defines, this); diff --git a/src/modules/ctypes/linux/gtk.jsm b/src/modules/ctypes/linux/gtk.jsm index fc70953..95c84b6 100644 --- a/src/modules/ctypes/linux/gtk.jsm +++ b/src/modules/ctypes/linux/gtk.jsm @@ -101,6 +101,7 @@ function gtk_defines(lib) { lib.lazy_bind("gtk_icon_theme_get_default", this.GtkIconTheme.ptr); lib.lazy_bind("gtk_icon_theme_get_for_screen", this.GtkIconTheme.ptr, gdk.GdkScreen.ptr); + lib.lazy_bind("gtk_icon_theme_get_search_path", ctypes.void_t, this.GtkIconTheme.ptr, gobject.gchar.ptr.ptr.array(), gobject.gint.ptr); lib.lazy_bind("gtk_icon_theme_append_search_path", ctypes.void_t, this.GtkIconTheme.ptr, gobject.gchar.ptr); lib.lazy_bind("gtk_icon_theme_prepend_search_path", ctypes.void_t, this.GtkIconTheme.ptr, gobject.gchar.ptr); lib.lazy_bind("gtk_icon_theme_choose_icon", this.GtkIconInfo.ptr, this.GtkIconTheme.ptr, gobject.gchar.ptr.array(), gobject.gint, this.GtkIconLookupFlags); diff --git a/src/modules/linux/FiretrayGtkIcons.jsm b/src/modules/linux/FiretrayGtkIcons.jsm index 6b9af1c..33fdec8 100644 --- a/src/modules/linux/FiretrayGtkIcons.jsm +++ b/src/modules/linux/FiretrayGtkIcons.jsm @@ -44,6 +44,23 @@ firetray.GtkIcons = { let gtkIconTheme = gtk.gtk_icon_theme_get_default(); log.debug("gtkIconTheme="+gtkIconTheme); gtk.gtk_icon_theme_append_search_path(gtkIconTheme, this.GTK_THEME_ICON_PATH); + + if (log.level <= firetray.Logging.LogMod.Level.Debug) { + Cu.import("resource://firetray/ctypes/linux/glib.jsm"); + Cu.import("resource://firetray/ctypes/linux/gobject.jsm"); + firetray.Handler.subscribeLibsForClosing([glib, gobject]); + let path = new gobject.gchar.ptr.ptr; + let n_elements = new gobject.gint; + gtk.gtk_icon_theme_get_search_path(gtkIconTheme, path.address(), n_elements.address()); + log.debug("n_elements="+n_elements+" path="+path); + let pathIt = path; + for (let i=0, len=n_elements.value; i