aboutsummaryrefslogtreecommitdiff
path: root/src/application-service-appstore.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-02-03 20:55:43 -0600
committerTed Gould <ted@gould.cx>2012-02-03 20:55:43 -0600
commit79e3bfeacfc134a7a96b2a47b2ca3f285535262c (patch)
tree70f9a681b86e5b4403ad9c14439bb66116101f17 /src/application-service-appstore.c
parent11f93ebdf7936dbdbfac5b5d9bec89826884faf8 (diff)
downloadayatana-indicator-application-79e3bfeacfc134a7a96b2a47b2ca3f285535262c.tar.gz
ayatana-indicator-application-79e3bfeacfc134a7a96b2a47b2ca3f285535262c.tar.bz2
ayatana-indicator-application-79e3bfeacfc134a7a96b2a47b2ca3f285535262c.zip
Fixing variant usage
Diffstat (limited to 'src/application-service-appstore.c')
-rw-r--r--src/application-service-appstore.c48
1 files changed, 31 insertions, 17 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 0548ced..587557e 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -268,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;
+ gchar *dbusmenuobject;
if (g_strcmp0(method, "GetApplications") == 0) {
retval = get_applications(service);
@@ -278,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) {
@@ -304,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) {
@@ -316,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;
}
@@ -1096,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;
+ 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. */
@@ -1223,19 +1228,23 @@ app_receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name
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;
+ 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;
+ 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, * guide;
+ g_variant_get(parameters, "(ss)", &label, &guide);
new_label(app, label, guide);
+ g_free(label);
+ g_free(guide);
}
return;
@@ -1560,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;
+ 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. */
@@ -1632,10 +1644,12 @@ approver_receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal
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);
+ gchar * address;
+ gchar * path;
+ g_variant_get(parameters, "(bso)", &approved, &address, &path);
approver_revise_judgement(approver, approved, address, path);
+ g_free(address);
+ g_free(path);
}
return;