[frogr] When using command line parameters, load pictures on idle



commit cbfb2b10d2a2ccedf149b7a5daac5ab8ab6a9eff
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Fri Jan 21 17:39:26 2011 +0100

    When using command line parameters, load pictures on idle

 src/main.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index ae416c8..1ef4203 100644
--- a/src/main.c
+++ b/src/main.c
@@ -61,6 +61,22 @@ _get_paths_list_from_array (char **paths_str, int n_paths)
   return filepaths;
 }
 
+static gboolean
+_load_pictures_on_idle (gpointer data)
+{
+  g_return_val_if_fail (data, FALSE);
+
+  FrogrController *fcontroller = NULL;
+  GSList *filepaths = NULL;
+
+  fcontroller = frogr_controller_get_instance ();
+  filepaths = (GSList *)data;
+
+  frogr_controller_load_pictures (fcontroller, filepaths);
+
+  return FALSE;
+}
+
 int
 main (int argc, char **argv)
 {
@@ -85,7 +101,7 @@ main (int argc, char **argv)
   /* Run app (and load pictures if present) */
   fcontroller = frogr_controller_get_instance ();
   if (filepaths)
-    frogr_controller_load_pictures (fcontroller, filepaths);
+    gdk_threads_add_idle (_load_pictures_on_idle, filepaths);
 
   frogr_controller_run_app (fcontroller);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]