[maemo-commits] [maemo-commits] r16964 - projects/haf/branches/hildon-fm/fremantle/hildon-fm

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Dec 15 18:12:49 EET 2008
Author: yangli
Date: 2008-12-15 18:12:48 +0200 (Mon, 15 Dec 2008)
New Revision: 16964

Modified:
   projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.c
Log:
skip creating the sort model for root

Modified: projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.c
===================================================================
--- projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.c	2008-12-15 15:31:09 UTC (rev 16963)
+++ projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.c	2008-12-15 16:12:48 UTC (rev 16964)
@@ -3441,6 +3441,7 @@
     GtkTreePath *treepath;
     gboolean res;
     GtkTreeIter temp_iter;
+    char *uri;
 
     g_assert(HILDON_IS_FILE_SELECTION(self));
     ULOG_DEBUG(__FUNCTION__);
@@ -3458,6 +3459,14 @@
       main_iter = &temp_iter;
     }
 
+    gtk_tree_model_get(self->priv->main_model, main_iter,
+                       HILDON_FILE_SYSTEM_MODEL_COLUMN_URI, &uri,
+                       -1);
+    if(g_ascii_strcasecmp (uri, "file:///") == 0) {
+      free(uri);
+      return;
+    }
+    free(uri);
     gtk_tree_model_sort_convert_child_iter_to_iter(GTK_TREE_MODEL_SORT
                                                    (self->priv->
                                                     dir_sort),
@@ -3467,12 +3476,12 @@
                                                       dir_filter),
                                                      &filter_iter,
                                                      &sort_iter);
-
     view = GTK_TREE_VIEW(self->priv->dir_tree);
     treepath =
         gtk_tree_model_get_path(self->priv->dir_filter, &filter_iter);
 
     gtk_tree_view_expand_to_path(view, treepath);
+
     gtk_tree_view_set_cursor(view, treepath, NULL, FALSE);
 
     gtk_tree_path_free(treepath);


More information about the maemo-commits mailing list