diff options
author | Lars Uebernickel <lars@uebernic.de> | 2015-02-19 11:14:59 +0100 |
---|---|---|
committer | Lars Uebernickel <lars@uebernic.de> | 2015-02-19 11:31:10 +0100 |
commit | 9a2dc043ae688c38f09c8dd23ddb32472e190fdf (patch) | |
tree | 2f2baacb7a10d1cefd32aa33568e955a5601a4e9 | |
parent | 0d46b516019933c8c2192d190b392cf43ff217b2 (diff) | |
download | gnome-logs-9a2dc043ae688c38f09c8dd23ddb32472e190fdf.tar.gz |
journalmodel: only load one entry per idle
Creating and layouting row widgets is too slow to do it five at a time.
https://bugzilla.gnome.org/show_bug.cgi?id=728317
-rw-r--r-- | src/gl-journal-model.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/gl-journal-model.c b/src/gl-journal-model.c index bebaa07..ef078a5 100644 --- a/src/gl-journal-model.c +++ b/src/gl-journal-model.c @@ -31,29 +31,24 @@ static gboolean gl_journal_model_fetch_entries (gpointer user_data) { GlJournalModel *model = user_data; + GlJournalEntry *entry; guint last; - gint i; last = model->entries->len; - for (i = 0; i < 5; i++) + + entry = gl_journal_previous (model->journal); + if (entry) { - GlJournalEntry *entry; - - entry = gl_journal_previous (model->journal); - if (entry) - { - g_ptr_array_add (model->entries, entry); - } - else - { - model->idle_source = 0; - g_object_notify_by_pspec (G_OBJECT (model), properties[PROP_LOADING]); - return G_SOURCE_REMOVE; - } + g_ptr_array_add (model->entries, entry); + g_list_model_items_changed (G_LIST_MODEL (model), last, 0, 1); + return G_SOURCE_CONTINUE; + } + else + { + model->idle_source = 0; + g_object_notify_by_pspec (G_OBJECT (model), properties[PROP_LOADING]); + return G_SOURCE_REMOVE; } - - g_list_model_items_changed (G_LIST_MODEL (model), last, 0, i); - return G_SOURCE_CONTINUE; } static void |