[gnome-color-manager] Split out the profiles GtkListStore to make tracking the profiles automatic in the GUI code



commit 9bd865ec287e430cab749ca5a515fc34e5727fb6
Author: Richard Hughes <richard hughsie com>
Date:   Thu Oct 28 14:28:43 2010 +0100

    Split out the profiles GtkListStore to make tracking the profiles automatic in the GUI code

 po/POTFILES.in                |    2 +
 src/Makefile.am               |    2 +
 src/cc-color-panel.c          |  409 +++++++++++++----------------------------
 src/gcm-apply.c               |    5 +-
 src/gcm-device.c              |  107 +++++++++++-
 src/gcm-device.h              |   11 +-
 src/gcm-list-store-profiles.c |  170 +++++++++++++++++
 src/gcm-list-store-profiles.h |   67 +++++++
 src/gcm-self-test.c           |    6 +-
 9 files changed, 490 insertions(+), 289 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 10e817d..8a38a10 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -4,6 +4,7 @@ data/gcm-prefs.desktop.in
 data/gcm-viewer.desktop.in
 data/gcm-viewer.ui
 data/org.gnome.color-manager.gschema.xml
+data/org.gnome.settings-daemon.plugins.color.gschema.xml
 libcolor-glib/gcm-debug.c
 libcolor-glib/gcm-profile.c
 libcolor-glib/gcm-sensor-client.c
@@ -19,6 +20,7 @@ src/gcm-cell-renderer-profile-icon.c
 src/gcm-cell-renderer-profile-text.c
 src/gcm-client.c
 src/gcm-device-xrandr.c
+src/gcm-list-store-profiles.c
 src/gcm-import.c
 src/gcm-inspect.c
 src/gcm-install-system-wide.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 8cde79f..e4d5586 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -235,6 +235,8 @@ gcm_session_CFLAGS =					\
 libcolor_la_SOURCES =					\
 	cc-color-panel.c				\
 	cc-color-panel.h				\
+	gcm-list-store-profiles.c			\
+	gcm-list-store-profiles.h			\
 	gcm-cell-renderer-profile-text.c		\
 	gcm-cell-renderer-profile-text.h		\
 	gcm-cell-renderer-profile-icon.c		\
diff --git a/src/cc-color-panel.c b/src/cc-color-panel.c
index e20ea61..05827ba 100644
--- a/src/cc-color-panel.c
+++ b/src/cc-color-panel.c
@@ -43,13 +43,14 @@
 #include "gcm-trc-widget.h"
 #include "gcm-utils.h"
 #include "gcm-color.h"
+#include "gcm-list-store-profiles.h"
 
 #include "cc-color-panel.h"
 
 struct _CcColorPanelPrivate {
 	GtkBuilder		*builder;
 	GtkListStore		*list_store_devices;
-	GtkListStore		*list_store_assign;
+	GtkListStore		*list_store_profiles;
 	GcmDevice		*current_device;
 	GcmProfileStore		*profile_store;
 	GcmClient		*gcm_client;
@@ -82,14 +83,6 @@ enum {
 };
 
 enum {
-	GCM_ASSIGN_COLUMN_SORT,
-	GCM_ASSIGN_COLUMN_PROFILE,
-	GCM_ASSIGN_COLUMN_IS_DEFAULT,
-	GCM_ASSIGN_COLUMN_TOOLTIP,
-	GCM_ASSIGN_COLUMN_LAST
-};
-
-enum {
 	GCM_PREFS_COMBO_COLUMN_TEXT,
 	GCM_PREFS_COMBO_COLUMN_PROFILE,
 	GCM_PREFS_COMBO_COLUMN_TYPE,
@@ -945,79 +938,10 @@ cc_color_panel_add_profiles_suitable_for_devices (CcColorPanel *panel, GtkWidget
 }
 
 /**
- * cc_color_panel_assign_save_profiles_for_device:
- **/
-static void
-cc_color_panel_assign_save_profiles_for_device (CcColorPanel *panel, GcmDevice *device)
-{
-	GtkTreeIter iter;
-	GtkTreeModel *model;
-	gboolean is_default;
-	GcmProfile *profile;
-	GPtrArray *array;
-	gboolean ret;
-	GError *error = NULL;
-
-	/* create empty array */
-	array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
-
-	/* get first element */
-	model = GTK_TREE_MODEL (panel->priv->list_store_assign);
-	ret = gtk_tree_model_get_iter_first (model, &iter);
-	if (!ret)
-		goto set_profiles;
-
-	/* add default device first */
-	do {
-		gtk_tree_model_get (model, &iter,
-				    GCM_ASSIGN_COLUMN_PROFILE, &profile,
-				    GCM_ASSIGN_COLUMN_IS_DEFAULT, &is_default,
-				    -1);
-		if (is_default)
-			g_ptr_array_add (array, g_object_ref (profile));
-		g_object_unref (profile);
-	} while (gtk_tree_model_iter_next (model, &iter));
-
-	/* add non-default devices next */
-	gtk_tree_model_get_iter_first (model, &iter);
-	do {
-		gtk_tree_model_get (model, &iter,
-				    GCM_ASSIGN_COLUMN_PROFILE, &profile,
-				    GCM_ASSIGN_COLUMN_IS_DEFAULT, &is_default,
-				    -1);
-		if (!is_default)
-			g_ptr_array_add (array, g_object_ref (profile));
-		g_object_unref (profile);
-	} while (gtk_tree_model_iter_next (model, &iter));
-
-set_profiles:
-	/* save new array */
-	gcm_device_set_profiles (device, array);
-
-	/* save */
-	ret = gcm_device_save (panel->priv->current_device, &error);
-	if (!ret) {
-		g_warning ("failed to save config: %s", error->message);
-		g_error_free (error);
-		goto out;
-	}
-
-	/* set the profile */
-	ret = gcm_device_apply (panel->priv->current_device, &error);
-	if (!ret) {
-		g_warning ("failed to apply profile: %s", error->message);
-		g_error_free (error);
-		goto out;
-	}
-out:
-	g_ptr_array_unref (array);
-}
-
-/**
- * cc_color_panel_assign_add_cb:
+ * cc_color_panel_profile_add_cb:
  **/
 static void
-cc_color_panel_assign_add_cb (GtkWidget *widget, CcColorPanel *panel)
+cc_color_panel_profile_add_cb (GtkWidget *widget, CcColorPanel *panel)
 {
 	const gchar *profile_filename;
 
@@ -1033,18 +957,18 @@ cc_color_panel_assign_add_cb (GtkWidget *widget, CcColorPanel *panel)
 }
 
 /**
- * cc_color_panel_assign_remove_cb:
+ * cc_color_panel_profile_remove_cb:
  **/
 static void
-cc_color_panel_assign_remove_cb (GtkWidget *widget, CcColorPanel *panel)
+cc_color_panel_profile_remove_cb (GtkWidget *widget, CcColorPanel *panel)
 {
 	GtkTreeIter iter;
 	GtkTreeSelection *selection;
 	GtkTreeModel *model;
-	gboolean is_default;
 	gboolean ret;
 	const gchar *device_md5;
 	GcmProfile *profile = NULL;
+	GError *error = NULL;
 
 	/* get the selected row */
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "treeview_assign"));
@@ -1056,8 +980,7 @@ cc_color_panel_assign_remove_cb (GtkWidget *widget, CcColorPanel *panel)
 
 	/* if the profile is default, then we'll have to make the first profile default */
 	gtk_tree_model_get (model, &iter,
-			    GCM_ASSIGN_COLUMN_IS_DEFAULT, &is_default,
-			    GCM_ASSIGN_COLUMN_PROFILE, &profile,
+			    GCM_LIST_STORE_PROFILES_COLUMN_PROFILE, &profile,
 			    -1);
 
 	/* if this is an auto-added profile that the user has *manually*
@@ -1071,27 +994,29 @@ cc_color_panel_assign_remove_cb (GtkWidget *widget, CcColorPanel *panel)
 		}
 	}
 
-	/* remove this entry */
-	gtk_list_store_remove (GTK_LIST_STORE(model), &iter);
+	/* just remove it, the list store will get ::changed */
+	ret = gcm_device_profile_remove (panel->priv->current_device, profile, &error);
+	if (!ret) {
+		g_warning ("failed to remove profile: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
 
-	/* /something/ has to be the default profile */
-	if (is_default) {
-		ret = gtk_tree_model_get_iter_first (model, &iter);
-		if (ret) {
-			gtk_list_store_set (panel->priv->list_store_assign, &iter,
-					    GCM_ASSIGN_COLUMN_IS_DEFAULT, TRUE,
-					    GCM_ASSIGN_COLUMN_SORT, "0",
-					    -1);
-			do {
-				gtk_list_store_set (panel->priv->list_store_assign, &iter,
-						    GCM_ASSIGN_COLUMN_SORT, "1",
-						    -1);
-			} while (gtk_tree_model_iter_next (model, &iter));
-		}
+	/* save */
+	ret = gcm_device_save (panel->priv->current_device, &error);
+	if (!ret) {
+		g_warning ("failed to save config: %s", error->message);
+		g_error_free (error);
+		goto out;
 	}
 
-	/* save device */
-	cc_color_panel_assign_save_profiles_for_device (panel, panel->priv->current_device);
+	/* apply */
+	ret = gcm_device_apply (panel->priv->current_device, &error);
+	if (!ret) {
+		g_warning ("failed to apply config: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
 out:
 	if (profile != NULL)
 		g_object_unref (profile);
@@ -1099,42 +1024,57 @@ out:
 }
 
 /**
- * cc_color_panel_assign_make_default_internal:
+ * cc_color_panel_profile_make_default_internal:
  **/
 static void
-cc_color_panel_assign_make_default_internal (CcColorPanel *panel, GtkTreeModel *model, GtkTreeIter *iter_selected)
+cc_color_panel_profile_make_default_internal (CcColorPanel *panel, GtkTreeModel *model, GtkTreeIter *iter_selected)
 {
-	GtkTreeIter iter;
+	GcmProfile *profile;
+	GError *error = NULL;
+	gboolean ret;
 	GtkWidget *widget;
 
-	/* make none of the devices default */
-	gtk_tree_model_get_iter_first (model, &iter);
-	do {
-		gtk_list_store_set (panel->priv->list_store_assign, &iter,
-				    GCM_ASSIGN_COLUMN_SORT, "1",
-				    GCM_ASSIGN_COLUMN_IS_DEFAULT, FALSE,
-				    -1);
-	} while (gtk_tree_model_iter_next (model, &iter));
-
-	/* make the selected device default */
-	gtk_list_store_set (panel->priv->list_store_assign, iter_selected,
-			    GCM_ASSIGN_COLUMN_IS_DEFAULT, TRUE,
-			    GCM_ASSIGN_COLUMN_SORT, "0",
+	/* get currentlt selected item */
+	gtk_tree_model_get (model, iter_selected,
+			    GCM_LIST_STORE_PROFILES_COLUMN_PROFILE, &profile,
 			    -1);
 
+	/* just set it default, the list store will get ::changed */
+	ret = gcm_device_profile_set_default (panel->priv->current_device, profile, &error);
+	if (!ret) {
+		g_warning ("failed to set default profile: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* save */
+	ret = gcm_device_save (panel->priv->current_device, &error);
+	if (!ret) {
+		g_warning ("failed to save config: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* apply */
+	ret = gcm_device_apply (panel->priv->current_device, &error);
+	if (!ret) {
+		g_warning ("failed to apply config: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
 	/* set button insensitive */
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "button_assign_make_default"));
 	gtk_widget_set_sensitive (widget, FALSE);
-
-	/* save device */
-	cc_color_panel_assign_save_profiles_for_device (panel, panel->priv->current_device);
+out:
+	g_object_unref (profile);
 }
 
 /**
- * cc_color_panel_assign_make_default_cb:
+ * cc_color_panel_profile_make_default_cb:
  **/
 static void
-cc_color_panel_assign_make_default_cb (GtkWidget *widget, CcColorPanel *panel)
+cc_color_panel_profile_make_default_cb (GtkWidget *widget, CcColorPanel *panel)
 {
 	GtkTreeIter iter;
 	GtkTreeModel *model;
@@ -1149,7 +1089,7 @@ cc_color_panel_assign_make_default_cb (GtkWidget *widget, CcColorPanel *panel)
 	}
 
 	/* make this profile the default */
-	cc_color_panel_assign_make_default_internal (panel, model, &iter);
+	cc_color_panel_profile_make_default_internal (panel, model, &iter);
 }
 
 /**
@@ -1239,25 +1179,6 @@ cc_color_panel_button_assign_cancel_cb (GtkWidget *widget, CcColorPanel *panel)
 }
 
 /**
- * cc_color_panel_profile_get_tooltip:
- **/
-static const gchar *
-cc_color_panel_profile_get_tooltip (GcmProfile *profile)
-{
-	const gchar *tooltip = NULL;
-
-	/* VCGT warning */
-	if (gcm_profile_get_kind (profile) == GCM_PROFILE_KIND_DISPLAY_DEVICE &&
-	    !gcm_profile_get_has_vcgt (profile)) {
-		/* TRANSLATORS: this is displayed when the profile is crap */
-		tooltip = _("This profile does not have the information required for whole-screen color correction.");
-		goto out;
-	}
-out:
-	return tooltip;
-}
-
-/**
  * cc_color_panel_button_assign_ok_cb:
  **/
 static void
@@ -1265,9 +1186,9 @@ cc_color_panel_button_assign_ok_cb (GtkWidget *widget, CcColorPanel *panel)
 {
 	GtkTreeIter iter;
 	GtkTreeModel *model;
-	GcmProfile *profile;
-	gboolean is_default = FALSE;
+	GcmProfile *profile = NULL;
 	gboolean ret;
+	GError *error = NULL;
 
 	/* hide window */
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "dialog_assign"));
@@ -1277,34 +1198,53 @@ cc_color_panel_button_assign_ok_cb (GtkWidget *widget, CcColorPanel *panel)
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "combobox_profile"));
 	ret = gtk_combo_box_get_active_iter (GTK_COMBO_BOX(widget), &iter);
 	if (!ret)
-		return;
+		goto out;
 	model = gtk_combo_box_get_model (GTK_COMBO_BOX(widget));
 	gtk_tree_model_get (model, &iter,
 			    GCM_PREFS_COMBO_COLUMN_PROFILE, &profile,
 			    -1);
 
-	/* if list is empty, we want this to be the default item */
-	model = GTK_TREE_MODEL (panel->priv->list_store_assign);
-	is_default = !gtk_tree_model_get_iter_first (model, &iter);
-
-	/* add profile */
-	gtk_list_store_append (panel->priv->list_store_assign, &iter);
-	gtk_list_store_set (panel->priv->list_store_assign, &iter,
-			    GCM_ASSIGN_COLUMN_PROFILE, profile,
-			    GCM_ASSIGN_COLUMN_SORT, is_default ? "0" : "1",
-			    GCM_ASSIGN_COLUMN_IS_DEFAULT, is_default,
-			    GCM_ASSIGN_COLUMN_TOOLTIP, cc_color_panel_profile_get_tooltip (profile),
-			    -1);
+	/* just add it, the list store will get ::changed */
+	ret = gcm_device_profile_add (panel->priv->current_device, profile, &error);
+	if (!ret) {
+		g_warning ("failed to add: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
 
-	/* save device */
-	cc_color_panel_assign_save_profiles_for_device (panel, panel->priv->current_device);
+	/* make it default */
+	ret = gcm_device_profile_set_default (panel->priv->current_device, profile, &error);
+	if (!ret) {
+		g_warning ("failed to set default: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* save */
+	ret = gcm_device_save (panel->priv->current_device, &error);
+	if (!ret) {
+		g_warning ("failed to save config: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* apply */
+	ret = gcm_device_apply (panel->priv->current_device, &error);
+	if (!ret) {
+		g_warning ("failed to apply config: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+out:
+	if (profile != NULL)
+		g_object_unref (profile);
 }
 
 /**
- * cc_color_panel_assign_delete_event_cb:
+ * cc_color_panel_profile_delete_event_cb:
  **/
 static gboolean
-cc_color_panel_assign_delete_event_cb (GtkWidget *widget, GdkEvent *event, CcColorPanel *panel)
+cc_color_panel_profile_delete_event_cb (GtkWidget *widget, GdkEvent *event, CcColorPanel *panel)
 {
 	cc_color_panel_button_assign_cancel_cb (widget, panel);
 	return TRUE;
@@ -1439,11 +1379,11 @@ cc_color_panel_add_assign_columns (CcColorPanel *panel, GtkTreeView *treeview)
 		      "wrap-mode", PANGO_WRAP_WORD,
 		      NULL);
 	column = gtk_tree_view_column_new_with_attributes ("", renderer,
-							   "profile", GCM_ASSIGN_COLUMN_PROFILE,
-							   "is-default", GCM_ASSIGN_COLUMN_IS_DEFAULT,
+							   "profile", GCM_LIST_STORE_PROFILES_COLUMN_PROFILE,
+							   "is-default", GCM_LIST_STORE_PROFILES_COLUMN_IS_DEFAULT,
 							   NULL);
-	gtk_tree_view_column_set_sort_column_id (column, GCM_ASSIGN_COLUMN_SORT);
-	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (panel->priv->list_store_assign), GCM_ASSIGN_COLUMN_SORT, GTK_SORT_ASCENDING);
+	gtk_tree_view_column_set_sort_column_id (column, GCM_LIST_STORE_PROFILES_COLUMN_SORT);
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (panel->priv->list_store_profiles), GCM_LIST_STORE_PROFILES_COLUMN_SORT, GTK_SORT_ASCENDING);
 	gtk_tree_view_append_column (treeview, column);
 	gtk_tree_view_column_set_expand (column, TRUE);
 
@@ -1451,7 +1391,7 @@ cc_color_panel_add_assign_columns (CcColorPanel *panel, GtkTreeView *treeview)
 	renderer = gcm_cell_renderer_profile_icon_new ();
 	g_object_set (renderer, "stock-size", GTK_ICON_SIZE_BUTTON, NULL);
 	column = gtk_tree_view_column_new_with_attributes ("", renderer,
-							   "profile", GCM_ASSIGN_COLUMN_PROFILE,
+							   "profile", GCM_LIST_STORE_PROFILES_COLUMN_PROFILE,
 							   NULL);
 	gtk_tree_view_append_column (treeview, column);
 	gtk_tree_view_column_set_expand (column, TRUE);
@@ -1559,9 +1499,7 @@ out:
 static void
 cc_color_panel_devices_treeview_clicked_cb (GtkTreeSelection *selection, CcColorPanel *panel)
 {
-	guint i;
 	GtkTreeModel *model;
-	GtkTreeIter iter;
 	GtkTreePath *path;
 	GtkWidget *widget;
 	gfloat localgamma;
@@ -1571,8 +1509,7 @@ cc_color_panel_devices_treeview_clicked_cb (GtkTreeSelection *selection, CcColor
 	gchar *id = NULL;
 	gboolean ret;
 	GcmDeviceKind kind;
-	GPtrArray *profiles = NULL;
-	GcmProfile *profile;
+	GtkTreeIter iter;
 
 	/* This will only work in single or browse selection mode! */
 	if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
@@ -1643,21 +1580,9 @@ cc_color_panel_devices_treeview_clicked_cb (GtkTreeSelection *selection, CcColor
 	gtk_range_set_value (GTK_RANGE (widget), contrast);
 	panel->priv->setting_up_device = FALSE;
 
-	/* clear existing list */
-	gtk_list_store_clear (panel->priv->list_store_assign);
-
-	/* add profiles for the device */
-	profiles = gcm_device_get_profiles (panel->priv->current_device);
-	for (i=0; i<profiles->len; i++) {
-		profile = g_ptr_array_index (profiles, i);
-		gtk_list_store_append (panel->priv->list_store_assign, &iter);
-		gtk_list_store_set (panel->priv->list_store_assign, &iter,
-				    GCM_ASSIGN_COLUMN_PROFILE, profile,
-				    GCM_ASSIGN_COLUMN_SORT, (i == 0) ? "0" : "1",
-				    GCM_ASSIGN_COLUMN_IS_DEFAULT, (i == 0),
-				    GCM_ASSIGN_COLUMN_TOOLTIP, cc_color_panel_profile_get_tooltip (profile),
-				    -1);
-	}
+	/* set new device */
+	gcm_list_store_profiles_set_from_device (panel->priv->list_store_profiles,
+						 panel->priv->current_device);
 
 	/* select the default profile to display */
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "treeview_assign"));
@@ -1680,16 +1605,14 @@ cc_color_panel_devices_treeview_clicked_cb (GtkTreeSelection *selection, CcColor
 	/* can this device calibrate */
 	cc_color_panel_set_calibrate_button_sensitivity (panel);
 out:
-	if (profiles != NULL)
-		g_ptr_array_unref (profiles);
 	g_free (id);
 }
 
 /**
- * cc_color_panel_assign_treeview_row_activated_cb:
+ * cc_color_panel_profile_treeview_row_activated_cb:
  **/
 static void
-cc_color_panel_assign_treeview_row_activated_cb (GtkTreeView *tree_view, GtkTreePath *path,
+cc_color_panel_profile_treeview_row_activated_cb (GtkTreeView *tree_view, GtkTreePath *path,
 					    GtkTreeViewColumn *column, CcColorPanel *panel)
 {
 	GtkTreeModel *model;
@@ -1697,20 +1620,20 @@ cc_color_panel_assign_treeview_row_activated_cb (GtkTreeView *tree_view, GtkTree
 	gboolean ret;
 
 	/* get the iter */
-	model = GTK_TREE_MODEL (panel->priv->list_store_assign);
+	model = GTK_TREE_MODEL (panel->priv->list_store_profiles);
 	ret = gtk_tree_model_get_iter (model, &iter, path);
 	if (!ret)
 		return;
 
 	/* make this profile the default */
-	cc_color_panel_assign_make_default_internal (panel, model, &iter);
+	cc_color_panel_profile_make_default_internal (panel, model, &iter);
 }
 
 /**
- * cc_color_panel_assign_treeview_clicked_cb:
+ * cc_color_panel_profile_treeview_clicked_cb:
  **/
 static void
-cc_color_panel_assign_treeview_clicked_cb (GtkTreeSelection *selection, CcColorPanel *panel)
+cc_color_panel_profile_treeview_clicked_cb (GtkTreeSelection *selection, CcColorPanel *panel)
 {
 	GtkTreeModel *model;
 	GtkTreeIter iter;
@@ -1732,8 +1655,8 @@ cc_color_panel_assign_treeview_clicked_cb (GtkTreeSelection *selection, CcColorP
 
 	/* get profile */
 	gtk_tree_model_get (model, &iter,
-			    GCM_ASSIGN_COLUMN_PROFILE, &profile,
-			    GCM_ASSIGN_COLUMN_IS_DEFAULT, &is_default,
+			    GCM_LIST_STORE_PROFILES_COLUMN_PROFILE, &profile,
+			    GCM_LIST_STORE_PROFILES_COLUMN_IS_DEFAULT, &is_default,
 			    -1);
 	g_debug ("selected profile = %s", gcm_profile_get_filename (profile));
 
@@ -1744,6 +1667,7 @@ cc_color_panel_assign_treeview_clicked_cb (GtkTreeSelection *selection, CcColorP
 	/* we can remove it now */
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "button_assign_remove"));
 	gtk_widget_set_sensitive (widget, TRUE);
+	g_object_unref (profile);
 }
 
 /**
@@ -2132,26 +2056,7 @@ cc_color_panel_added_cb (GcmClient *client, GcmDevice *device, CcColorPanel *pan
 static void
 cc_color_panel_changed_cb (GcmClient *client, GcmDevice *device, CcColorPanel *panel)
 {
-	GcmDeviceKind kind;
-
-	/* no not re-add to the ui if we just deleted this */
-	if (!gcm_device_get_connected (device) &&
-	    !gcm_device_get_saved (device)) {
-		g_warning ("ignoring uninteresting device: %s", gcm_device_get_id (device));
-		return;
-	}
-
-	g_debug ("changed: %s", gcm_device_get_id (device));
-
-	/* remove the saved device if it's already there */
-	cc_color_panel_remove_device (panel, device);
-
-	/* add the device */
-	kind = gcm_device_get_kind (device);
-	if (kind == GCM_DEVICE_KIND_DISPLAY)
-		cc_color_panel_add_device_xrandr (panel, device);
-	else
-		cc_color_panel_add_device_kind (panel, device);
+	g_debug ("changed: %s (doing nothing)", gcm_device_get_id (device));
 }
 
 /**
@@ -2719,56 +2624,6 @@ cc_color_panel_finalize (GObject *object)
 	G_OBJECT_CLASS (cc_color_panel_parent_class)->finalize (object);
 }
 
-/**
- * cc_color_panel_profile_store_removed_cb:
- **/
-static void
-cc_color_panel_profile_store_removed_cb (GcmProfileStore *profile_store, GcmProfile *profile, CcColorPanel *panel)
-{
-	GcmProfile *profile_tmp;
-	GtkTreeIter iter;
-	GtkTreeModel *model;
-	gboolean ret = FALSE;
-
-	/* check this isn't in the list store already */
-	model = GTK_TREE_MODEL (panel->priv->list_store_assign);
-	if (!gtk_tree_model_get_iter_first (model, &iter))
-		goto out;
-	do {
-		gtk_tree_model_get (model, &iter,
-				    GCM_ASSIGN_COLUMN_PROFILE, &profile_tmp,
-				    -1);
-		/* matches */
-		if (g_strcmp0 (gcm_profile_get_checksum (profile),
-			       gcm_profile_get_checksum (profile_tmp)) == 0) {
-			g_debug ("removed %s which is in the device list",
-				 gcm_profile_get_filename (profile));
-			gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
-			ret = TRUE;
-		}
-		g_object_unref (profile_tmp);
-		if (ret)
-			break;
-	} while (gtk_tree_model_iter_next (model, &iter));
-
-	/* we changed the list */
-	if (ret) {
-
-		/* save */
-		cc_color_panel_assign_save_profiles_for_device (panel, panel->priv->current_device);
-
-		/* re-set the first item as default */
-		if (!gtk_tree_model_get_iter_first (model, &iter))
-			goto out;
-		gtk_list_store_set (panel->priv->list_store_assign, &iter,
-				    GCM_ASSIGN_COLUMN_SORT, "0",
-				    GCM_ASSIGN_COLUMN_IS_DEFAULT, TRUE,
-				    -1);
-	}
-out:
-	return;
-}
-
 static void
 cc_color_panel_init (CcColorPanel *panel)
 {
@@ -2806,18 +2661,18 @@ cc_color_panel_init (CcColorPanel *panel)
 	/* create list stores */
 	panel->priv->list_store_devices = gtk_list_store_new (GCM_DEVICES_COLUMN_LAST, G_TYPE_STRING, G_TYPE_STRING,
 						 G_TYPE_STRING, G_TYPE_STRING);
-	panel->priv->list_store_assign = gtk_list_store_new (GCM_ASSIGN_COLUMN_LAST, G_TYPE_STRING, GCM_TYPE_PROFILE, G_TYPE_BOOLEAN, G_TYPE_STRING);
+	panel->priv->list_store_profiles = gcm_list_store_profiles_new ();
 
 	/* assign buttons */
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "button_assign_add"));
 	g_signal_connect (widget, "clicked",
-			  G_CALLBACK (cc_color_panel_assign_add_cb), panel);
+			  G_CALLBACK (cc_color_panel_profile_add_cb), panel);
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "button_assign_remove"));
 	g_signal_connect (widget, "clicked",
-			  G_CALLBACK (cc_color_panel_assign_remove_cb), panel);
+			  G_CALLBACK (cc_color_panel_profile_remove_cb), panel);
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "button_assign_make_default"));
 	g_signal_connect (widget, "clicked",
-			  G_CALLBACK (cc_color_panel_assign_make_default_cb), panel);
+			  G_CALLBACK (cc_color_panel_profile_make_default_cb), panel);
 
 	/* create device tree view */
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "treeview_devices"));
@@ -2834,18 +2689,18 @@ cc_color_panel_init (CcColorPanel *panel)
 	/* create assign tree view */
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "treeview_assign"));
 	gtk_tree_view_set_model (GTK_TREE_VIEW (widget),
-				 GTK_TREE_MODEL (panel->priv->list_store_assign));
+				 GTK_TREE_MODEL (panel->priv->list_store_profiles));
 	g_signal_connect (GTK_TREE_VIEW (widget), "row-activated",
-			  G_CALLBACK (cc_color_panel_assign_treeview_row_activated_cb), panel);
+			  G_CALLBACK (cc_color_panel_profile_treeview_row_activated_cb), panel);
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
 	g_signal_connect (selection, "changed",
-			  G_CALLBACK (cc_color_panel_assign_treeview_clicked_cb), panel);
+			  G_CALLBACK (cc_color_panel_profile_treeview_clicked_cb), panel);
 
 	/* add columns to the tree view */
 	cc_color_panel_add_assign_columns (panel, GTK_TREE_VIEW (widget));
 	gtk_tree_view_columns_autosize (GTK_TREE_VIEW (widget));
 	gtk_tree_view_set_reorderable (GTK_TREE_VIEW (widget), TRUE);
-	gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (widget), GCM_ASSIGN_COLUMN_TOOLTIP);
+	gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (widget), GCM_LIST_STORE_PROFILES_COLUMN_TOOLTIP);
 
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "button_default"));
 	g_signal_connect (widget, "clicked",
@@ -2894,7 +2749,7 @@ cc_color_panel_init (CcColorPanel *panel)
 	/* set up assign dialog */
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "dialog_assign"));
 	g_signal_connect (widget, "delete-event",
-			  G_CALLBACK (cc_color_panel_assign_delete_event_cb), panel);
+			  G_CALLBACK (cc_color_panel_profile_delete_event_cb), panel);
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "button_assign_cancel"));
 	g_signal_connect (widget, "clicked",
 			  G_CALLBACK (cc_color_panel_button_assign_cancel_cb), panel);
@@ -2945,8 +2800,6 @@ cc_color_panel_init (CcColorPanel *panel)
 
 	/* maintain a list of profiles */
 	panel->priv->profile_store = gcm_profile_store_new ();
-	g_signal_connect (panel->priv->profile_store, "removed",
-			  G_CALLBACK (cc_color_panel_profile_store_removed_cb), panel);
 
 	/* use the color device */
 	panel->priv->sensor_client = gcm_sensor_client_new ();
diff --git a/src/gcm-apply.c b/src/gcm-apply.c
index 22fe290..7e558fc 100644
--- a/src/gcm-apply.c
+++ b/src/gcm-apply.c
@@ -71,7 +71,7 @@ gcm_apply_create_icc_profile_for_edid (GcmDevice *device, const gchar *filename,
 	}
 
 	/* add to the profiles list */
-	ret = gcm_device_add_profile (device, profile);
+	ret = gcm_device_profile_add (device, profile, NULL);
 	if (ret) {
 		/* need to save new list */
 		ret = gcm_device_save (device, error);
@@ -81,10 +81,9 @@ gcm_apply_create_icc_profile_for_edid (GcmDevice *device, const gchar *filename,
 		/* if this failed, it's because it's already associated
 		 * with the device which is okay with us */
 		g_debug ("already added auto-edid profile, not adding %s",
-			   gcm_profile_get_checksum (profile));
+			 gcm_profile_get_checksum (profile));
 		ret = TRUE;
 	}
-
 out:
 	if (profile != NULL)
 		g_object_unref (profile);
diff --git a/src/gcm-device.c b/src/gcm-device.c
index 4f56528..cc2e585 100644
--- a/src/gcm-device.c
+++ b/src/gcm-device.c
@@ -530,10 +530,10 @@ gcm_device_set_profiles (GcmDevice *device, GPtrArray *profiles)
 }
 
 /**
- * gcm_device_add_profile:
+ * gcm_device_profile_add:
  **/
 gboolean
-gcm_device_add_profile (GcmDevice *device, GcmProfile *profile)
+gcm_device_profile_add (GcmDevice *device, GcmProfile *profile, GError **error)
 {
 	guint i;
 	gboolean ret = FALSE;
@@ -547,8 +547,11 @@ gcm_device_add_profile (GcmDevice *device, GcmProfile *profile)
 	md5 = gcm_profile_get_checksum (profile);
 	for (i=0; i<device->priv->profiles->len; i++) {
 		profile_tmp = g_ptr_array_index (device->priv->profiles, i);
-		if (g_strcmp0 (md5, gcm_profile_get_checksum (profile_tmp)) == 0)
+		if (g_strcmp0 (md5, gcm_profile_get_checksum (profile_tmp)) == 0) {
+			g_set_error (error, GCM_DEVICE_ERROR, GCM_DEVICE_ERROR_INTERNAL,
+				     "already added %s", gcm_profile_get_filename (profile));
 			goto out;
+		}
 	}
 
 	/* add */
@@ -560,6 +563,104 @@ out:
 }
 
 /**
+ * gcm_device_profile_remove:
+ **/
+gboolean
+gcm_device_profile_remove (GcmDevice *device, GcmProfile *profile, GError **error)
+{
+	guint i;
+	gboolean ret = TRUE;
+	const gchar *md5;
+	GcmProfile *profile_tmp;
+
+	g_return_val_if_fail (GCM_IS_DEVICE (device), FALSE);
+	g_return_val_if_fail (profile != NULL, FALSE);
+
+	/* array empty */
+	if (device->priv->profiles->len == 0) {
+		g_set_error_literal (error, GCM_DEVICE_ERROR, GCM_DEVICE_ERROR_INTERNAL,
+				     "the profile array is empty");
+		ret = FALSE;
+		goto out;
+	}
+
+	/* check if exists */
+	md5 = gcm_profile_get_checksum (profile);
+	for (i=0; i<device->priv->profiles->len; i++) {
+		profile_tmp = g_ptr_array_index (device->priv->profiles, i);
+		if (g_strcmp0 (md5, gcm_profile_get_checksum (profile_tmp)) == 0) {
+			g_ptr_array_remove_index (device->priv->profiles, i);
+			gcm_device_changed (device);
+			goto out;
+		}
+	}
+
+	/* not present */
+	g_set_error (error, GCM_DEVICE_ERROR, GCM_DEVICE_ERROR_INTERNAL,
+		     "asked to remove %s that does not exist",
+		     gcm_profile_get_filename (profile));
+	ret = FALSE;
+out:
+	return ret;
+}
+
+/**
+ * gcm_device_profile_set_default:
+ **/
+gboolean
+gcm_device_profile_set_default (GcmDevice *device, GcmProfile *profile, GError **error)
+{
+	guint i;
+	gboolean ret = TRUE;
+	const gchar *md5;
+	GcmProfile *profile_tmp;
+	gpointer tmp;
+
+	g_return_val_if_fail (GCM_IS_DEVICE (device), FALSE);
+	g_return_val_if_fail (profile != NULL, FALSE);
+
+	/* array empty */
+	if (device->priv->profiles->len == 0) {
+		g_set_error_literal (error, GCM_DEVICE_ERROR, GCM_DEVICE_ERROR_INTERNAL,
+				     "the profile array is empty");
+		ret = FALSE;
+		goto out;
+	}
+
+	/* only one item */
+	if (device->priv->profiles->len == 1)
+		goto out;
+
+	/* check if exists */
+	md5 = gcm_profile_get_checksum (profile);
+	for (i=0; i<device->priv->profiles->len; i++) {
+		profile_tmp = g_ptr_array_index (device->priv->profiles, i);
+		if (g_strcmp0 (md5, gcm_profile_get_checksum (profile_tmp)) == 0) {
+			if (i == 0) {
+				g_set_error_literal (error, GCM_DEVICE_ERROR, GCM_DEVICE_ERROR_INTERNAL,
+						     "profile already set default");
+				ret = FALSE;
+				goto out;
+			}
+			/* swap the two pointer locations */
+			tmp = device->priv->profiles->pdata[0];
+			device->priv->profiles->pdata[0] = device->priv->profiles->pdata[i];
+			device->priv->profiles->pdata[i] = tmp;
+			gcm_device_changed (device);
+			goto out;
+		}
+	}
+
+	/* not present */
+	g_set_error (error, GCM_DEVICE_ERROR, GCM_DEVICE_ERROR_INTERNAL,
+		     "asked to set default %s that does not exist in list",
+		     gcm_profile_get_filename (profile));
+	ret = FALSE;
+out:
+	return ret;
+}
+
+/**
  * gcm_device_get_default_profile_filename:
  **/
 const gchar *
diff --git a/src/gcm-device.h b/src/gcm-device.h
index 574d156..3b5c617 100644
--- a/src/gcm-device.h
+++ b/src/gcm-device.h
@@ -123,8 +123,15 @@ void			 gcm_device_set_title			(GcmDevice	*device,
 GPtrArray		*gcm_device_get_profiles		(GcmDevice	*device);
 void			 gcm_device_set_profiles		(GcmDevice	*device,
 								 GPtrArray	*profiles);
-gboolean		 gcm_device_add_profile			(GcmDevice	*device,
-								 GcmProfile 	*profile);
+gboolean		 gcm_device_profile_add			(GcmDevice	*device,
+								 GcmProfile 	*profile,
+								 GError		**error);
+gboolean		 gcm_device_profile_remove		(GcmDevice	*device,
+								 GcmProfile 	*profile,
+								 GError		**error);
+gboolean		 gcm_device_profile_set_default		(GcmDevice	*device,
+								 GcmProfile 	*profile,
+								 GError		**error);
 glong			 gcm_device_get_modified_time		(GcmDevice	*device);
 
 /* helpers */
diff --git a/src/gcm-list-store-profiles.c b/src/gcm-list-store-profiles.c
new file mode 100644
index 0000000..ef25251
--- /dev/null
+++ b/src/gcm-list-store-profiles.c
@@ -0,0 +1,170 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2010 Richard Hughes <richard hughsie com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include "gcm-device.h"
+#include "gcm-list-store-profiles.h"
+
+G_DEFINE_TYPE (GcmListStoreProfiles, gcm_list_store_profiles, GTK_TYPE_LIST_STORE);
+
+#define GCM_LIST_STORE_PROFILES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GCM_TYPE_LIST_STORE_PROFILES, GcmListStoreProfilesPrivate))
+
+struct GcmListStoreProfilesPrivate
+{
+	GcmDevice		*device;
+	guint			 changed_id;
+};
+
+/**
+ * cc_color_panel_profile_get_tooltip:
+ **/
+static const gchar *
+cc_color_panel_profile_get_tooltip (GcmProfile *profile)
+{
+	const gchar *tooltip = NULL;
+
+	/* VCGT warning */
+	if (gcm_profile_get_kind (profile) == GCM_PROFILE_KIND_DISPLAY_DEVICE &&
+	    !gcm_profile_get_has_vcgt (profile)) {
+		/* TRANSLATORS: this is displayed when the profile is crap */
+		tooltip = _("This profile does not have the information required for whole-screen color correction.");
+		goto out;
+	}
+out:
+	return tooltip;
+}
+
+/**
+ * gcm_list_store_refresh_profiles:
+ **/
+static void
+gcm_list_store_refresh_profiles (GtkListStore *list_store)
+{
+	GPtrArray *profiles;
+	GtkTreeIter iter;
+	GcmProfile *profile;
+	guint i;
+	GcmListStoreProfilesPrivate *priv = GCM_LIST_STORE_PROFILES(list_store)->priv;
+
+	/* clear existing list */
+	gtk_list_store_clear (list_store);
+
+	/* add profiles for the device */
+	profiles = gcm_device_get_profiles (priv->device);
+	for (i=0; i<profiles->len; i++) {
+		profile = g_ptr_array_index (profiles, i);
+		gtk_list_store_append (list_store, &iter);
+		gtk_list_store_set (list_store, &iter,
+				    GCM_LIST_STORE_PROFILES_COLUMN_PROFILE, profile,
+				    GCM_LIST_STORE_PROFILES_COLUMN_SORT, (i == 0) ? "0" : "1",
+				    GCM_LIST_STORE_PROFILES_COLUMN_IS_DEFAULT, (i == 0),
+				    GCM_LIST_STORE_PROFILES_COLUMN_TOOLTIP, cc_color_panel_profile_get_tooltip (profile),
+				    -1);
+	}
+
+	g_ptr_array_unref (profiles);
+}
+
+/**
+ * gcm_list_store_profiles_device_changed_cb:
+ **/
+static void
+gcm_list_store_profiles_device_changed_cb (GcmDevice *device, GtkListStore *list_store)
+{
+	gcm_list_store_refresh_profiles (list_store);
+}
+
+/**
+ * gcm_list_store_profiles_set_from_device:
+ **/
+void
+gcm_list_store_profiles_set_from_device (GtkListStore *list_store, GcmDevice *device)
+{
+	GcmListStoreProfilesPrivate *priv = GCM_LIST_STORE_PROFILES(list_store)->priv;
+
+	g_return_if_fail (device != NULL);
+
+	/* cache */
+	if (priv->device != NULL)
+		g_object_unref (priv->device);
+	if (priv->changed_id != 0)
+		g_source_remove (priv->changed_id);
+	priv->device = g_object_ref (device);
+	priv->changed_id = g_signal_connect (priv->device, "changed",
+					     G_CALLBACK (gcm_list_store_profiles_device_changed_cb),
+					     list_store);
+
+	/* coldplug */
+	gcm_list_store_refresh_profiles (list_store);
+}
+
+/**
+ * gcm_list_store_profiles_init:
+ **/
+static void
+gcm_list_store_profiles_init (GcmListStoreProfiles *list_store)
+{
+	GType types[] = { G_TYPE_STRING, GCM_TYPE_PROFILE, G_TYPE_BOOLEAN, G_TYPE_STRING };
+	list_store->priv = GCM_LIST_STORE_PROFILES_GET_PRIVATE (list_store);
+	gtk_list_store_set_column_types (GTK_LIST_STORE (list_store), GCM_LIST_STORE_PROFILES_COLUMN_LAST, types);
+}
+
+/**
+ * gcm_list_store_profiles_finalize:
+ **/
+static void
+gcm_list_store_profiles_finalize (GObject *object)
+{
+	GcmListStoreProfilesPrivate *priv = GCM_LIST_STORE_PROFILES(object)->priv;
+
+	g_object_unref (priv->device);
+	if (priv->changed_id != 0)
+		g_source_remove (priv->changed_id);
+
+	G_OBJECT_CLASS (gcm_list_store_profiles_parent_class)->finalize (object);
+}
+
+/**
+ * gcm_list_store_profiles_class_init:
+ **/
+static void
+gcm_list_store_profiles_class_init (GcmListStoreProfilesClass *class)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (class);
+
+	object_class->finalize = gcm_list_store_profiles_finalize;
+
+	g_type_class_add_private (class, sizeof (GcmListStoreProfilesPrivate));
+}
+
+/**
+ * gcm_list_store_profiles_new:
+ * Return value: A new GcmListStoreProfiles object.
+ **/
+GtkListStore *
+gcm_list_store_profiles_new (void)
+{
+	return g_object_new (GCM_TYPE_LIST_STORE_PROFILES, NULL);
+}
+
diff --git a/src/gcm-list-store-profiles.h b/src/gcm-list-store-profiles.h
new file mode 100644
index 0000000..47440a2
--- /dev/null
+++ b/src/gcm-list-store-profiles.h
@@ -0,0 +1,67 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2010 Richard Hughes <richard hughsie com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __GCM_LIST_STORE_PROFILES_H__
+#define __GCM_LIST_STORE_PROFILES_H__
+
+#include <gtk/gtk.h>
+#include <gcm-device.h>
+
+G_BEGIN_DECLS
+
+#define GCM_TYPE_LIST_STORE_PROFILES		(gcm_list_store_profiles_get_type ())
+#define GCM_LIST_STORE_PROFILES(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), GCM_TYPE_LIST_STORE_PROFILES, GcmListStoreProfiles))
+#define GCM_LIST_STORE_PROFILES_CLASS(obj)	(G_TYPE_CHECK_CLASS_CAST ((obj), GCM_LIST_STORE_PROFILES, GcmListStoreProfilesClass))
+#define GCM_IS_LIST_STORE_PROFILES(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCM_TYPE_LIST_STORE_PROFILES))
+#define GCM_IS_LIST_STORE_PROFILES_CLASS(obj)	(G_TYPE_CHECK_CLASS_TYPE ((obj), EFF_TYPE_LIST_STORE_PROFILES))
+#define GCM_LIST_STORE_PROFILES_GET_CLASS	(G_TYPE_INSTANCE_GET_CLASS ((obj), GCM_TYPE_LIST_STORE_PROFILES, GcmListStoreProfilesClass))
+
+enum {
+	GCM_LIST_STORE_PROFILES_COLUMN_SORT,
+	GCM_LIST_STORE_PROFILES_COLUMN_PROFILE,
+	GCM_LIST_STORE_PROFILES_COLUMN_IS_DEFAULT,
+	GCM_LIST_STORE_PROFILES_COLUMN_TOOLTIP,
+	GCM_LIST_STORE_PROFILES_COLUMN_LAST
+};
+
+typedef struct GcmListStoreProfiles		GcmListStoreProfiles;
+typedef struct GcmListStoreProfilesClass	GcmListStoreProfilesClass;
+typedef struct GcmListStoreProfilesPrivate	GcmListStoreProfilesPrivate;
+
+struct GcmListStoreProfiles
+{
+	GtkListStore			 parent;
+	GcmListStoreProfilesPrivate	*priv;
+};
+
+struct GcmListStoreProfilesClass
+{
+	GtkListStoreClass		 parent_class;
+};
+
+GType		 gcm_list_store_profiles_get_type		(void);
+GtkListStore	*gcm_list_store_profiles_new			(void);
+void		 gcm_list_store_profiles_set_from_device	(GtkListStore	*list_store,
+								 GcmDevice	*device);
+
+G_END_DECLS
+
+#endif
diff --git a/src/gcm-self-test.c b/src/gcm-self-test.c
index e778408..a25c7fc 100644
--- a/src/gcm-self-test.c
+++ b/src/gcm-self-test.c
@@ -174,7 +174,7 @@ gcm_test_calibrate_native_func (void)
 	g_assert (calibrate != NULL);
 
 	g_object_set (calibrate,
-		      "output-name", "LVDS-1",
+		      "output-name", "LVDS1",
 		      NULL);
 
 	/* create a virtual device we can "calibrate" */
@@ -202,7 +202,7 @@ gcm_test_calibrate_native_func (void)
 
 	/* set device */
 	g_object_set (device,
-		      "native-device", "LVDS-1",
+		      "native-device", "LVDS1",
 		      NULL);
 	ret = gcm_calibrate_set_from_device (calibrate, device, &error);
 	g_assert_no_error (error);
@@ -478,7 +478,7 @@ gcm_test_device_func (void)
 	ret = gcm_x11_screen_assign (screen, NULL, &error);
 	g_assert_no_error (error);
 	g_assert (ret);
-	output = gcm_x11_screen_get_output_by_name (screen, "LVDS-1", &error);
+	output = gcm_x11_screen_get_output_by_name (screen, "LVDS1", &error);
 	g_assert_no_error (error);
 	g_assert (output != NULL);
 	g_object_unref (screen);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]