diff options
author | Ted Gould <ted@gould.cx> | 2012-03-21 15:28:13 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-03-21 15:28:13 -0500 |
commit | 7db5c14740ce0deae6ed4279cde70b731c56390a (patch) | |
tree | 11f216a830123317fecae3668a25cf02e6d229a9 /src | |
parent | 4b2b0165658d3429f415c3014517ca13721a38b5 (diff) | |
parent | 785195578165ab8add69dc0c23acef0997ac0482 (diff) | |
download | ayatana-indicator-messages-7db5c14740ce0deae6ed4279cde70b731c56390a.tar.gz ayatana-indicator-messages-7db5c14740ce0deae6ed4279cde70b731c56390a.tar.bz2 ayatana-indicator-messages-7db5c14740ce0deae6ed4279cde70b731c56390a.zip |
Import upstream version 0.5.94
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.in | 9 | ||||
-rw-r--r-- | src/im-menu-item.c | 6 | ||||
-rw-r--r-- | src/indicator-messages.c | 2 | ||||
-rw-r--r-- | src/messages-service.c | 41 |
4 files changed, 34 insertions, 24 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 24ae353..6063ef4 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -44,7 +44,7 @@ DIST_COMMON = $(libindicator_messages_status_provider_la_HEADERS) \ $(srcdir)/indicator-messages-status-provider-0.5.pc.in.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gcov.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/gtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -222,6 +222,10 @@ COVERAGE_CXXFLAGS = @COVERAGE_CXXFLAGS@ COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUSSERVICEDIR = @DBUSSERVICEDIR@ @@ -243,6 +247,8 @@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMELOCALEDIR = @GNOMELOCALEDIR@ GREP = @GREP@ +GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ +GTEST_SOURCE = @GTEST_SOURCE@ INDICATORDIR = @INDICATORDIR@ INDICATORICONSDIR = @INDICATORICONSDIR@ INSTALL = @INSTALL@ @@ -321,6 +327,7 @@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ diff --git a/src/im-menu-item.c b/src/im-menu-item.c index f07fff9..7466d3e 100644 --- a/src/im-menu-item.c +++ b/src/im-menu-item.c @@ -175,7 +175,11 @@ im_menu_item_finalize (GObject *object) static void icon_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, const gchar * propertydata, gpointer data) { - dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(data), INDICATOR_MENUITEM_PROP_ICON, propertydata); + gsize len; + guchar *icon; + icon = g_base64_decode (propertydata, &len); + dbusmenu_menuitem_property_set_byte_array(DBUSMENU_MENUITEM(data), INDICATOR_MENUITEM_PROP_ICON, icon, len); + g_free (icon); return; } diff --git a/src/indicator-messages.c b/src/indicator-messages.c index 2c5e3cd..748b73b 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -26,7 +26,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <math.h> #include <glib.h> #include <glib-object.h> -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> #include <gtk/gtk.h> #include <libdbusmenu-gtk/menu.h> diff --git a/src/messages-service.c b/src/messages-service.c index 6e53d85..c975df1 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -327,20 +327,8 @@ static gboolean blacklist_add (gpointer udata) { gchar * definition_file = (gchar *)udata; - /* Dump the file */ - gchar * desktop; - g_file_get_contents(definition_file, &desktop, NULL, NULL); - if (desktop == NULL) { - g_warning("Couldn't get data out of: %s", definition_file); - return FALSE; - } - - /* Clean up the data */ - gchar * trimdesktop = pango_trim_string(desktop); - g_free(desktop); - blacklist_add_core(trimdesktop, definition_file); - g_free(trimdesktop); + blacklist_add_core(definition_file, definition_file); return FALSE; } @@ -352,8 +340,10 @@ blacklist_add (gpointer udata) static void blacklist_add_core (gchar * desktop, gchar * definition) { + gchar *basename = g_path_get_basename(desktop); + /* Check for conflicts */ - gpointer data = g_hash_table_lookup(blacklist, desktop); + gpointer data = g_hash_table_lookup(blacklist, basename); if (data != NULL) { gchar * oldfile = (gchar *)data; if (!g_strcmp0(oldfile, definition)) { @@ -362,27 +352,31 @@ blacklist_add_core (gchar * desktop, gchar * definition) g_warning("Already have desktop file '%s' in blacklist file '%s' not adding from '%s'", desktop, oldfile, definition); } + g_free(basename); return; } /* Actually blacklist this thing */ - g_hash_table_insert(blacklist, g_strdup(desktop), g_strdup(definition)); + g_hash_table_insert(blacklist, g_strdup(basename), g_strdup(definition)); g_debug("Adding Blacklist item '%s' for desktop '%s'", definition, desktop); /* Go through and eclipse folks */ GList * launcher; for (launcher = launcherList; launcher != NULL; launcher = launcher->next) { launcherList_t * item = (launcherList_t *)launcher->data; - if (!g_strcmp0(desktop, launcher_menu_item_get_desktop(item->menuitem))) { + gchar * item_basename = g_path_get_basename(launcher_menu_item_get_desktop(item->menuitem)); + if (!g_strcmp0(basename, item_basename)) { launcher_menu_item_set_eclipsed(item->menuitem, TRUE); dbusmenu_menuitem_property_set_bool(item->separator, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); } + g_free(item_basename); } check_hidden(); /* Shouldn't need a resort here as hiding shouldn't cause things to move other than this item disappearing. */ + g_free(basename); return; } @@ -444,15 +438,20 @@ blacklist_remove (gpointer data) static gboolean blacklist_check (const gchar * desktop_file) { - g_debug("Checking blacklist for: %s", desktop_file); - if (blacklist == NULL) return FALSE; + gchar *basename = g_path_get_basename(desktop_file); + gboolean found; - if (g_hash_table_lookup(blacklist, desktop_file)) { + g_debug("Checking blacklist for: %s", basename); + + if (blacklist && g_hash_table_lookup(blacklist, basename)) { g_debug("\tFound!"); - return TRUE; + found = TRUE; } + else + found = FALSE; - return FALSE; + g_free(basename); + return found; } /* A callback everytime the blacklist directory changes |