From a46a27a598890cd49f67b076866fc6b4b6042485 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 25 Jun 2010 14:34:03 -0500 Subject: Adding an approver interface. --- src/Makefile.am | 1 + src/notification-approver.xml | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/notification-approver.xml (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 787ba2f..68be1c0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -116,6 +116,7 @@ libappindicator_la_LIBADD = \ DBUS_SPECS = \ dbus-properties.xml \ application-service.xml \ + notification-approver.xml \ notification-item.xml \ notification-watcher.xml diff --git a/src/notification-approver.xml b/src/notification-approver.xml new file mode 100644 index 0000000..e7ba780 --- /dev/null +++ b/src/notification-approver.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 4c9f4340d8ba171ed3c6edf2cbaf8de498e4493d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 25 Jun 2010 14:38:21 -0500 Subject: Adding a function to register an approver. --- src/notification-watcher.xml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/notification-watcher.xml b/src/notification-watcher.xml index c2324f1..06a7785 100644 --- a/src/notification-watcher.xml +++ b/src/notification-watcher.xml @@ -22,6 +22,12 @@ + + + + + + -- cgit v1.2.3 From 6cf35d78ab649d06cc3d74710e8d06b22871ebb1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 25 Jun 2010 14:43:16 -0500 Subject: Adding in a template function to register approvers. --- src/application-service-watcher.c | 8 ++++++++ src/notification-watcher.xml | 1 + 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index eff249d..844585d 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -34,6 +34,7 @@ static gboolean _notification_watcher_server_register_status_notifier_item (Appl static gboolean _notification_watcher_server_registered_status_notifier_items (ApplicationServiceWatcher * appwatcher, GArray ** apps); static gboolean _notification_watcher_server_protocol_version (ApplicationServiceWatcher * appwatcher, char ** version); static gboolean _notification_watcher_server_register_notification_host (ApplicationServiceWatcher * appwatcher, const gchar * host); +static gboolean _notification_watcher_server_register_notification_approver (ApplicationServiceWatcher * appwatcher, const GValue * path, const GArray * categories, DBusGMethodInvocation * method); static gboolean _notification_watcher_server_is_notification_host_registered (ApplicationServiceWatcher * appwatcher, gboolean * haveHost); static void get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer data); @@ -249,3 +250,10 @@ get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer data) return; } + +static gboolean +_notification_watcher_server_register_notification_approver (ApplicationServiceWatcher * appwatcher, const GValue * path, const GArray * categories, DBusGMethodInvocation * method) +{ + + return FALSE; +} diff --git a/src/notification-watcher.xml b/src/notification-watcher.xml index 06a7785..cc7882d 100644 --- a/src/notification-watcher.xml +++ b/src/notification-watcher.xml @@ -23,6 +23,7 @@ + -- cgit v1.2.3 From a8aac3aa0fd375c258579df7bc9db031900966dd Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 1 Jul 2010 14:29:30 -0500 Subject: Return a boolean --- src/notification-approver.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/notification-approver.xml b/src/notification-approver.xml index e7ba780..b1e69b9 100644 --- a/src/notification-approver.xml +++ b/src/notification-approver.xml @@ -15,7 +15,7 @@ - + -- cgit v1.2.3 From 925e3d8fea64fecdb16ce4a83750abb414f8687b Mon Sep 17 00:00:00 2001 From: Sense Hofstede Date: Thu, 8 Jul 2010 20:45:51 +0200 Subject: Removed all but one calls to the APPLICATION_SERVICE_APPSTORE_GET_PRIVATE() macro All references to the APPLICATION_SERVICE_APPSTORE_GET_PRIVATE() macro were removed from src/application-service-appstore.c. This makes this file comply with the recommended practise, which should reduce overhead. --- src/application-service-appstore.c | 22 ++++++++++++---------- src/application-service-appstore.h | 3 +++ 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 15abea3..886fe92 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -50,7 +50,6 @@ static gboolean _application_service_server_get_applications (ApplicationService #define NOTIFICATION_ITEM_SIG_NEW_STATUS "NewStatus" /* Private Stuff */ -typedef struct _ApplicationServiceAppstorePrivate ApplicationServiceAppstorePrivate; struct _ApplicationServiceAppstorePrivate { DBusGConnection * bus; GList * applications; @@ -139,7 +138,8 @@ application_service_appstore_class_init (ApplicationServiceAppstoreClass *klass) static void application_service_appstore_init (ApplicationServiceAppstore *self) { - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(self); + + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE (self); priv->applications = NULL; priv->lrufile = NULL; @@ -155,6 +155,8 @@ application_service_appstore_init (ApplicationServiceAppstore *self) dbus_g_connection_register_g_object(priv->bus, INDICATOR_APPLICATION_DBUS_OBJ, G_OBJECT(self)); + + self->priv = priv; return; } @@ -162,7 +164,7 @@ application_service_appstore_init (ApplicationServiceAppstore *self) static void application_service_appstore_dispose (GObject *object) { - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(object); + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE(object)->priv; while (priv->applications != NULL) { application_service_appstore_application_remove(APPLICATION_SERVICE_APPSTORE(object), @@ -209,7 +211,7 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err app->id = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ID)); app->category = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_CATEGORY)); - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(app->appstore); + ApplicationServiceAppstorePrivate * priv = app->appstore->priv; app_lru_file_touch(priv->lrufile, app->id, app->category); app->icon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME)); @@ -265,7 +267,7 @@ string_to_status(const gchar * status_string) static gint get_position (Application * app) { ApplicationServiceAppstore * appstore = app->appstore; - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + ApplicationServiceAppstorePrivate * priv = appstore->priv; GList * applistitem = g_list_find(priv->applications, app); if (applistitem == NULL) { @@ -384,7 +386,7 @@ apply_status (Application * app, AppIndicatorStatus status) g_debug("Changing app status to: %d", status); ApplicationServiceAppstore * appstore = app->appstore; - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + ApplicationServiceAppstorePrivate * priv = appstore->priv; /* This means we're going off line */ if (status == APP_INDICATOR_STATUS_PASSIVE) { @@ -567,7 +569,7 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst g_return_if_fail(IS_APPLICATION_SERVICE_APPSTORE(appstore)); g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0'); g_return_if_fail(dbus_object != NULL && dbus_object[0] != '\0'); - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + ApplicationServiceAppstorePrivate * priv = appstore->priv; /* Build the application entry. This will be carried along until we're sure we've got everything. */ @@ -665,7 +667,7 @@ application_service_appstore_application_remove (ApplicationServiceAppstore * ap g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0'); g_return_if_fail(dbus_object != NULL && dbus_object[0] != '\0'); - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + ApplicationServiceAppstorePrivate * priv = appstore->priv; GList * listpntr; for (listpntr = priv->applications; listpntr != NULL; listpntr = g_list_next(listpntr)) { @@ -687,7 +689,7 @@ application_service_appstore_new (AppLruFile * lrufile) { g_return_val_if_fail(IS_APP_LRU_FILE(lrufile), NULL); ApplicationServiceAppstore * appstore = APPLICATION_SERVICE_APPSTORE(g_object_new(APPLICATION_SERVICE_APPSTORE_TYPE, NULL)); - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + ApplicationServiceAppstorePrivate * priv = appstore->priv; priv->lrufile = lrufile; return appstore; } @@ -696,7 +698,7 @@ application_service_appstore_new (AppLruFile * lrufile) static gboolean _application_service_server_get_applications (ApplicationServiceAppstore * appstore, GPtrArray ** apps, GError ** error) { - ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + ApplicationServiceAppstorePrivate * priv = appstore->priv; *apps = g_ptr_array_new(); GList * listpntr; diff --git a/src/application-service-appstore.h b/src/application-service-appstore.h index d2e0013..86d989b 100644 --- a/src/application-service-appstore.h +++ b/src/application-service-appstore.h @@ -38,6 +38,7 @@ G_BEGIN_DECLS typedef struct _ApplicationServiceAppstore ApplicationServiceAppstore; typedef struct _ApplicationServiceAppstoreClass ApplicationServiceAppstoreClass; +typedef struct _ApplicationServiceAppstorePrivate ApplicationServiceAppstorePrivate; struct _ApplicationServiceAppstoreClass { GObjectClass parent_class; @@ -49,6 +50,8 @@ struct _ApplicationServiceAppstoreClass { struct _ApplicationServiceAppstore { GObject parent; + + ApplicationServiceAppstorePrivate * priv; }; ApplicationServiceAppstore * application_service_appstore_new (AppLruFile * lrufile); -- cgit v1.2.3 From d7c73248a5dccdb3929ed959f027366028ed757e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 15:13:48 -0500 Subject: Adding a function to bring in approvers --- src/application-service-appstore.c | 7 +++++++ src/application-service-appstore.h | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 886fe92..340548f 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -745,3 +745,10 @@ _application_service_server_get_applications (ApplicationServiceAppstore * appst return TRUE; } +void +application_service_appstore_approver_add (ApplicationServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object) +{ + + return; +} + diff --git a/src/application-service-appstore.h b/src/application-service-appstore.h index 86d989b..e8ba8c1 100644 --- a/src/application-service-appstore.h +++ b/src/application-service-appstore.h @@ -57,11 +57,14 @@ struct _ApplicationServiceAppstore { ApplicationServiceAppstore * application_service_appstore_new (AppLruFile * lrufile); GType application_service_appstore_get_type (void); void application_service_appstore_application_add (ApplicationServiceAppstore * appstore, - const gchar * dbus_name, - const gchar * dbus_object); + const gchar * dbus_name, + const gchar * dbus_object); void application_service_appstore_application_remove (ApplicationServiceAppstore * appstore, - const gchar * dbus_name, - const gchar * dbus_object); + const gchar * dbus_name, + const gchar * dbus_object); +void application_service_appstore_approver_add (ApplicationServiceAppstore * appstore, + const gchar * dbus_name, + const gchar * dbus_object); G_END_DECLS -- cgit v1.2.3 From 298644534b236239d0c30d63456bae07a31c8d5e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 15:20:13 -0500 Subject: For DBus to real objects, the signal shall travel. --- src/application-service-watcher.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index 844585d..4fe3bc7 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -34,7 +34,7 @@ static gboolean _notification_watcher_server_register_status_notifier_item (Appl static gboolean _notification_watcher_server_registered_status_notifier_items (ApplicationServiceWatcher * appwatcher, GArray ** apps); static gboolean _notification_watcher_server_protocol_version (ApplicationServiceWatcher * appwatcher, char ** version); static gboolean _notification_watcher_server_register_notification_host (ApplicationServiceWatcher * appwatcher, const gchar * host); -static gboolean _notification_watcher_server_register_notification_approver (ApplicationServiceWatcher * appwatcher, const GValue * path, const GArray * categories, DBusGMethodInvocation * method); +static gboolean _notification_watcher_server_register_notification_approver (ApplicationServiceWatcher * appwatcher, const gchar * path, const GArray * categories, DBusGMethodInvocation * method); static gboolean _notification_watcher_server_is_notification_host_registered (ApplicationServiceWatcher * appwatcher, gboolean * haveHost); static void get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer data); @@ -252,8 +252,14 @@ get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer data) } static gboolean -_notification_watcher_server_register_notification_approver (ApplicationServiceWatcher * appwatcher, const GValue * path, const GArray * categories, DBusGMethodInvocation * method) +_notification_watcher_server_register_notification_approver (ApplicationServiceWatcher * appwatcher, const gchar * path, const GArray * categories, DBusGMethodInvocation * method) { + ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher); - return FALSE; + application_service_appstore_approver_add(priv->appstore, + dbus_g_method_get_sender(method), + path); + + dbus_g_method_return(method, G_TYPE_NONE); + return TRUE; } -- cgit v1.2.3 From 93572f1975170710345344512204e45e6eb3b145 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 15:58:34 -0500 Subject: Adding some structures for approvers and making them real. --- src/application-service-appstore.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src') 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; } @@ -745,6 +759,21 @@ _application_service_server_get_applications (ApplicationServiceAppstore * appst return TRUE; } +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) { -- cgit v1.2.3 From 4f7e748e6fc9a5b190b527b3089aa7bcffad092b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 15:59:35 -0500 Subject: Comments --- src/application-service-appstore.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 335cd63..4b5004c 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -759,6 +759,7 @@ _application_service_server_get_applications (ApplicationServiceAppstore * appst return TRUE; } +/* Frees the data associated with an approver */ void approver_free (gpointer papprover, gpointer user_data) { @@ -774,6 +775,7 @@ approver_free (gpointer papprover, gpointer user_data) return; } +/* Adds a new approver to the app store */ void application_service_appstore_approver_add (ApplicationServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object) { -- cgit v1.2.3 From a281700349fbbcf9cc5df505c9d75b922da662a2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 16:06:37 -0500 Subject: Building the approver structure and putting it in the list. --- src/application-service-appstore.c | 21 +++++++++++++++++++++ src/dbus-shared.h | 2 ++ 2 files changed, 23 insertions(+) (limited to 'src') diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 4b5004c..e4c2d4c 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -779,6 +779,27 @@ approver_free (gpointer papprover, gpointer user_data) void application_service_appstore_approver_add (ApplicationServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object) { + g_return_if_fail(IS_APPLICATION_SERVICE_APPSTORE(appstore)); + g_return_if_fail(dbus_name != NULL); + g_return_if_fail(dbus_object != NULL); + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE (appstore); + + Approver * approver = g_new0(Approver, 1); + + GError * error = NULL; + approver->proxy = dbus_g_proxy_new_for_name_owner(priv->bus, + dbus_name, + dbus_object, + NOTIFICATION_APPROVER_DBUS_IFACE, + &error); + if (error != NULL) { + g_warning("Unable to get approver interface on '%s:%s' : %s", dbus_name, dbus_object, error->message); + g_error_free(error); + g_free(approver); + return; + } + + priv->approvers = g_list_prepend(priv->approvers, approver); return; } diff --git a/src/dbus-shared.h b/src/dbus-shared.h index f158b1c..1d8d89c 100644 --- a/src/dbus-shared.h +++ b/src/dbus-shared.h @@ -31,3 +31,5 @@ with this program. If not, see . #define NOTIFICATION_ITEM_DBUS_IFACE "org.kde.StatusNotifierItem" #define NOTIFICATION_ITEM_DEFAULT_OBJ "/StatusNotifierItem" +#define NOTIFICATION_APPROVER_DBUS_IFACE "org.ayatana.StatusNotifierApprover" + -- cgit v1.2.3 From b3a0f3e22a8ec154dd738019fbf3dff346188aee Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 16:16:48 -0500 Subject: Looking at all the applications when we get a new approver. --- src/application-service-appstore.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index e4c2d4c..3e4fd15 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -31,6 +31,7 @@ with this program. If not, see . #include "application-service-marshal.h" #include "dbus-properties-client.h" #include "dbus-shared.h" +#include "notification-approver-client.h" /* DBus Prototypes */ static gboolean _application_service_server_get_applications (ApplicationServiceAppstore * appstore, GPtrArray ** apps, GError ** error); @@ -100,7 +101,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); +static void approver_free (gpointer papprover, gpointer user_data); G_DEFINE_TYPE (ApplicationServiceAppstore, application_service_appstore, G_TYPE_OBJECT); @@ -760,7 +761,7 @@ _application_service_server_get_applications (ApplicationServiceAppstore * appst } /* Frees the data associated with an approver */ -void +static void approver_free (gpointer papprover, gpointer user_data) { Approver * approver = (Approver *)papprover; @@ -775,6 +776,33 @@ approver_free (gpointer papprover, gpointer user_data) return; } +/* What did the approver tell us? */ +static void +approver_request_cb (DBusGProxy *proxy, gboolean OUT_approved, GError *error, gpointer userdata) +{ + g_debug("Approver responded: %s", OUT_approved ? "approve" : "rejected"); + return; +} + +/* Run the applications through the new approver */ +static void +check_with_new_approver (gpointer papp, gpointer papprove) +{ + Application * app = (Application *)papp; + Approver * approver = (Approver *)papprove; + + org_ayatana_StatusNotifierApprover_approve_item_async(approver->proxy, + app->id, + app->category, + 0, + app->dbus_name, + app->dbus_object, + approver_request_cb, + app); + + return; +} + /* Adds a new approver to the app store */ void application_service_appstore_approver_add (ApplicationServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object) @@ -801,6 +829,8 @@ application_service_appstore_approver_add (ApplicationServiceAppstore * appstore priv->approvers = g_list_prepend(priv->approvers, approver); + g_list_foreach(priv->applications, check_with_new_approver, approver); + return; } -- cgit v1.2.3 From 306a78b6a438f0702d7f8475e726de53a7a7b66c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 16:29:22 -0500 Subject: When we have new apps we can ask the approver about them. --- src/application-service-appstore.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 3e4fd15..311fcb1 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -102,6 +102,8 @@ 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); static void approver_free (gpointer papprover, gpointer user_data); +static void check_with_new_approver (gpointer papp, gpointer papprove); +static void check_with_old_approver (gpointer papprove, gpointer papp); G_DEFINE_TYPE (ApplicationServiceAppstore, application_service_appstore, G_TYPE_OBJECT); @@ -251,11 +253,23 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err app->icon_path = g_strdup(""); } + /* TODO: Calling approvers, but we're ignoring the results. So, eh. */ + g_list_foreach(priv->approvers, check_with_old_approver, app); + apply_status(app, string_to_status(g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_STATUS)))); return; } +/* Check the application against an approver */ +static void +check_with_old_approver (gpointer papprove, gpointer papp) +{ + /* Funny the parallels, eh? */ + check_with_new_approver(papp, papprove); + return; +} + /* Simple translation function -- could be optimized */ static AppIndicatorStatus string_to_status(const gchar * status_string) -- cgit v1.2.3