[nautilus-actions] Remove deprecated references to the UUID



commit 3c4568fbbaa52c2f0a46607f509e0cd9eb283d05
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sun Jan 9 21:25:04 2011 +0100

    Remove deprecated references to the UUID

 ChangeLog                         |   12 ++++++++++++
 src/api/na-iimporter.h            |    6 +++---
 src/core/na-io-provider.c         |   12 ++++++------
 src/core/na-object-id.c           |    4 ++--
 src/core/na-object-item.c         |    6 +++---
 src/io-desktop/nadp-utils.c       |    1 -
 src/nact/nact-assistant-import.c  |    8 ++++----
 src/nact/nact-iactions-list-bis.c |    6 +++---
 src/nact/nact-iactions-list.h     |    2 +-
 src/nact/nact-main-window.c       |    8 ++++----
 src/nact/nact-preferences.ui      |   20 ++++++++++----------
 src/nact/nact-tree-model.c        |    3 ++-
 12 files changed, 50 insertions(+), 38 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9131678..7372c0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2011-01-09 Pierre Wieser <pwieser trychlos org>
 
+	* src/api/na-iimporter.h:
+	* src/core/na-io-provider.c:
+	* src/core/na-object-id.c:
+	* src/core/na-object-item.c:
+	* src/io-desktop/nadp-utils.c:
+	* src/nact/nact-assistant-import.c:
+	* src/nact/nact-iactions-list-bis.c:
+	* src/nact/nact-iactions-list.h:
+	* src/nact/nact-main-window.c:
+	* src/nact/nact-preferences.ui:
+	* src/nact/nact-tree-model.c: Remove all deprecated references to an UUID.
+
 	* po/POTFILES.in: Add src/io-desktop/nadp-formats.c file.
 
 	* src/core/na-object-profile-factory.c:
diff --git a/src/api/na-iimporter.h b/src/api/na-iimporter.h
index 1b972cf..b373799 100644
--- a/src/api/na-iimporter.h
+++ b/src/api/na-iimporter.h
@@ -186,8 +186,8 @@ typedef enum {
  *
  * If this function is not provided, then the #NAIImporter provider will not
  * be able to check for duplicates. In this case, the id of the imported item
- * should be systematically regenerated as a unique id (uuid), regardless of
- * the asked import mode.
+ * should be systematically regenerated as a unique id, regardless of the
+ * asked import mode.
  *
  * Returns: the already existing #NAObjectItem with same id, or %NULL.
  *
@@ -207,7 +207,7 @@ typedef NAObjectItem * ( *NAIImporterCheckFn )( const NAObjectItem *, void * );
  *
  * If this function is not provided, then the #NAIImporter provider will
  * not be able to ask the user. In this case, the duplicated id should be
- * systematically regenerated as a unique id (uuid).
+ * systematically regenerated as a unique id.
  *
  * Returns: the import mode choosen by the user, which must not be
  * %IMPORTER_MODE_ASK.
diff --git a/src/core/na-io-provider.c b/src/core/na-io-provider.c
index 430aeff..b7cf959 100644
--- a/src/core/na-io-provider.c
+++ b/src/core/na-io-provider.c
@@ -88,7 +88,7 @@ static void   dump( const NAIOProvider *provider );
 
 static GList *get_merged_items_list( const NAPivot *pivot, GList *providers, GSList **messages );
 static GList *build_hierarchy( GList **tree, GSList *level_zero, gboolean list_if_empty, NAObjectItem *parent );
-static gint   search_item( const NAObject *obj, const gchar *uuid );
+static gint   search_item( const NAObject *obj, const gchar *id );
 static GList *sort_tree( const NAPivot *pivot, GList *tree, GCompareFunc fn );
 static GList *filter_unwanted_items( const NAPivot *pivot, GList *merged );
 static GList *filter_unwanted_items_rec( GList *merged, gboolean load_disabled, gboolean load_invalid );
@@ -755,13 +755,13 @@ build_hierarchy( GList **tree, GSList *level_zero, gboolean list_if_empty, NAObj
 
 	if( g_slist_length( level_zero )){
 		for( ilevel = level_zero ; ilevel ; ilevel = ilevel->next ){
-			/*g_debug( "%s: uuid=%s", thisfn, ( gchar * ) ilevel->data );*/
+			/*g_debug( "%s: id=%s", thisfn, ( gchar * ) ilevel->data );*/
 			it = g_list_find_custom( *tree, ilevel->data, ( GCompareFunc ) search_item );
 			if( it ){
 				hierarchy = g_list_append( hierarchy, it->data );
 				na_object_set_parent( it->data, parent );
 
-				g_debug( "%s: uuid=%s: %s (%p) appended to hierarchy %p",
+				g_debug( "%s: id=%s: %s (%p) appended to hierarchy %p",
 						thisfn, ( gchar * ) ilevel->data, G_OBJECT_TYPE_NAME( it->data ), ( void * ) it->data, ( void * ) hierarchy );
 
 				*tree = g_list_remove_link( *tree, it );
@@ -791,17 +791,17 @@ build_hierarchy( GList **tree, GSList *level_zero, gboolean list_if_empty, NAObj
 }
 
 /*
- * returns zero when obj has the required uuid
+ * returns zero when obj has the required id
  */
 static gint
-search_item( const NAObject *obj, const gchar *uuid )
+search_item( const NAObject *obj, const gchar *id )
 {
 	gchar *obj_id;
 	gint ret = 1;
 
 	if( NA_IS_OBJECT_ITEM( obj )){
 		obj_id = na_object_get_id( obj );
-		ret = strcmp( obj_id, uuid );
+		ret = strcmp( obj_id, id );
 		g_free( obj_id );
 	}
 
diff --git a/src/core/na-object-id.c b/src/core/na-object-id.c
index 15bd9e7..df6e8d9 100644
--- a/src/core/na-object-id.c
+++ b/src/core/na-object-id.c
@@ -297,8 +297,8 @@ na_object_id_sort_alpha_desc( const NAObjectId *a, const NAObjectId *b )
  * #NAObjectAction @action. The identifier is always renumbered to be
  * suitable with the already existing profiles.
  *
- * If a #NAObjectAction or a #NAObjectMenu, a new UUID is allocated if
- * and only if @relabel is %TRUE.
+ * If a #NAObjectAction or a #NAObjectMenu, a new identifier is allocated
+ * if and only if @relabel is %TRUE.
  *
  * Actual relabeling takes place if @relabel is %TRUE, depending of the
  * user preferences.
diff --git a/src/core/na-object-item.c b/src/core/na-object-item.c
index 7e6ad85..04aed0b 100644
--- a/src/core/na-object-item.c
+++ b/src/core/na-object-item.c
@@ -236,9 +236,9 @@ object_copy( NAObject *target, const NAObject *source, gboolean recursive )
 }
 
 /*
- * new_parent is not relevant when allocating a new UUID for an action
- * or a menu ; it may safely be left as NULL though there is no gain to
- * check this
+ * new_parent is not relevant when allocating a new identifier for an
+ * action or a menu ; it may safely be left as NULL though there is no
+ * gain to check this
  */
 static gchar *
 object_id_new_id( const NAObjectId *item, const NAObjectId *new_parent )
diff --git a/src/io-desktop/nadp-utils.c b/src/io-desktop/nadp-utils.c
index 68465b6..2dd42b1 100644
--- a/src/io-desktop/nadp-utils.c
+++ b/src/io-desktop/nadp-utils.c
@@ -36,7 +36,6 @@
 #include <gio/gio.h>
 #include <glib/gstdio.h>
 #include <string.h>
-#include <uuid/uuid.h>
 
 #include <api/na-core-utils.h>
 
diff --git a/src/nact/nact-assistant-import.c b/src/nact/nact-assistant-import.c
index 78a0ff8..c7e2b23 100644
--- a/src/nact/nact-assistant-import.c
+++ b/src/nact/nact-assistant-import.c
@@ -729,7 +729,7 @@ prepare_importdone( NactAssistantImport *window, GtkAssistant *assistant, GtkWid
 {
 	static const gchar *thisfn = "nact_assistant_import_prepare_importdone";
 	gchar *text, *tmp, *text2;
-	gchar *bname, *uuid, *label;
+	gchar *bname, *id, *label;
 	GList *is;
 	GSList *im;
 	NAImporterResult *result;
@@ -767,12 +767,12 @@ prepare_importdone( NactAssistantImport *window, GtkAssistant *assistant, GtkWid
 			tmp = g_strdup_printf( "%s\t\t%s\n", text, _( "Import OK" ));
 			g_free( text );
 			text = tmp;
-			uuid = na_object_get_id( result->imported );
+			id = na_object_get_id( result->imported );
 			label = na_object_get_label( result->imported );
 			/* i18n: this is the globally unique identifier and the label of the newly imported action */
-			text2 = g_strdup_printf( _( "UUID: %s\t%s" ), uuid, label);
+			text2 = g_strdup_printf( _( "Id.: %s\t%s" ), id, label);
 			g_free( label );
-			g_free( uuid );
+			g_free( id );
 			tmp = g_strdup_printf( "%s\t\t%s\n", text, text2 );
 			g_free( text );
 			text = tmp;
diff --git a/src/nact/nact-iactions-list-bis.c b/src/nact/nact-iactions-list-bis.c
index 3dcc90e..776bebb 100644
--- a/src/nact/nact-iactions-list-bis.c
+++ b/src/nact/nact-iactions-list-bis.c
@@ -58,7 +58,7 @@ typedef gboolean ( *FnIterOnSelection )( NactIActionsList *, GtkTreeView *, GtkT
  */
 typedef struct {
 	NAObject *object;
-	gchar    *uuid;
+	gchar    *id;
 }
 	IdToObjectIter;
 
@@ -289,7 +289,7 @@ nact_iactions_list_bis_get_item( NactIActionsList *instance, const gchar *id )
 		model = NACT_TREE_MODEL( gtk_tree_view_get_model( treeview ));
 
 		ito = g_new0( IdToObjectIter, 1 );
-		ito->uuid = ( gchar * ) id;
+		ito->id = ( gchar * ) id;
 
 		nact_tree_model_iter( model, ( FnIterOnStore ) get_item_iter, ito );
 
@@ -909,7 +909,7 @@ get_item_iter( NactTreeModel *model, GtkTreePath *path, NAObject *object, IdToOb
 	gboolean found = FALSE;
 
 	id = na_object_get_id( object );
-	found = ( g_ascii_strcasecmp( id, ito->uuid ) == 0 );
+	found = ( g_ascii_strcasecmp( id, ito->id ) == 0 );
 	g_free( id );
 
 	if( found ){
diff --git a/src/nact/nact-iactions-list.h b/src/nact/nact-iactions-list.h
index 40f5894..831393b 100644
--- a/src/nact/nact-iactions-list.h
+++ b/src/nact/nact-iactions-list.h
@@ -124,7 +124,7 @@ void      nact_iactions_list_bis_clear_selection( NactIActionsList *instance, Gt
 void      nact_iactions_list_bis_collapse_to_parent( NactIActionsList *instance );
 void      nact_iactions_list_bis_delete( NactIActionsList *instance, GList *items, gboolean select_at_end );
 void      nact_iactions_list_bis_expand_to_first_child( NactIActionsList *instance );
-NAObject *nact_iactions_list_bis_get_item( NactIActionsList *instance, const gchar *uuid );
+NAObject *nact_iactions_list_bis_get_item( NactIActionsList *instance, const gchar *id );
 GList    *nact_iactions_list_bis_get_items( NactIActionsList *instance );
 GList    *nact_iactions_list_bis_get_selected_items( NactIActionsList *instance );
 void      nact_iactions_list_bis_insert_at_path( NactIActionsList *instance, GList *items, GtkTreePath *path );
diff --git a/src/nact/nact-main-window.c b/src/nact/nact-main-window.c
index 69cada7..d535548 100644
--- a/src/nact/nact-main-window.c
+++ b/src/nact/nact-main-window.c
@@ -840,7 +840,7 @@ nact_main_window_get_clipboard( const NactMainWindow *window )
 /**
  * nact_main_window_get_item:
  * @window: this #NactMainWindow instance.
- * @uuid: the uuid to check for existancy.
+ * @id: the identifier to check for existancy.
  *
  * Returns: a pointer to the #NAObjectItem if it exists in the current
  * tree, or %NULL else.
@@ -851,7 +851,7 @@ nact_main_window_get_clipboard( const NactMainWindow *window )
  * Also note that the returned object may be an action, but also a menu.
  */
 NAObjectItem *
-nact_main_window_get_item( const NactMainWindow *window, const gchar *uuid )
+nact_main_window_get_item( const NactMainWindow *window, const gchar *id )
 {
 	NAObjectItem *exists;
 	NactApplication *application;
@@ -867,11 +867,11 @@ nact_main_window_get_item( const NactMainWindow *window, const gchar *uuid )
 		if( 0 ){
 			application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
 			updater = nact_application_get_updater( application );
-			exists = na_pivot_get_item( NA_PIVOT( updater ), uuid );
+			exists = na_pivot_get_item( NA_PIVOT( updater ), id );
 		}
 
 		if( !exists ){
-			exists = NA_OBJECT_ITEM( nact_iactions_list_bis_get_item( NACT_IACTIONS_LIST( window ), uuid ));
+			exists = NA_OBJECT_ITEM( nact_iactions_list_bis_get_item( NACT_IACTIONS_LIST( window ), id ));
 		}
 	}
 
diff --git a/src/nact/nact-preferences.ui b/src/nact/nact-preferences.ui
index e73160c..90e969d 100644
--- a/src/nact/nact-preferences.ui
+++ b/src/nact/nact-preferences.ui
@@ -474,7 +474,7 @@ Note that this item will be displayed only if a unique menu is defined in the Na
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="ypad">10</property>
-                                <property name="label" translatable="yes">What to do when an action being imported has the same UUID that an already existing one ?</property>
+                                <property name="label" translatable="yes">What to do when an item, action or menu, selected to be imported, has the same identifier that a currently existing one ?</property>
                                 <property name="wrap">True</property>
                               </object>
                               <packing>
@@ -488,13 +488,13 @@ Note that this item will be displayed only if a unique menu is defined in the Na
                                 <property name="homogeneous">True</property>
                                 <child>
                                   <object class="GtkRadioButton" id="PrefsNoImportButton">
-                                    <property name="label" translatable="yes">Do _not import actions whose UUID already exists</property>
+                                    <property name="label" translatable="yes">Do _not import the item</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
                                     <property name="tooltip_text" translatable="yes">This used to be the historical behavior.
-The selected file will be marked as "NOT OK" in the Summary page.
-The existing action will not be modified.</property>
+The selected item, action or menu, will not be imported and will be marked as "NOT OK" in the Summary page.
+The currently existing item will not be modified.</property>
                                     <property name="use_underline">True</property>
                                     <property name="active">True</property>
                                     <property name="draw_indicator">True</property>
@@ -505,12 +505,12 @@ The existing action will not be modified.</property>
                                 </child>
                                 <child>
                                   <object class="GtkRadioButton" id="PrefsRenumberButton">
-                                    <property name="label" translatable="yes">_Renumber imported actions whose UUID already exists</property>
+                                    <property name="label" translatable="yes">_Renumber the imported item</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
-                                    <property name="tooltip_text" translatable="yes">The selected file will be imported with a slightly modified label indicating the renumbering.
-The existing action will not be modified.</property>
+                                    <property name="tooltip_text" translatable="yes">The selected item, action or menu, will be imported with a slightly modified label indicating the renumbering.
+The currently existing item will not be modified.</property>
                                     <property name="use_underline">True</property>
                                     <property name="draw_indicator">True</property>
                                     <property name="group">PrefsNoImportButton</property>
@@ -521,11 +521,11 @@ The existing action will not be modified.</property>
                                 </child>
                                 <child>
                                   <object class="GtkRadioButton" id="PrefsOverrideButton">
-                                    <property name="label" translatable="yes">_Override existing actions when importing with same UUID</property>
+                                    <property name="label" translatable="yes">_Override the currently existing item with the imported one</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
-                                    <property name="tooltip_text" translatable="yes">The action found in the selected file will silently override the current action which has the same identifier.
+                                    <property name="tooltip_text" translatable="yes">The selected item, action or menu, will silently override the currently existing one which has the same identifier.
 Be warned: this mode may be dangerous. You will not be prompted another time.</property>
                                     <property name="use_underline">True</property>
                                     <property name="draw_indicator">True</property>
@@ -541,7 +541,7 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
-                                    <property name="tooltip_text" translatable="yes">You will be asked each time an imported UUID already exists.</property>
+                                    <property name="tooltip_text" translatable="yes">You will be asked each time a selected item has an already existing identifier.</property>
                                     <property name="use_underline">True</property>
                                     <property name="draw_indicator">True</property>
                                     <property name="group">PrefsNoImportButton</property>
diff --git a/src/nact/nact-tree-model.c b/src/nact/nact-tree-model.c
index dfde87e..1b9230a 100644
--- a/src/nact/nact-tree-model.c
+++ b/src/nact/nact-tree-model.c
@@ -1035,7 +1035,8 @@ iter_on_store_item( NactTreeModel *model, GtkTreeModel *store, GtkTreeIter *iter
 }
 
 /*
- * if the object, identified by its uuid, already exists, then remove it first
+ * if the object, identified by its id (historically a uuid), already exists,
+ * then remove it first
  */
 static void
 remove_if_exists( NactTreeModel *model, GtkTreeModel *store, const NAObject *object )



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