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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Feb 7 18:33:04 EET 2007
Author: marivoll
Date: 2007-02-07 18:33:03 +0200 (Wed, 07 Feb 2007)
New Revision: 9716

Modified:
   projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-model.c
Log:
	(handle_possibly_finished_node): Only announce a row change when
	the path is valid.  The path is invalid for the fake root.
	(hildon_file_system_model_get_value): When calculating the weight,
	don't look into info when it is NULL.
	(get_folder_callback): When the folder is finished loading, list
	and add its children immediately.  This is needed for the
	filesystemmemory backend which doesn't emit any change
	notification signals.


Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-model.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-model.c	2007-02-07 16:29:04 UTC (rev 9715)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-model.c	2007-02-07 16:33:03 UTC (rev 9716)
@@ -236,7 +236,8 @@
       {
 	GtkTreePath *path =
 	  hildon_file_system_model_get_path (GTK_TREE_MODEL (model), &iter);
-	gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, &iter);
+	if (gtk_tree_path_get_depth (path) > 0)
+	  gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, &iter);
 	gtk_tree_path_free (path);
       }
     }
@@ -1210,7 +1211,7 @@
         /* Temporary version of the weight calculation */
         g_value_set_int(value, model_node->location ? 
                 model_node->location->sort_weight : (
-            gtk_file_info_get_is_folder(info) ? 
+            (info && gtk_file_info_get_is_folder(info)) ? 
                 SORT_WEIGHT_FOLDER : SORT_WEIGHT_FILE));
         break;
     case HILDON_FILE_SYSTEM_MODEL_COLUMN_EXTRA_INFO:
@@ -1590,6 +1591,25 @@
   g_object_set_qdata (G_OBJECT(model_node->folder),
 		      hildon_file_system_model_quark, node);
   
+  if (gtk_file_folder_is_finished_loading (model_node->folder))
+    {
+      GSList *children = NULL;
+      gboolean result;
+
+      result = gtk_file_folder_list_children
+	(model_node->folder, &children, &(model_node->error));
+      if (result)
+	{
+	  hildon_file_system_model_files_added (model_node->folder,
+						children,
+						model);
+	  hildon_file_system_model_folder_finished_loading
+	    (model_node->folder, model);
+	  gtk_file_paths_free (children);
+	}
+	  
+    }
+
   g_signal_connect_object
     (model_node->folder, "files-added",
      G_CALLBACK(hildon_file_system_model_files_added),


More information about the maemo-commits mailing list