[gimp] app: GimpSessionInfoDock::identifier -> dock_type



commit f75f61779c0415e30c941da2b6a6a4001d03e1f0
Author: Martin Nordholts <martinn src gnome org>
Date:   Wed Apr 20 07:46:56 2011 +0200

    app: GimpSessionInfoDock::identifier -> dock_type
    
    Rename GimpSessionInfoDock::identifier to dock_type, because it isn't
    really an identifier; there might be several instance with dock_type
    being "gimp-dock". This is a preparation for adding an actual
    'identifier' member.

 app/widgets/gimpsessioninfo-dock.c |   18 +++++++++---------
 app/widgets/gimpsessioninfo-dock.h |   10 ++++++----
 app/widgets/gimpsessioninfo.c      |   14 +++++++-------
 3 files changed, 22 insertions(+), 20 deletions(-)
---
diff --git a/app/widgets/gimpsessioninfo-dock.c b/app/widgets/gimpsessioninfo-dock.c
index 1500919..9bcb039 100644
--- a/app/widgets/gimpsessioninfo-dock.c
+++ b/app/widgets/gimpsessioninfo-dock.c
@@ -46,12 +46,12 @@ enum
 /*  public functions  */
 
 GimpSessionInfoDock *
-gimp_session_info_dock_new (const gchar *identifier)
+gimp_session_info_dock_new (const gchar *dock_type)
 {
   GimpSessionInfoDock *dock_info = NULL;
 
   dock_info = g_slice_new0 (GimpSessionInfoDock);
-  dock_info->identifier = g_strdup (identifier);
+  dock_info->dock_type = g_strdup (dock_type);
 
   return dock_info;
 }
@@ -61,10 +61,10 @@ gimp_session_info_dock_free (GimpSessionInfoDock *dock_info)
 {
   g_return_if_fail (dock_info != NULL);
 
-  if (dock_info->identifier)
+  if (dock_info->dock_type)
     {
-      g_free (dock_info->identifier);
-      dock_info->identifier = NULL;
+      g_free (dock_info->dock_type);
+      dock_info->dock_type = NULL;
     }
 
   if (dock_info->books)
@@ -86,7 +86,7 @@ gimp_session_info_dock_serialize (GimpConfigWriter    *writer,
   g_return_if_fail (writer != NULL);
   g_return_if_fail (dock_info != NULL);
 
-  gimp_config_writer_open (writer, dock_info->identifier);
+  gimp_config_writer_open (writer, dock_info->dock_type);
 
   for (list = dock_info->books; list; list = g_list_next (list))
     gimp_session_info_book_serialize (writer, list->data);
@@ -98,7 +98,7 @@ GTokenType
 gimp_session_info_dock_deserialize (GScanner             *scanner,
                                     gint                  scope,
                                     GimpSessionInfoDock **dock_info,
-                                    const gchar          *identifier)
+                                    const gchar          *dock_type)
 {
   GTokenType token;
 
@@ -108,7 +108,7 @@ gimp_session_info_dock_deserialize (GScanner             *scanner,
   g_scanner_scope_add_symbol (scanner, scope, "book",
                               GINT_TO_POINTER (SESSION_INFO_BOOK));
 
-  *dock_info = gimp_session_info_dock_new (identifier);
+  *dock_info = gimp_session_info_dock_new (dock_type);
 
   token = G_TOKEN_LEFT_PAREN;
 
@@ -205,7 +205,7 @@ gimp_session_info_dock_restore (GimpSessionInfoDock *dock_info,
   dock       = gimp_dialog_factory_dialog_new (factory,
                                                screen,
                                                ui_manager,
-                                               dock_info->identifier,
+                                               dock_info->dock_type,
                                                -1 /*view_size*/,
                                                FALSE /*present*/);
 
diff --git a/app/widgets/gimpsessioninfo-dock.h b/app/widgets/gimpsessioninfo-dock.h
index 4acf156..89e004a 100644
--- a/app/widgets/gimpsessioninfo-dock.h
+++ b/app/widgets/gimpsessioninfo-dock.h
@@ -29,21 +29,23 @@
  */
 struct _GimpSessionInfoDock
 {
-  /* Identifier written to/read from sessionrc */
-  gchar *identifier;
+  /* Type of dock, written to/read from sessionrc. E.g. 'gimp-dock' or
+   * 'gimp-toolbox'
+   */
+  gchar *dock_type;
 
   /*  list of GimpSessionInfoBook  */
   GList *books;
 };
 
-GimpSessionInfoDock * gimp_session_info_dock_new         (const gchar          *identifier);
+GimpSessionInfoDock * gimp_session_info_dock_new         (const gchar          *dock_type);
 void                  gimp_session_info_dock_free        (GimpSessionInfoDock  *dock_info);
 void                  gimp_session_info_dock_serialize   (GimpConfigWriter     *writer,
                                                           GimpSessionInfoDock  *dock);
 GTokenType            gimp_session_info_dock_deserialize (GScanner             *scanner,
                                                           gint                  scope,
                                                           GimpSessionInfoDock **info,
-                                                          const gchar          *identifier);
+                                                          const gchar          *dock_type);
 GimpSessionInfoDock * gimp_session_info_dock_from_widget (GimpDock             *dock);
 void                  gimp_session_info_dock_restore     (GimpSessionInfoDock  *dock_info,
                                                           GimpDialogFactory    *factory,
diff --git a/app/widgets/gimpsessioninfo.c b/app/widgets/gimpsessioninfo.c
index f054adb..ad9d0c2 100644
--- a/app/widgets/gimpsessioninfo.c
+++ b/app/widgets/gimpsessioninfo.c
@@ -340,7 +340,7 @@ gimp_session_info_deserialize (GimpConfig *config,
             case SESSION_INFO_DOCK:
               {
                 GimpSessionInfoDock *dock_info  = NULL;
-                const gchar         *identifier = NULL;
+                const gchar         *dock_type = NULL;
 
                 /* Handle old sessionrc:s from versions <= GIMP 2.6 */
                 if (GPOINTER_TO_INT (scanner->value.v_symbol) == SESSION_INFO_DOCK &&
@@ -348,20 +348,20 @@ gimp_session_info_deserialize (GimpConfig *config,
                     info->p->factory_entry->identifier &&
                     strcmp ("gimp-toolbox-window", info->p->factory_entry->identifier) == 0)
                   {
-                    identifier = "gimp-toolbox";
+                    dock_type = "gimp-toolbox";
                   }
                 else
                   {
-                    identifier = ((GPOINTER_TO_INT (scanner->value.v_symbol) ==
-                                   SESSION_INFO_GIMP_TOOLBOX) ?
-                                  "gimp-toolbox" :
-                                  "gimp-dock");
+                    dock_type = ((GPOINTER_TO_INT (scanner->value.v_symbol) ==
+                                  SESSION_INFO_GIMP_TOOLBOX) ?
+                                 "gimp-toolbox" :
+                                 "gimp-dock");
                   }
 
                 g_scanner_set_scope (scanner, scope_id + 1);
                 token = gimp_session_info_dock_deserialize (scanner, scope_id + 1,
                                                             &dock_info,
-                                                            identifier);
+                                                            dock_type);
 
                 if (token == G_TOKEN_LEFT_PAREN)
                   {



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