diff options
author | Ted Gould <ted@canonical.com> | 2009-11-23 14:55:06 -0600 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-11-23 14:55:06 -0600 |
commit | 59b0398609ef5ce6ee991c633eb84c3b55a42ac3 (patch) | |
tree | b81beec36b41653eb49717110b3655515a5637c3 /src/custom-service-appstore.c | |
parent | 97388871ba0a4669792bead5878ec1eec24a2118 (diff) | |
parent | 2c04418795e644efafc0204656dd575844ba0976 (diff) | |
download | libayatana-appindicator-59b0398609ef5ce6ee991c633eb84c3b55a42ac3.tar.gz libayatana-appindicator-59b0398609ef5ce6ee991c633eb84c3b55a42ac3.tar.bz2 libayatana-appindicator-59b0398609ef5ce6ee991c633eb84c3b55a42ac3.zip |
Adding more fun. Now we're cookin'!
Diffstat (limited to 'src/custom-service-appstore.c')
-rw-r--r-- | src/custom-service-appstore.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/custom-service-appstore.c b/src/custom-service-appstore.c index a69bde6..6cb2dd9 100644 --- a/src/custom-service-appstore.c +++ b/src/custom-service-appstore.c @@ -152,6 +152,10 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err CustomServiceAppstorePrivate * priv = CUSTOM_SERVICE_APPSTORE_GET_PRIVATE(app->appstore); priv->applications = g_list_prepend(priv->applications, app); + + /* TODO: We need to have the position determined better. This + would involve looking at the name and category and sorting + it with the other entries. */ g_signal_emit(G_OBJECT(app->appstore), signals[APPLICATION_ADDED], 0, @@ -164,20 +168,27 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err return; } +/* Adding a new NotificationItem object from DBus in to the + appstore. First, we need to get the information on it + though. */ void custom_service_appstore_application_add (CustomServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object) { + /* Make sure we got a sensible request */ g_return_if_fail(IS_CUSTOM_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'); CustomServiceAppstorePrivate * priv = CUSTOM_SERVICE_APPSTORE_GET_PRIVATE(appstore); + /* Build the application entry. This will be carried + along until we're sure we've got everything. */ Application * app = g_new(Application, 1); app->dbus_name = g_strdup(dbus_name); app->dbus_object = g_strdup(dbus_object); app->appstore = appstore; + /* Get the DBus proxy for the NotificationItem interface */ GError * error = NULL; app->dbus_proxy = dbus_g_proxy_new_for_name_owner(priv->bus, app->dbus_name, @@ -192,6 +203,7 @@ custom_service_appstore_application_add (CustomServiceAppstore * appstore, const return; } + /* Grab the property proxy interface */ app->prop_proxy = dbus_g_proxy_new_for_name_owner(priv->bus, app->dbus_name, app->dbus_object, @@ -206,11 +218,14 @@ custom_service_appstore_application_add (CustomServiceAppstore * appstore, const return; } + /* Get all the propertiees */ org_freedesktop_DBus_Properties_get_all_async(app->prop_proxy, NOTIFICATION_ITEM_DBUS_IFACE, get_all_properties_cb, app); + /* We're returning, nothing is yet added until the properties + come back and give us more info. */ return; } |