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

commit e54ea63099a28d261675aa026962c934cdf12c5c
Author: Priyank <[EMAIL PROTECTED]>
Date:   Thu Nov 22 21:57:56 2007 +0530

gfpm-ui: perform a first-run on init
* we do this because when a database update is done for the first time
it takes a reasonable amount of time and the client may fail to get any
update status from the daemon.

diff --git a/src/fun-ui.c b/src/fun-ui.c
index 8470c12..949a4a2 100644
--- a/src/fun-ui.c
+++ b/src/fun-ui.c
@@ -479,6 +479,7 @@ fun_ui_init (void)
{
GError          *error = NULL;
gulong          seconds = 0;
+       gchar           *plist = NULL;
static gchar *error_msg = ("Update checking has been disabled because FUN has 
detected "
"that the update notifier daemon is not running. FUN will attempt "
"to reconnect to the daemon every 45 seconds. \n\nYou can start the "
@@ -504,6 +505,12 @@ fun_ui_init (void)
}
seconds = fun_config_get_value_int ("update_interval") * 60;
connected = TRUE;
+       /* perform the first-run */
+       /* we do this because when a database update is done for the first time
+        * it takes a reasonable amount of time and the client may fail to get
+        * any update status from the daemon */
+       while (gtk_events_pending()) gtk_main_iteration ();
+       fun_dbus_perform_service (PERFORM_UPDATE, NULL, &plist, NULL);

/* register the timeout */
g_timeout_add_seconds (seconds, (GSourceFunc)fun_timeout_func, NULL);
diff --git a/src/fund.c b/src/fund.c
index e8391e4..4fe74b9 100644
--- a/src/fund.c
+++ b/src/fund.c
@@ -161,7 +161,8 @@ gboolean fund_update_database(FWUpdateNotifier *obj, gchar 
**packages, GError **
tmp = g_string_append (tmp, list->data);
tmp = g_string_append (tmp, " ");
}
-               *packages = g_strdup (tmp->str);
+               if (packages != NULL)
+                       *packages = g_strdup (tmp->str);
return TRUE;
}
}
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to