[maemo-commits] [maemo-commits] r13528 - in projects/haf/trunk/hildon-fm: . debian hildon-fm
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Fri Aug 31 15:56:26 EEST 2007
- Previous message: [maemo-commits] r13527 - projects/haf/hafbuildbot
- Next message: [maemo-commits] r13529 - projects/haf/tags/hildon-desktop/0.0.34-1/debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: marivoll Date: 2007-08-31 15:56:25 +0300 (Fri, 31 Aug 2007) New Revision: 13528 Modified: projects/haf/trunk/hildon-fm/ChangeLog projects/haf/trunk/hildon-fm/debian/changelog projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-model.c Log: Fark, had to put half of our own asynchronicity magic back. I fell stupid now for removing it in the first place... * hildon-fm/hildon-file-system-model.c (MAX_BATCH): New. (hildon_file_system_model_add_nodes): Removed. Include functionality directly in hildon_file_system_model_files_added. (delay_files_added): New. (hildon_file_system_model_files_added): Use it for more than MAX_BATCH children (N66863). Modified: projects/haf/trunk/hildon-fm/ChangeLog =================================================================== --- projects/haf/trunk/hildon-fm/ChangeLog 2007-08-31 12:53:43 UTC (rev 13527) +++ projects/haf/trunk/hildon-fm/ChangeLog 2007-08-31 12:56:25 UTC (rev 13528) @@ -1,3 +1,15 @@ +2007-08-31 Marius Vollmer <marius.vollmer at nokia.com> + + Fark, had to put half of our own asynchronicity magic back. I + fell stupid now for removing it in the first place... + + * hildon-fm/hildon-file-system-model.c (MAX_BATCH): New. + (hildon_file_system_model_add_nodes): Removed. Include + functionality directly in hildon_file_system_model_files_added. + (delay_files_added): New. + (hildon_file_system_model_files_added): Use it for more than + MAX_BATCH children (N66863). + 2007-08-30 Marius Vollmer <marius.vollmer at nokia.com> * hildon-fm/hildon-file-system-storage-dialog.c Modified: projects/haf/trunk/hildon-fm/debian/changelog =================================================================== --- projects/haf/trunk/hildon-fm/debian/changelog 2007-08-31 12:53:43 UTC (rev 13527) +++ projects/haf/trunk/hildon-fm/debian/changelog 2007-08-31 12:56:25 UTC (rev 13528) @@ -4,7 +4,7 @@ * Do not show USB mass storage device when no volumes are mounted. Fixes: NB#62319. * Correct sort order of top-level items. Fixes: NB#65611. - * Fixes: NB#65543, NB#67080. + * Fixes: NB#65543, NB#67080, NB#66863. -- Marius Vollmer <marius.vollmer at nokia.com> Tue, 14 Aug 2007 19:48:47 +0300 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-08-31 12:53:43 UTC (rev 13527) +++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-model.c 2007-08-31 12:56:25 UTC (rev 13528) @@ -63,6 +63,8 @@ #define DEFAULT_MAX_CACHE 50 #define MIN_CACHE 20 +#define MAX_BATCH 20 + static const char *EXPANDED_EMBLEM_NAME = "qgn_list_gene_fldr_exp"; static const char *COLLAPSED_EMBLEM_NAME = "qgn_list_gene_fldr_clp"; @@ -163,11 +165,6 @@ GObjectConstructParam * construct_properties); -static void -hildon_file_system_model_add_nodes (GtkTreeModel * model, - GNode * parent_node, - GtkFileFolder * parent_folder, - GSList *children); static GNode * hildon_file_system_model_add_node(GtkTreeModel * model, GNode * parent_node, @@ -1141,6 +1138,49 @@ hildon_file_system_model_quark); } +static void hildon_file_system_model_files_added (GtkFileFolder * monitor, + GSList * paths, + gpointer data); + +typedef struct { + GtkFileFolder *monitor; + GSList *paths; + gpointer data; +} dfa_clos; + +static gboolean +dfa_run (gpointer data) +{ + dfa_clos *c = (dfa_clos *)data; + + hildon_file_system_model_files_added (c->monitor, c->paths, c->data); + + g_object_unref (c->monitor); + gtk_file_paths_free (c->paths); + g_object_unref (c->data); + g_free (c); + + return FALSE; +} + +static void +delay_files_added (GtkFileFolder * monitor, + GSList * paths, + gpointer data) +{ + dfa_clos *c = g_new0 (dfa_clos, 1); + + g_object_ref (monitor); + paths = gtk_file_paths_copy (paths); + g_object_ref (data); + + c->monitor = monitor; + c->paths = paths; + c->data = data; + + g_idle_add (dfa_run, c); +} + static void hildon_file_system_model_files_added(GtkFileFolder * monitor, GSList * paths, gpointer data) @@ -1165,13 +1205,28 @@ node = hildon_file_system_model_search_folder(monitor); if (node != NULL) { + gint i; + GtkTreeModel *model; + model_node = node->data; model_node->load_time = time(NULL); - hildon_file_system_model_add_nodes (GTK_TREE_MODEL (model_node->model), - node, - monitor, - paths); + model = GTK_TREE_MODEL (model_node->model); + + i = 0; + while (paths && i < MAX_BATCH) + { + hildon_file_system_model_add_node (model, + node, + monitor, + (GtkFilePath *) paths->data); + paths = paths->next; + i++; + } + emit_node_changed (node); + + if (paths) + delay_files_added (monitor, paths, data); } else ULOG_ERR_F("Data destination not found!"); @@ -1464,8 +1519,12 @@ children, model); - if (model_node->location && - HILDON_IS_FILE_SYSTEM_ROOT (model_node->location)) + /* XXX - We assume that the root node has less than + MAX_BATCH entries and that has thus been added + completely now. + */ + if (model_node->location + && HILDON_IS_FILE_SYSTEM_ROOT (model_node->location)) model->priv->first_root_scan_completed = TRUE; hildon_file_system_model_folder_finished_loading @@ -1647,27 +1706,11 @@ notify_volumes_changed, fs); } - -static void -hildon_file_system_model_add_nodes (GtkTreeModel * model, - GNode * parent_node, - GtkFileFolder * parent_folder, - GSList *children) -{ - while (children) - { - hildon_file_system_model_add_node (model, - parent_node, parent_folder, - (GtkFilePath *) children->data); - children = children->next; - } -} - static GNode * -hildon_file_system_model_add_node(GtkTreeModel * model, - GNode * parent_node, - GtkFileFolder * parent_folder, - const GtkFilePath *path) +hildon_file_system_model_add_node (GtkTreeModel * model, + GNode * parent_node, + GtkFileFolder * parent_folder, + const GtkFilePath *path) { GNode *node; HildonFileSystemModelPrivate *priv;
- Previous message: [maemo-commits] r13527 - projects/haf/hafbuildbot
- Next message: [maemo-commits] r13529 - projects/haf/tags/hildon-desktop/0.0.34-1/debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]