aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/application-service-appstore.c21
-rw-r--r--src/dbus-shared.h2
2 files changed, 23 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>.
#define NOTIFICATION_ITEM_DBUS_IFACE "org.kde.StatusNotifierItem"
#define NOTIFICATION_ITEM_DEFAULT_OBJ "/StatusNotifierItem"
+#define NOTIFICATION_APPROVER_DBUS_IFACE "org.ayatana.StatusNotifierApprover"
+