[gnome-color-manager] trivial: add a simple 'changed' signal to GcmProfileStore



commit a6bc4e2a93ab12b23dd8b1dd33efa142575b9fd7
Author: Richard Hughes <richard hughsie com>
Date:   Thu Jan 7 18:51:50 2010 +0000

    trivial: add a simple 'changed' signal to GcmProfileStore

 src/gcm-profile-store.c |   14 ++++++++++++--
 src/gcm-profile-store.h |    1 +
 2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/gcm-profile-store.c b/src/gcm-profile-store.c
index 30f8822..662a19a 100644
--- a/src/gcm-profile-store.c
+++ b/src/gcm-profile-store.c
@@ -59,6 +59,7 @@ struct _GcmProfileStorePrivate
 enum {
 	SIGNAL_ADDED,
 	SIGNAL_REMOVED,
+	SIGNAL_CHANGED,
 	SIGNAL_LAST
 };
 
@@ -195,8 +196,9 @@ gcm_profile_store_add_profile (GcmProfileStore *profile_store, const gchar *file
 	g_signal_connect (profile, "notify::filename", G_CALLBACK(gcm_profile_store_notify_filename_cb), profile_store);
 
 	/* emit a signal */
-	egg_debug ("emit added: %s", filename);
+	egg_debug ("emit added (and changed): %s", filename);
 	g_signal_emit (profile_store, signals[SIGNAL_ADDED], 0, profile);
+	g_signal_emit (profile_store, signals[SIGNAL_CHANGED], 0);
 out:
 	if (profile != NULL)
 		g_object_unref (profile);
@@ -337,7 +339,6 @@ gcm_profile_store_class_init (GcmProfileStoreClass *klass)
 			      G_STRUCT_OFFSET (GcmProfileStoreClass, added),
 			      NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
 			      G_TYPE_NONE, 1, G_TYPE_OBJECT);
-
 	/**
 	 * GcmProfileStore::removed
 	 **/
@@ -347,6 +348,15 @@ gcm_profile_store_class_init (GcmProfileStoreClass *klass)
 			      G_STRUCT_OFFSET (GcmProfileStoreClass, removed),
 			      NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
 			      G_TYPE_NONE, 1, G_TYPE_OBJECT);
+	/**
+	 * GcmProfileStore::changed
+	 **/
+	signals[SIGNAL_CHANGED] =
+		g_signal_new ("changed",
+			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (GcmProfileStoreClass, changed),
+			      NULL, NULL, g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
 
 	g_type_class_add_private (klass, sizeof (GcmProfileStorePrivate));
 }
diff --git a/src/gcm-profile-store.h b/src/gcm-profile-store.h
index aba5bb7..fc03510 100644
--- a/src/gcm-profile-store.h
+++ b/src/gcm-profile-store.h
@@ -50,6 +50,7 @@ struct _GcmProfileStoreClass
 	GObjectClass	parent_class;
 	void		(* added)			(GcmProfile		*profile);
 	void		(* removed)			(GcmProfile		*profile);
+	void		(* changed)			(void);
 	/* padding for future expansion */
 	void (*_gcm_reserved1) (void);
 	void (*_gcm_reserved2) (void);



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