aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-02-08 11:31:48 -0600
committerTed Gould <ted@gould.cx>2012-02-08 11:31:48 -0600
commit44cc6e756788f6ec37343c93c178227b2b6d3ba1 (patch)
treea0fceab985ea86b78bb9557a1f875bf0ee4758c4 /src
parente548f851004dbb18360408c04c61a66a5ffc80fd (diff)
parent22965953b89a0ed229c9009a2750c573d82acfee (diff)
downloadayatana-indicator-application-44cc6e756788f6ec37343c93c178227b2b6d3ba1.tar.gz
ayatana-indicator-application-44cc6e756788f6ec37343c93c178227b2b6d3ba1.tar.bz2
ayatana-indicator-application-44cc6e756788f6ec37343c93c178227b2b6d3ba1.zip
* New upstream release.
* Adding in a code coverage based build target * Fixing useless variable setting * Fixing variant usage * Adding support for the Title property * Fixing to work with Dbusmenu 0.5.90
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am8
-rw-r--r--src/Makefile.in23
-rw-r--r--src/application-service-appstore.c90
-rw-r--r--src/application-service-marshal.c2
-rw-r--r--src/application-service.c2
-rw-r--r--src/application-service.xml7
-rw-r--r--src/dbus-shared.h1
-rw-r--r--src/gen-application-service.xml.c7
-rw-r--r--src/indicator-application.c94
9 files changed, 165 insertions, 69 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 9b11fd1..e445d78 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,6 +22,7 @@ libapplication_la_SOURCES = \
dbus-shared.h \
indicator-application.c
libapplication_la_CFLAGS = $(INDICATOR_CFLAGS) \
+ $(COVERAGE_CFLAGS) \
-Wall \
-Wl,-Bsymbolic-functions \
-Wl,-z,defs \
@@ -29,7 +30,8 @@ libapplication_la_CFLAGS = $(INDICATOR_CFLAGS) \
-Werror \
-DG_LOG_DOMAIN=\"Indicator-Application\"
libapplication_la_LIBADD = $(INDICATOR_LIBS)
-libapplication_la_LDFLAGS = -module -avoid-version
+libapplication_la_LDFLAGS = $(COVERAGE_LDFLAGS) \
+ -module -avoid-version
##################################
# Service
@@ -57,6 +59,7 @@ indicator_application_service_SOURCES = \
indicator_application_service_CFLAGS = \
$(INDICATOR_CFLAGS) \
$(APPINDICATOR_CFLAGS) \
+ $(COVERAGE_CFLAGS) \
-DDATADIR="\"$(pkgdatadir)\"" \
-Wall -Werror \
-DG_LOG_DOMAIN=\"indicator-application-service\"
@@ -65,6 +68,9 @@ indicator_application_service_LDADD = \
$(INDICATOR_LIBS) \
$(APPINDICATOR_LIBS)
+indicator_application_service_LDFLAGS = \
+ $(COVERAGE_LDFLAGS)
+
glib_marshal_list = application-service-marshal.list
glib_marshal_prefix = _application_service_marshal
diff --git a/src/Makefile.in b/src/Makefile.in
index 45c6786..c430921 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -56,7 +56,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
libexec_PROGRAMS = indicator-application-service$(EXEEXT)
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/m4/gcov.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -116,7 +119,7 @@ indicator_application_service_DEPENDENCIES = $(am__DEPENDENCIES_1) \
indicator_application_service_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(indicator_application_service_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
+ $(indicator_application_service_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -163,6 +166,9 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+COVERAGE_CFLAGS = @COVERAGE_CFLAGS@
+COVERAGE_CXXFLAGS = @COVERAGE_CXXFLAGS@
+COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -178,6 +184,8 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
+GCOVR = @GCOVR@
+GENHTML = @GENHTML@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_MKENUMS = @GLIB_MKENUMS@
GREP = @GREP@
@@ -190,6 +198,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LCOV = @LCOV@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
@@ -223,6 +232,7 @@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SHTOOL = @SHTOOL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
@@ -302,6 +312,7 @@ libapplication_la_SOURCES = \
indicator-application.c
libapplication_la_CFLAGS = $(INDICATOR_CFLAGS) \
+ $(COVERAGE_CFLAGS) \
-Wall \
-Wl,-Bsymbolic-functions \
-Wl,-z,defs \
@@ -310,7 +321,9 @@ libapplication_la_CFLAGS = $(INDICATOR_CFLAGS) \
-DG_LOG_DOMAIN=\"Indicator-Application\"
libapplication_la_LIBADD = $(INDICATOR_LIBS)
-libapplication_la_LDFLAGS = -module -avoid-version
+libapplication_la_LDFLAGS = $(COVERAGE_LDFLAGS) \
+ -module -avoid-version
+
indicator_application_service_SOURCES = \
application-service.c \
application-service-appstore.h \
@@ -326,6 +339,7 @@ indicator_application_service_SOURCES = \
indicator_application_service_CFLAGS = \
$(INDICATOR_CFLAGS) \
$(APPINDICATOR_CFLAGS) \
+ $(COVERAGE_CFLAGS) \
-DDATADIR="\"$(pkgdatadir)\"" \
-Wall -Werror \
-DG_LOG_DOMAIN=\"indicator-application-service\"
@@ -334,6 +348,9 @@ indicator_application_service_LDADD = \
$(INDICATOR_LIBS) \
$(APPINDICATOR_LIBS)
+indicator_application_service_LDFLAGS = \
+ $(COVERAGE_LDFLAGS)
+
glib_marshal_list = application-service-marshal.list
glib_marshal_prefix = _application_service_marshal
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index edc517f..e11883f 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -50,6 +50,7 @@ static void props_cb (GObject * object, GAsyncResult * res, gpointer user_data);
#define NOTIFICATION_ITEM_PROP_MENU "Menu"
#define NOTIFICATION_ITEM_PROP_LABEL "XAyatanaLabel"
#define NOTIFICATION_ITEM_PROP_LABEL_GUIDE "XAyatanaLabelGuide"
+#define NOTIFICATION_ITEM_PROP_TITLE "Title"
#define NOTIFICATION_ITEM_PROP_ORDERING_INDEX "XAyatanaOrderingIndex"
#define NOTIFICATION_ITEM_SIG_NEW_ICON "NewIcon"
@@ -57,6 +58,7 @@ static void props_cb (GObject * object, GAsyncResult * res, gpointer user_data);
#define NOTIFICATION_ITEM_SIG_NEW_STATUS "NewStatus"
#define NOTIFICATION_ITEM_SIG_NEW_LABEL "XAyatanaNewLabel"
#define NOTIFICATION_ITEM_SIG_NEW_ICON_THEME_PATH "NewIconThemePath"
+#define NOTIFICATION_ITEM_SIG_NEW_TITLE "NewTitle"
#define OVERRIDE_GROUP_NAME "Ordering Index Overrides"
#define OVERRIDE_FILE_NAME "ordering-override.keyfile"
@@ -108,6 +110,7 @@ struct _Application {
gchar * icon_theme_path;
gchar * label;
gchar * guide;
+ gchar * title;
gboolean currently_free;
guint ordering_index;
GList * approver_cancels;
@@ -265,8 +268,8 @@ bus_method_call (GDBusConnection * connection, const gchar * sender,
ApplicationServiceAppstore * service = APPLICATION_SERVICE_APPSTORE(user_data);
GVariant * retval = NULL;
Application *app = NULL;
- const gchar *dbusaddress;
- const gchar *dbusmenuobject;
+ gchar *dbusaddress = NULL;
+ gchar *dbusmenuobject = NULL;
if (g_strcmp0(method, "GetApplications") == 0) {
retval = get_applications(service);
@@ -275,7 +278,7 @@ bus_method_call (GDBusConnection * connection, const gchar * sender,
gint delta;
guint direction;
- g_variant_get (params, "(&s&siu)", &dbusaddress, &dbusmenuobject,
+ g_variant_get (params, "(ssiu)", &dbusaddress, &dbusmenuobject,
&delta, &direction);
switch (direction) {
@@ -301,7 +304,7 @@ bus_method_call (GDBusConnection * connection, const gchar * sender,
} else if (g_strcmp0(method, "ApplicationSecondaryActivateEvent") == 0) {
guint time;
- g_variant_get (params, "(&s&su)", &dbusaddress, &dbusmenuobject, &time);
+ g_variant_get (params, "(ssu)", &dbusaddress, &dbusmenuobject, &time);
app = find_application_by_menu(service, dbusaddress, dbusmenuobject);
if (app != NULL && app->dbus_proxy != NULL) {
@@ -313,6 +316,9 @@ bus_method_call (GDBusConnection * connection, const gchar * sender,
g_warning("Calling method '%s' on the indicator service and it's unknown", method);
}
+ g_free(dbusaddress);
+ g_free(dbusmenuobject);
+
g_dbus_method_invocation_return_value(invocation, retval);
return;
}
@@ -403,7 +409,7 @@ load_override_file (GHashTable * hash, const gchar * filename)
return;
}
- gchar * key = keys[0];
+ gchar * key;
gint i;
for (i = 0; (key = keys[i]) != NULL; i++) {
@@ -440,7 +446,7 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
* status = NULL, * icon_name = NULL, * aicon_name = NULL,
* icon_desc = NULL, * aicon_desc = NULL,
* icon_theme_path = NULL, * index = NULL, * label = NULL,
- * guide = NULL;
+ * guide = NULL, * title = NULL;
GVariant * properties = g_dbus_proxy_call_finish(G_DBUS_PROXY(source_object), res, &error);
@@ -494,6 +500,8 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
label = g_variant_ref(value);
} else if (g_strcmp0(name, NOTIFICATION_ITEM_PROP_LABEL_GUIDE) == 0) {
guide = g_variant_ref(value);
+ } else if (g_strcmp0(name, NOTIFICATION_ITEM_PROP_TITLE) == 0) {
+ title = g_variant_ref(value);
} /* else ignore */
}
g_variant_iter_free (iter);
@@ -581,6 +589,13 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
app->guide = g_strdup("");
}
+ g_free(app->title);
+ if (title != NULL) {
+ app->title = g_variant_dup_string(title, NULL);
+ } else {
+ app->title = g_strdup("");
+ }
+
g_list_foreach(priv->approvers, check_with_old_approver, app);
apply_status(app);
@@ -603,6 +618,7 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
if (index) g_variant_unref (index);
if (label) g_variant_unref (label);
if (guide) g_variant_unref (guide);
+ if (title) g_variant_unref (title);
return;
}
@@ -784,6 +800,9 @@ application_free (Application * app)
if (app->guide != NULL) {
g_free(app->guide);
}
+ if (app->title != NULL) {
+ g_free(app->title);
+ }
if (app->approver_cancels != NULL) {
g_list_foreach(app->approver_cancels, (GFunc)g_cancellable_cancel, NULL);
g_list_foreach(app->approver_cancels, (GFunc)g_object_unref, NULL);
@@ -906,12 +925,12 @@ apply_status (Application * app)
if (app->visible_state == VISIBLE_STATE_HIDDEN) {
/* Put on panel */
emit_signal (appstore, "ApplicationAdded",
- g_variant_new ("(sisosssss)", newicon,
+ g_variant_new ("(sisossssss)", newicon,
get_position(app),
app->dbus_name, app->menu,
app->icon_theme_path,
app->label, app->guide,
- newdesc, app->id));
+ newdesc, app->id, app->title));
} else {
/* Icon update */
gint position = get_position(app);
@@ -923,6 +942,9 @@ apply_status (Application * app)
g_variant_new ("(iss)", position,
app->label != NULL ? app->label : "",
app->guide != NULL ? app->guide : ""));
+ emit_signal (appstore, "ApplicationTitleChanged",
+ g_variant_new ("(is)", position,
+ app->title != NULL ? app->title : ""));
}
}
@@ -1039,6 +1061,7 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst
app->icon_theme_path = NULL;
app->label = NULL;
app->guide = NULL;
+ app->title = NULL;
app->currently_free = FALSE;
app->ordering_index = 0;
app->approver_cancels = NULL;
@@ -1076,11 +1099,13 @@ name_changed (GDBusConnection * connection, const gchar * sender_name,
{
Application * app = (Application *)user_data;
- const gchar * new_name;
- g_variant_get(parameters, "(&s&s&s)", NULL, NULL, &new_name);
+ gchar * new_name = NULL;
+ g_variant_get(parameters, "(sss)", NULL, NULL, &new_name);
if (new_name == NULL || new_name[0] == 0)
application_died(app);
+
+ g_free(new_name);
}
/* Callback from trying to create the proxy for the app. */
@@ -1198,20 +1223,28 @@ app_receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name
/* aicon name isn't provided by signal, so look it up */
get_all_properties(app);
}
+ else if (g_strcmp0(signal_name, NOTIFICATION_ITEM_SIG_NEW_TITLE) == 0) {
+ /* title name isn't provided by signal, so look it up */
+ get_all_properties(app);
+ }
else if (g_strcmp0(signal_name, NOTIFICATION_ITEM_SIG_NEW_STATUS) == 0) {
- const gchar * status;
- g_variant_get(parameters, "(&s)", &status);
+ gchar * status = NULL;
+ g_variant_get(parameters, "(s)", &status);
new_status(app, status);
+ g_free(status);
}
else if (g_strcmp0(signal_name, NOTIFICATION_ITEM_SIG_NEW_ICON_THEME_PATH) == 0) {
- const gchar * icon_theme_path;
- g_variant_get(parameters, "(&s)", &icon_theme_path);
+ gchar * icon_theme_path = NULL;
+ g_variant_get(parameters, "(s)", &icon_theme_path);
new_icon_theme_path(app, icon_theme_path);
+ g_free(icon_theme_path);
}
else if (g_strcmp0(signal_name, NOTIFICATION_ITEM_SIG_NEW_LABEL) == 0) {
- const gchar * label, * guide;
- g_variant_get(parameters, "(&s&s)", &label, &guide);
+ gchar * label = NULL, * guide = NULL;
+ g_variant_get(parameters, "(ss)", &label, &guide);
new_label(app, label, guide);
+ g_free(label);
+ g_free(guide);
}
return;
@@ -1323,20 +1356,20 @@ get_applications (ApplicationServiceAppstore * appstore)
continue;
}
- g_variant_builder_add (&builder, "(sisosssss)", app->icon,
+ g_variant_builder_add (&builder, "(sisossssss)", app->icon,
position++, app->dbus_name, app->menu,
app->icon_theme_path, app->label,
app->guide,
(app->icon_desc != NULL) ? app->icon_desc : "",
- app->id);
+ app->id, app->title);
}
out = g_variant_builder_end(&builder);
} else {
GError * error = NULL;
- out = g_variant_parse(g_variant_type_new("a(sisosssss)"), "[]", NULL, NULL, &error);
+ out = g_variant_parse(g_variant_type_new("a(sisossssss)"), "[]", NULL, NULL, &error);
if (error != NULL) {
- g_warning("Unable to parse '[]' as a 'a(sisosssss)': %s", error->message);
+ g_warning("Unable to parse '[]' as a 'a(sisossssss)': %s", error->message);
out = NULL;
g_error_free(error);
}
@@ -1536,13 +1569,16 @@ approver_name_changed (GDBusConnection * connection, const gchar * sender_name,
Approver * approver = (Approver *)user_data;
ApplicationServiceAppstore * appstore = approver->appstore;
- const gchar * new_name;
- g_variant_get(parameters, "(&s&s&s)", NULL, NULL, &new_name);
+ gchar * new_name = NULL;
+ g_variant_get(parameters, "(sss)", NULL, NULL, &new_name);
if (new_name == NULL || new_name[0] == 0) {
appstore->priv->approvers = g_list_remove(appstore->priv->approvers, approver);
approver_free(approver, appstore);
}
+
+ g_free(new_name);
+ return;
}
/* Callback from trying to create the proxy for the approver. */
@@ -1607,11 +1643,13 @@ approver_receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal
Approver * approver = (Approver *)user_data;
if (g_strcmp0(signal_name, "ReviseJudgement") == 0) {
- gboolean approved;
- const gchar * address;
- const gchar * path;
- g_variant_get(parameters, "(b&s&o)", &approved, &address, &path);
+ gboolean approved = FALSE;
+ gchar * address = NULL;
+ gchar * path = NULL;
+ g_variant_get(parameters, "(bso)", &approved, &address, &path);
approver_revise_judgement(approver, approved, address, path);
+ g_free(address);
+ g_free(path);
}
return;
diff --git a/src/application-service-marshal.c b/src/application-service-marshal.c
index e109d7c..0079e53 100644
--- a/src/application-service-marshal.c
+++ b/src/application-service-marshal.c
@@ -5,7 +5,7 @@
#ifdef G_ENABLE_DEBUG
#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
-#define g_marshal_value_peek_char(v) g_value_get_char (v)
+#define g_marshal_value_peek_char(v) g_value_get_schar (v)
#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
#define g_marshal_value_peek_int(v) g_value_get_int (v)
#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
diff --git a/src/application-service.c b/src/application-service.c
index 68ac264..bc1787f 100644
--- a/src/application-service.c
+++ b/src/application-service.c
@@ -55,7 +55,7 @@ main (int argc, char ** argv)
g_type_init();
/* Bring us up as a basic indicator service */
- service = indicator_service_new(INDICATOR_APPLICATION_DBUS_ADDR);
+ service = indicator_service_new_version(INDICATOR_APPLICATION_DBUS_ADDR, INDICATOR_APPLICATION_SERVICE_VERSION);
g_signal_connect(G_OBJECT(service), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, G_CALLBACK(service_disconnected), NULL);
/* Building our app store */
diff --git a/src/application-service.xml b/src/application-service.xml
index 434cfd8..9428ebb 100644
--- a/src/application-service.xml
+++ b/src/application-service.xml
@@ -26,7 +26,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
<!-- Methods -->
<method name="GetApplications">
- <arg type="a(sisosssss)" name="applications" direction="out" />
+ <arg type="a(sisossssss)" name="applications" direction="out" />
</method>
<method name="ApplicationScrollEvent">
<arg type="s" name="dbusaddress" direction="in" />
@@ -51,6 +51,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
<arg type="s" name="labelguide" direction="out" />
<arg type="s" name="accessibledesc" direction="out" />
<arg type="s" name="hint" direction="out" />
+ <arg type="s" name="title" direction="out" />
</signal>
<signal name="ApplicationRemoved">
<arg type="i" name="position" direction="out" />
@@ -69,5 +70,9 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
<arg type="s" name="label" direction="out" />
<arg type="s" name="guide" direction="out" />
</signal>
+ <signal name="ApplicationTitleChanged">
+ <arg type="i" name="position" direction="out" />
+ <arg type="s" name="title" direction="out" />
+ </signal>
</interface>
</node>
diff --git a/src/dbus-shared.h b/src/dbus-shared.h
index 6144b9b..ce27bd9 100644
--- a/src/dbus-shared.h
+++ b/src/dbus-shared.h
@@ -23,6 +23,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#define INDICATOR_APPLICATION_DBUS_ADDR "com.canonical.indicator.application"
#define INDICATOR_APPLICATION_DBUS_OBJ "/com/canonical/indicator/application/service"
#define INDICATOR_APPLICATION_DBUS_IFACE "com.canonical.indicator.application.service"
+#define INDICATOR_APPLICATION_SERVICE_VERSION 2
#define NOTIFICATION_WATCHER_DBUS_ADDR "org.kde.StatusNotifierWatcher"
#define NOTIFICATION_WATCHER_DBUS_OBJ "/StatusNotifierWatcher"
diff --git a/src/gen-application-service.xml.c b/src/gen-application-service.xml.c
index adf7eef..f01a6f8 100644
--- a/src/gen-application-service.xml.c
+++ b/src/gen-application-service.xml.c
@@ -27,7 +27,7 @@ const char * _application_service =
"\n"
"<!-- Methods -->\n"
" <method name=\"GetApplications\">\n"
-" <arg type=\"a(sisosssss)\" name=\"applications\" direction=\"out\" />\n"
+" <arg type=\"a(sisossssss)\" name=\"applications\" direction=\"out\" />\n"
" </method>\n"
" <method name=\"ApplicationScrollEvent\">\n"
" <arg type=\"s\" name=\"dbusaddress\" direction=\"in\" />\n"
@@ -52,6 +52,7 @@ const char * _application_service =
" <arg type=\"s\" name=\"labelguide\" direction=\"out\" />\n"
" <arg type=\"s\" name=\"accessibledesc\" direction=\"out\" />\n"
" <arg type=\"s\" name=\"hint\" direction=\"out\" />\n"
+" <arg type=\"s\" name=\"title\" direction=\"out\" />\n"
" </signal>\n"
" <signal name=\"ApplicationRemoved\">\n"
" <arg type=\"i\" name=\"position\" direction=\"out\" />\n"
@@ -70,6 +71,10 @@ const char * _application_service =
" <arg type=\"s\" name=\"label\" direction=\"out\" />\n"
" <arg type=\"s\" name=\"guide\" direction=\"out\" />\n"
" </signal>\n"
+" <signal name=\"ApplicationTitleChanged\">\n"
+" <arg type=\"i\" name=\"position\" direction=\"out\" />\n"
+" <arg type=\"s\" name=\"title\" direction=\"out\" />\n"
+" </signal>\n"
" </interface>\n"
"</node>\n"
;
diff --git a/src/indicator-application.c b/src/indicator-application.c
index 24ec7d4..2c4f232 100644
--- a/src/indicator-application.c
+++ b/src/indicator-application.c
@@ -32,11 +32,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <gtk/gtk.h>
/* DBus Stuff */
-#ifdef HAVE_GTK3
-#include <libdbusmenu-gtk3/menu.h>
-#else
#include <libdbusmenu-gtk/menu.h>
-#endif
/* Indicator Stuff */
#include <libindicator/indicator.h>
@@ -162,7 +158,7 @@ indicator_application_init (IndicatorApplication *self)
priv->theme_dirs = NULL;
priv->disconnect_kill = 0;
- priv->sm = indicator_service_manager_new(INDICATOR_APPLICATION_DBUS_ADDR);
+ priv->sm = indicator_service_manager_new_version(INDICATOR_APPLICATION_DBUS_ADDR, INDICATOR_APPLICATION_SERVICE_VERSION);
g_signal_connect(G_OBJECT(priv->sm), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_changed), self);
priv->applications = NULL;
@@ -806,22 +802,32 @@ receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name,
}
if (g_strcmp0(signal_name, "ApplicationAdded") == 0) {
- const gchar * iconname;
+ gchar * iconname = NULL;
gint position;
- const gchar * dbusaddress;
- const gchar * dbusobject;
- const gchar * icon_theme_path;
- const gchar * label;
- const gchar * guide;
- const gchar * accessible_desc;
- const gchar * hint;
- g_variant_get (parameters, "(&si&s&o&s&s&s&s&s)", &iconname,
+ gchar * dbusaddress = NULL;
+ gchar * dbusobject = NULL;
+ gchar * icon_theme_path = NULL;
+ gchar * label = NULL;
+ gchar * guide = NULL;
+ gchar * accessible_desc = NULL;
+ gchar * hint = NULL;
+ gchar * title = NULL;
+ g_variant_get (parameters, "(sisossssss)", &iconname,
&position, &dbusaddress, &dbusobject,
&icon_theme_path, &label, &guide,
- &accessible_desc, &hint);
+ &accessible_desc, &hint, &title);
application_added(self, iconname, position, dbusaddress,
dbusobject, icon_theme_path, label, guide,
accessible_desc, hint);
+ g_free(iconname);
+ g_free(dbusaddress);
+ g_free(dbusobject);
+ g_free(icon_theme_path);
+ g_free(label);
+ g_free(guide);
+ g_free(accessible_desc);
+ g_free(hint);
+ g_free(title);
}
else if (g_strcmp0(signal_name, "ApplicationRemoved") == 0) {
gint position;
@@ -830,23 +836,28 @@ receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name,
}
else if (g_strcmp0(signal_name, "ApplicationIconChanged") == 0) {
gint position;
- const gchar * iconname;
- const gchar * icondesc;
- g_variant_get (parameters, "(i&s&s)", &position, &iconname, &icondesc);
+ gchar * iconname = NULL;
+ gchar * icondesc = NULL;
+ g_variant_get (parameters, "(iss)", &position, &iconname, &icondesc);
application_icon_changed(self, position, iconname, icondesc);
+ g_free(iconname);
+ g_free(icondesc);
}
else if (g_strcmp0(signal_name, "ApplicationIconThemePathChanged") == 0) {
gint position;
- const gchar * icon_theme_path;
- g_variant_get (parameters, "(i&s)", &position, &icon_theme_path);
+ gchar * icon_theme_path = NULL;
+ g_variant_get (parameters, "(is)", &position, &icon_theme_path);
application_icon_theme_path_changed(self, position, icon_theme_path);
+ g_free(icon_theme_path);
}
else if (g_strcmp0(signal_name, "ApplicationLabelChanged") == 0) {
gint position;
- const gchar * label;
- const gchar * guide;
- g_variant_get (parameters, "(i&s&s)", &position, &label, &guide);
+ gchar * label = NULL;
+ gchar * guide = NULL;
+ g_variant_get (parameters, "(iss)", &position, &label, &guide);
application_label_changed(self, position, label, guide);
+ g_free(label);
+ g_free(guide);
}
return;
@@ -888,7 +899,7 @@ get_applications (GObject * obj, GAsyncResult * res, gpointer user_data)
}
/* Get our new applications that we got in the request */
- g_variant_get(result, "(a(sisosssss))", &iter);
+ g_variant_get(result, "(a(sisossssss))", &iter);
while ((child = g_variant_iter_next_value (iter))) {
get_applications_helper(self, child);
g_variant_unref(child);
@@ -904,20 +915,33 @@ get_applications (GObject * obj, GAsyncResult * res, gpointer user_data)
static void
get_applications_helper (IndicatorApplication * self, GVariant * variant)
{
- const gchar * icon_name;
+ gchar * icon_name = NULL;
gint position;
- const gchar * dbus_address;
- const gchar * dbus_object;
- const gchar * icon_theme_path;
- const gchar * label;
- const gchar * guide;
- const gchar * accessible_desc;
- const gchar * hint;
- g_variant_get(variant, "(sisosssss)", &icon_name, &position,
+ gchar * dbus_address = NULL;
+ gchar * dbus_object = NULL;
+ gchar * icon_theme_path = NULL;
+ gchar * label = NULL;
+ gchar * guide = NULL;
+ gchar * accessible_desc = NULL;
+ gchar * hint = NULL;
+ gchar * title = NULL;
+ g_variant_get(variant, "(sisossssss)", &icon_name, &position,
&dbus_address, &dbus_object, &icon_theme_path, &label,
- &guide, &accessible_desc, &hint);
+ &guide, &accessible_desc, &hint, &title);
+
+ application_added(self, icon_name, position, dbus_address, dbus_object, icon_theme_path, label, guide, accessible_desc, hint);
- return application_added(self, icon_name, position, dbus_address, dbus_object, icon_theme_path, label, guide, accessible_desc, hint);
+ g_free(icon_name);
+ g_free(dbus_address);
+ g_free(dbus_object);
+ g_free(icon_theme_path);
+ g_free(label);
+ g_free(guide);
+ g_free(accessible_desc);
+ g_free(hint);
+ g_free(title);
+
+ return;
}
/* Unrefs a theme directory. This may involve removing it from