aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-07-09 15:58:34 -0500
committerTed Gould <ted@gould.cx>2010-07-09 15:58:34 -0500
commit93572f1975170710345344512204e45e6eb3b145 (patch)
tree2f1075ea3f07c163bbb9464dfd881dd348b389c0 /src
parent298644534b236239d0c30d63456bae07a31c8d5e (diff)
downloadlibayatana-appindicator-93572f1975170710345344512204e45e6eb3b145.tar.gz
libayatana-appindicator-93572f1975170710345344512204e45e6eb3b145.tar.bz2
libayatana-appindicator-93572f1975170710345344512204e45e6eb3b145.zip
Adding some structures for approvers and making them real.
Diffstat (limited to 'src')
-rw-r--r--src/application-service-appstore.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 340548f..335cd63 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -53,9 +53,15 @@ static gboolean _application_service_server_get_applications (ApplicationService
struct _ApplicationServiceAppstorePrivate {
DBusGConnection * bus;
GList * applications;
+ GList * approvers;
AppLruFile * lrufile;
};
+typedef struct _Approver Approver;
+struct _Approver {
+ DBusGProxy * proxy;
+};
+
typedef struct _Application Application;
struct _Application {
gchar * id;
@@ -94,6 +100,7 @@ static void application_service_appstore_dispose (GObject *object);
static void application_service_appstore_finalize (GObject *object);
static AppIndicatorStatus string_to_status(const gchar * status_string);
static void apply_status (Application * app, AppIndicatorStatus status);
+void approver_free (gpointer papprover, gpointer user_data);
G_DEFINE_TYPE (ApplicationServiceAppstore, application_service_appstore, G_TYPE_OBJECT);
@@ -142,6 +149,7 @@ application_service_appstore_init (ApplicationServiceAppstore *self)
ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE (self);
priv->applications = NULL;
+ priv->approvers = NULL;
priv->lrufile = NULL;
GError * error = NULL;
@@ -172,6 +180,12 @@ application_service_appstore_dispose (GObject *object)
((Application *)priv->applications->data)->dbus_object);
}
+ if (priv->approvers != NULL) {
+ g_list_foreach(priv->approvers, approver_free, NULL);
+ g_list_free(priv->approvers);
+ priv->approvers = NULL;
+ }
+
G_OBJECT_CLASS (application_service_appstore_parent_class)->dispose (object);
return;
}
@@ -746,6 +760,21 @@ _application_service_server_get_applications (ApplicationServiceAppstore * appst
}
void
+approver_free (gpointer papprover, gpointer user_data)
+{
+ Approver * approver = (Approver *)papprover;
+ g_return_if_fail(approver != NULL);
+
+ if (approver->proxy != NULL) {
+ g_object_unref(approver->proxy);
+ approver->proxy = NULL;
+ }
+
+ g_free(approver);
+ return;
+}
+
+void
application_service_appstore_approver_add (ApplicationServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object)
{