[gimp] app: Clarify session_init() a bit



commit c8853243ea630e829ce659bcacc90b9a6eb9c7db
Author: Martin Nordholts <martinn src gnome org>
Date:   Sat Sep 19 18:00:15 2009 +0200

    app: Clarify session_init() a bit
    
    Clarify session_init() by adding comments and using
    gimp_config_deserialize() and g_str_equal() in sessionrc parsing.

 app/gui/session.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/app/gui/session.c b/app/gui/session.c
index 181ff06..eecbb22 100644
--- a/app/gui/session.c
+++ b/app/gui/session.c
@@ -147,19 +147,24 @@ session_init (Gimp *gimp)
 
               info = gimp_session_info_new ();
 
-              if (strcmp (entry_name, "dock"))
+              /* "dock" entries in the "dock" factory are just dummy
+               * entries and don't have any dialog factory entry, so
+               * don't bother looking for entires for them
+               */
+              if (!g_str_equal (entry_name, "dock"))
                 {
                   info->toplevel_entry = gimp_dialog_factory_find_entry (factory,
                                                                          entry_name);
+
+                  /* If we expected a dialog factory entry but failed
+                   * to find one, skip to add this session info object
+                   */
                   skip = (info->toplevel_entry == NULL);
                 }
 
               g_free (entry_name);
 
-              if (GIMP_CONFIG_GET_INTERFACE (info)->deserialize (GIMP_CONFIG (info),
-                                                                 scanner,
-                                                                 1,
-                                                                 NULL))
+              if (gimp_config_deserialize (GIMP_CONFIG (info), scanner, 1, NULL))
                 {
                   if (! skip)
                     {



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