From 37d7bd75ad4cbba67844e2c0375bad9fce0dfae2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 3 Feb 2012 16:47:38 -0600 Subject: Fixing includes to match dbusmenu v0.5.90 --- src/indicator-application.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/indicator-application.c') diff --git a/src/indicator-application.c b/src/indicator-application.c index 24ec7d4..173124c 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -32,11 +32,7 @@ with this program. If not, see . #include /* DBus Stuff */ -#ifdef HAVE_GTK3 -#include -#else #include -#endif /* Indicator Stuff */ #include -- cgit v1.2.3 From 3ceb0322953f0ddfb7fe69ae703ac5c775a7fe00 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 3 Feb 2012 20:34:52 -0600 Subject: Adding in service versions to detect the dbus API change --- src/indicator-application.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/indicator-application.c') diff --git a/src/indicator-application.c b/src/indicator-application.c index 173124c..d515e34 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -158,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; -- cgit v1.2.3 From 432817d5e245989beb6438c352c61114742c394f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 3 Feb 2012 20:41:29 -0600 Subject: Changing the signatures on the indicator side, we don't care much about title though. --- src/indicator-application.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/indicator-application.c') diff --git a/src/indicator-application.c b/src/indicator-application.c index d515e34..8b28ebc 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -811,10 +811,11 @@ receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name, const gchar * guide; const gchar * accessible_desc; const gchar * hint; - g_variant_get (parameters, "(&si&s&o&s&s&s&s&s)", &iconname, + const gchar * title; + g_variant_get (parameters, "(&si&s&o&s&s&s&s&s&s)", &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); @@ -884,7 +885,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); @@ -909,9 +910,10 @@ get_applications_helper (IndicatorApplication * self, GVariant * variant) const gchar * guide; const gchar * accessible_desc; const gchar * hint; - g_variant_get(variant, "(sisosssss)", &icon_name, &position, + const gchar * title; + 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); return application_added(self, icon_name, position, dbus_address, dbus_object, icon_theme_path, label, guide, accessible_desc, hint); } -- cgit v1.2.3 From 3bfb6d6b5b10c2ef34414763f975eed2525c3d2e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 3 Feb 2012 20:47:53 -0600 Subject: Fixing some of the variant usage to free strings appropriately --- src/indicator-application.c | 82 +++++++++++++++++++++++++++++---------------- 1 file changed, 54 insertions(+), 28 deletions(-) (limited to 'src/indicator-application.c') diff --git a/src/indicator-application.c b/src/indicator-application.c index 8b28ebc..577008d 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -802,23 +802,32 @@ receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name, } if (g_strcmp0(signal_name, "ApplicationAdded") == 0) { - const gchar * iconname; + gchar * iconname; 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; - const gchar * title; - g_variant_get (parameters, "(&si&s&o&s&s&s&s&s&s)", &iconname, + gchar * dbusaddress; + gchar * dbusobject; + gchar * icon_theme_path; + gchar * label; + gchar * guide; + gchar * accessible_desc; + gchar * hint; + gchar * title; + g_variant_get (parameters, "(sisossssss)", &iconname, &position, &dbusaddress, &dbusobject, &icon_theme_path, &label, &guide, &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; @@ -827,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; + gchar * icondesc; + 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; + 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; + gchar * guide; + g_variant_get (parameters, "(iss)", &position, &label, &guide); application_label_changed(self, position, label, guide); + g_free(label); + g_free(guide); } return; @@ -901,21 +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; 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; - const gchar * title; + gchar * dbus_address; + gchar * dbus_object; + gchar * icon_theme_path; + gchar * label; + gchar * guide; + gchar * accessible_desc; + gchar * hint; + gchar * title; g_variant_get(variant, "(sisossssss)", &icon_name, &position, &dbus_address, &dbus_object, &icon_theme_path, &label, &guide, &accessible_desc, &hint, &title); - return application_added(self, icon_name, position, dbus_address, dbus_object, icon_theme_path, label, guide, accessible_desc, hint); + 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 -- cgit v1.2.3 From 4145c58e2ee3191f2557f1e558adda0d1f387223 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 3 Feb 2012 22:12:26 -0600 Subject: Making sure to initial string pointers --- src/indicator-application.c | 46 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/indicator-application.c') diff --git a/src/indicator-application.c b/src/indicator-application.c index 577008d..2c4f232 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -802,16 +802,16 @@ receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name, } if (g_strcmp0(signal_name, "ApplicationAdded") == 0) { - gchar * iconname; + gchar * iconname = NULL; gint position; - gchar * dbusaddress; - gchar * dbusobject; - gchar * icon_theme_path; - gchar * label; - gchar * guide; - gchar * accessible_desc; - gchar * hint; - gchar * title; + 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, @@ -836,8 +836,8 @@ receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name, } else if (g_strcmp0(signal_name, "ApplicationIconChanged") == 0) { gint position; - gchar * iconname; - gchar * 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); @@ -845,15 +845,15 @@ receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name, } else if (g_strcmp0(signal_name, "ApplicationIconThemePathChanged") == 0) { gint position; - gchar * 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; - gchar * label; - gchar * 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); @@ -915,16 +915,16 @@ get_applications (GObject * obj, GAsyncResult * res, gpointer user_data) static void get_applications_helper (IndicatorApplication * self, GVariant * variant) { - gchar * icon_name; + gchar * icon_name = NULL; gint position; - gchar * dbus_address; - gchar * dbus_object; - gchar * icon_theme_path; - gchar * label; - gchar * guide; - gchar * accessible_desc; - gchar * hint; - gchar * title; + 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, &title); -- cgit v1.2.3