Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fun.git;a=commitdiff;h=17a35b6ff02cfbc7c9c817ad987e2c3b9bacf416

commit 17a35b6ff02cfbc7c9c817ad987e2c3b9bacf416
Author: Priyank <[EMAIL PROTECTED]>
Date:   Sat Nov 3 11:17:11 2007 +0530

fun-dbus: fun_dbus_perform_service()
Added another argument which is used to pass the list of updates to the caller.

diff --git a/src/fun-dbus.c b/src/fun-dbus.c
index ff1a019..db83a96 100644
--- a/src/fun-dbus.c
+++ b/src/fun-dbus.c
@@ -40,7 +40,7 @@ fun_dbus_init (void)
}

gboolean
-fun_dbus_perform_service (guint service)
+fun_dbus_perform_service (guint service, gchar **package_list)
{
DBusMessage     *message = NULL;
DBusMessage     *reply = NULL;
@@ -49,7 +49,6 @@ fun_dbus_perform_service (guint service)

switch (service)
{
-               gchar **package_list = NULL;
case PERFORM_UPDATE:
{
dbus_error_init (&error);
@@ -65,13 +64,19 @@ fun_dbus_perform_service (guint service)
return FALSE;
}
if (!dbus_message_get_args (reply, &error,
-                                               DBUS_TYPE_STRING, &package_list,
+                                               DBUS_TYPE_STRING, package_list,
DBUS_TYPE_INVALID))
{
fprintf (stderr, "ERROR: %s\n", error.message);
dbus_error_free (&error);
return FALSE;
}
+                       /* if there are any updates, display a notification */
+                       if (package_list != NULL)
+                       {
+
+                       }
+
dbus_message_unref (reply);
dbus_message_unref (message);
break;
diff --git a/src/fun-dbus.h b/src/fun-dbus.h
index 9317d13..724be78 100644
--- a/src/fun-dbus.h
+++ b/src/fun-dbus.h
@@ -11,6 +11,6 @@

gboolean fun_dbus_init (void);

-gboolean fun_dbus_perform_service (guint);
+gboolean fun_dbus_perform_service (guint, gchar **);

#endif
diff --git a/src/fun-ui.c b/src/fun-ui.c
index 680066a..6e88cd9 100644
--- a/src/fun-ui.c
+++ b/src/fun-ui.c
@@ -233,7 +233,7 @@ fun_ui_init (void)
guint           seconds = 40;

fun_systray_create ();
-       if (fun_dbus_perform_service (TEST_SERVICE) == FALSE)
+       if (fun_dbus_perform_service (TEST_SERVICE, NULL) == FALSE)
{
g_print ("Failed to connect to the fun daemon\n");
connected = FALSE;
@@ -255,7 +255,7 @@ fun_timeout_conn (void)
{
if (connected == TRUE)
return FALSE;
-       if (fun_dbus_perform_service (TEST_SERVICE) == FALSE)
+       if (fun_dbus_perform_service (TEST_SERVICE, NULL) == FALSE)
{
connected = FALSE;
}
@@ -272,12 +272,16 @@ fun_timeout_conn (void)
static gboolean
fun_timeout_func (void)
{
+       gchar *plist = NULL;
/* Don't do anything if we're not connected to the daemon */
if (!connected)
return TRUE;

-       if (fun_dbus_perform_service (PERFORM_UPDATE)==TRUE)
+       if (fun_dbus_perform_service (PERFORM_UPDATE, &plist)==TRUE)
+       {
+               g_print ("\nlist is\n %s", plist);
g_print ("Yeaahaaw! success\n");
+       }
else
g_print ("Damn !\n");
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to