[maemo-commits] [maemo-commits] r13007 - projects/haf/trunk/hildon-fm/hildon-fm

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Aug 2 20:02:12 EEST 2007
Author: marivoll
Date: 2007-08-02 20:02:08 +0300 (Thu, 02 Aug 2007)
New Revision: 13007

Modified:
   projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-smb.c
Log:
	* hildon-fm/hildon-file-system-smb.c (struct _MyFileFolder): Added
	n_children_waiting.
	(my_file_folder_child_files_added,
	my_file_folder_root_files_added): Maintain it.
	(my_file_folder_is_finished_loading): Return FALSE as long as
	there are still child folders outstanding.


Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-smb.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-smb.c	2007-08-02 16:12:23 UTC (rev 13006)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-smb.c	2007-08-02 17:02:08 UTC (rev 13007)
@@ -223,6 +223,9 @@
   GtkFileInfoType types;
   GtkFileFolder *root;
   GList *children;
+  int n_children_waiting;    /* The number of child folders we have
+                                asked for but not yet received.
+			     */
 };
 
 static GType my_file_folder_get_type (void);
@@ -335,6 +338,9 @@
   if (!gtk_file_folder_is_finished_loading (GTK_FILE_FOLDER (my_folder->root)))
     return FALSE;
 
+  if (my_folder->n_children_waiting > 0)
+    return FALSE;
+
   for (c = my_folder->children; c; c = c->next)
     {
       if (!gtk_file_folder_is_finished_loading (GTK_FILE_FOLDER (c->data)))
@@ -373,9 +379,6 @@
   char *last_slash = strchr_reverse (new_str, NULL, '/');
   char *second_last_slash = strchr_reverse (new_str, last_slash, '/');
 
-  fprintf (stderr, "/ %s\n", last_slash);
-  fprintf (stderr, "// %s\n", second_last_slash);
-
   if (second_last_slash)
     strcpy (second_last_slash + 1, last_slash + 1);
 
@@ -389,8 +392,6 @@
 {
   MyFileFolder *my_folder = MY_FILE_FOLDER (data);
 
-  fprintf (stderr, "CHILD_FILES_ADDED\n");
-
   GSList *my_paths;
   my_paths = NULL;
   while (paths)
@@ -426,6 +427,7 @@
     {
       my_folder->children = g_list_append (my_folder->children,
                                            folder);
+      my_folder->n_children_waiting--;
       g_signal_connect (folder, "files-added",
                         G_CALLBACK (my_file_folder_child_files_added),
                         my_folder);
@@ -440,11 +442,10 @@
 {
   MyFileFolder *my_folder = MY_FILE_FOLDER (data);
 
-  fprintf (stderr, "ROOT_FILES_ADDED\n");
-
   while (paths)
     {
       GtkFilePath *p = paths->data;
+      my_folder->n_children_waiting++;
       gtk_file_system_get_folder (my_folder->filesystem,
                                   p,
                                   my_folder->types,


More information about the maemo-commits mailing list