[gnome-color-manager] trivial: Only parse the profiles list once at gcm-viewer startup
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] trivial: Only parse the profiles list once at gcm-viewer startup
- Date: Wed, 20 Oct 2010 09:26:48 +0000 (UTC)
commit 25a959a6b9ae42cb62844cfe1209b7056c585981
Author: Richard Hughes <richard hughsie com>
Date: Wed Oct 20 10:22:38 2010 +0100
trivial: Only parse the profiles list once at gcm-viewer startup
src/gcm-viewer.c | 68 ++++++++++++++++++++++++++---------------------------
1 files changed, 33 insertions(+), 35 deletions(-)
---
diff --git a/src/gcm-viewer.c b/src/gcm-viewer.c
index 8f5df54..65d5fe1 100644
--- a/src/gcm-viewer.c
+++ b/src/gcm-viewer.c
@@ -77,8 +77,6 @@ enum {
GCM_VIEWER_COMBO_COLUMN_LAST
};
-static void gcm_viewer_profile_store_changed_cb (GcmProfileStore *profile_store, GcmViewerPrivate *viewer);
-
#define GCM_VIEWER_TREEVIEW_WIDTH 350 /* px */
#define GCM_VIEWER_MAX_EXAMPLE_IMAGES 4
@@ -887,6 +885,33 @@ gcm_viewer_set_combo_simple_text (GtkWidget *combo_box)
}
/**
+ * gcm_viewer_profile_store_added_cb:
+ **/
+static void
+gcm_viewer_profile_store_added_cb (GcmProfileStore *profile_store, GcmProfile *profile, GcmViewerPrivate *viewer)
+{
+ gcm_viewer_update_profile_list (viewer);
+}
+
+/**
+ * gcm_viewer_profile_store_removed_cb:
+ **/
+static void
+gcm_viewer_profile_store_removed_cb (GcmProfileStore *profile_store, GcmProfile *profile, GcmViewerPrivate *viewer)
+{
+ gcm_viewer_update_profile_list (viewer);
+}
+
+/**
+ * gcm_viewer_profile_store_changed_cb:
+ **/
+static void
+gcm_viewer_profile_store_changed_cb (GcmProfileStore *profile_store, GcmViewerPrivate *viewer)
+{
+ gcm_viewer_update_profile_list (viewer);
+}
+
+/**
* gcm_viewer_startup_phase1_idle_cb:
**/
static gboolean
@@ -905,7 +930,12 @@ gcm_viewer_startup_phase1_idle_cb (GcmViewerPrivate *viewer)
/* search the disk for profiles */
gcm_profile_store_search (viewer->profile_store, search_flags);
- g_signal_connect (viewer->profile_store, "changed", G_CALLBACK(gcm_viewer_profile_store_changed_cb), viewer);
+ g_signal_connect (viewer->profile_store, "changed",
+ G_CALLBACK(gcm_viewer_profile_store_changed_cb), viewer);
+ g_signal_connect (viewer->profile_store, "added",
+ G_CALLBACK (gcm_viewer_profile_store_added_cb), viewer);
+ g_signal_connect (viewer->profile_store, "removed",
+ G_CALLBACK (gcm_viewer_profile_store_removed_cb), viewer);
/* update list of profiles */
gcm_viewer_update_profile_list (viewer);
@@ -938,16 +968,6 @@ gcm_viewer_setup_drag_and_drop (GtkWidget *widget)
}
/**
- * gcm_viewer_profile_store_changed_cb:
- **/
-static void
-gcm_viewer_profile_store_changed_cb (GcmProfileStore *profile_store, GcmViewerPrivate *viewer)
-{
- /* clear and update the profile list */
- gcm_viewer_update_profile_list (viewer);
-}
-
-/**
* gcm_viewer_graph_combo_changed_cb:
**/
static void
@@ -1026,24 +1046,6 @@ gcm_viewer_setup_graph_combobox (GcmViewerPrivate *viewer, GtkWidget *widget)
}
/**
- * gcm_viewer_profile_store_added_cb:
- **/
-static void
-gcm_viewer_profile_store_added_cb (GcmProfileStore *profile_store, GcmProfile *profile, GcmViewerPrivate *viewer)
-{
- gcm_viewer_update_profile_list (viewer);
-}
-
-/**
- * gcm_viewer_profile_store_removed_cb:
- **/
-static void
-gcm_viewer_profile_store_removed_cb (GcmProfileStore *profile_store, GcmProfile *profile, GcmViewerPrivate *viewer)
-{
- gcm_viewer_update_profile_list (viewer);
-}
-
-/**
* main:
**/
int
@@ -1104,10 +1106,6 @@ main (int argc, char **argv)
/* maintain a list of profiles */
viewer->profile_store = gcm_profile_store_new ();
- g_signal_connect (viewer->profile_store, "added",
- G_CALLBACK (gcm_viewer_profile_store_added_cb), viewer);
- g_signal_connect (viewer->profile_store, "removed",
- G_CALLBACK (gcm_viewer_profile_store_removed_cb), viewer);
/* create list stores */
viewer->list_store_profiles = gtk_list_store_new (GCM_PROFILES_COLUMN_LAST, G_TYPE_STRING,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]