aboutsummaryrefslogtreecommitdiff
path: root/src/application-service-appstore.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-01-20 15:01:00 -0600
committerTed Gould <ted@gould.cx>2010-01-20 15:01:00 -0600
commitde659683ee9d60ed0fefa2d20c4ff1342f1b94e2 (patch)
tree7baf0e4813a473e2f533487f10fe944afea97ea5 /src/application-service-appstore.c
parent72432728b161a54dfd711242e17cd2e55a011c2c (diff)
parent38e8cebe7b5a6190bb504af82f483057327c1d25 (diff)
downloadayatana-indicator-application-de659683ee9d60ed0fefa2d20c4ff1342f1b94e2.tar.gz
ayatana-indicator-application-de659683ee9d60ed0fefa2d20c4ff1342f1b94e2.tar.bz2
ayatana-indicator-application-de659683ee9d60ed0fefa2d20c4ff1342f1b94e2.zip
Updating to trunk (surprisingly without conflict)
Diffstat (limited to 'src/application-service-appstore.c')
-rw-r--r--src/application-service-appstore.c49
1 files changed, 46 insertions, 3 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 4cb2ab6..5b0cc15 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -31,7 +31,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "dbus-shared.h"
/* DBus Prototypes */
-static gboolean _application_service_server_get_applications (ApplicationServiceAppstore * appstore, GArray ** apps);
+static gboolean _application_service_server_get_applications (ApplicationServiceAppstore * appstore, GPtrArray ** apps, GError ** error);
#include "application-service-server.h"
@@ -684,9 +684,52 @@ application_service_appstore_new (AppLruFile * lrufile)
/* DBus Interface */
static gboolean
-_application_service_server_get_applications (ApplicationServiceAppstore * appstore, GArray ** apps)
+_application_service_server_get_applications (ApplicationServiceAppstore * appstore, GPtrArray ** apps, GError ** error)
{
+ ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore);
+
+ *apps = g_ptr_array_new();
+ GList * listpntr;
+ gint position = 0;
+
+ for (listpntr = priv->applications; listpntr != NULL; listpntr = g_list_next(listpntr)) {
+ GValueArray * values = g_value_array_new(5);
+
+ GValue value = {0};
+
+ /* Icon name */
+ g_value_init(&value, G_TYPE_STRING);
+ g_value_set_string(&value, ((Application *)listpntr->data)->icon);
+ g_value_array_append(values, &value);
+ g_value_unset(&value);
+
+ /* Position */
+ g_value_init(&value, G_TYPE_INT);
+ g_value_set_int(&value, position++);
+ g_value_array_append(values, &value);
+ g_value_unset(&value);
+
+ /* DBus Address */
+ g_value_init(&value, G_TYPE_STRING);
+ g_value_set_string(&value, ((Application *)listpntr->data)->dbus_name);
+ g_value_array_append(values, &value);
+ g_value_unset(&value);
+
+ /* DBus Object */
+ g_value_init(&value, DBUS_TYPE_G_OBJECT_PATH);
+ g_value_set_static_boxed(&value, ((Application *)listpntr->data)->menu);
+ g_value_array_append(values, &value);
+ g_value_unset(&value);
+
+ /* Icon path */
+ g_value_init(&value, G_TYPE_STRING);
+ g_value_set_string(&value, ((Application *)listpntr->data)->icon_path);
+ g_value_array_append(values, &value);
+ g_value_unset(&value);
+
+ g_ptr_array_add(*apps, values);
+ }
- return FALSE;
+ return TRUE;
}