[libpeas] Fix loading TRUE value from the plugin info file



commit 3181940bbe62b4bf542ac0313ae6b063ce871e9f
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jun 15 15:36:34 2010 +0100

    Fix loading TRUE value from the plugin info file
    
    Only FALSE values were ever saved.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=621649

 libpeas/peas-plugin-info.c |   31 ++++++++++++++-----------------
 1 files changed, 14 insertions(+), 17 deletions(-)
---
diff --git a/libpeas/peas-plugin-info.c b/libpeas/peas-plugin-info.c
index 4ffab00..372451d 100644
--- a/libpeas/peas-plugin-info.c
+++ b/libpeas/peas-plugin-info.c
@@ -129,28 +129,25 @@ parse_extra_keys (PeasPluginInfo   *info,
         continue;
 
       b = g_key_file_get_boolean (plugin_file, section_header, keys[i], &error);
-      if (b == FALSE)
+      if (b == FALSE && error != NULL)
         {
-          if (error != NULL)
-            {
-              gchar *str;
-              g_error_free (error);
-              error = NULL;
-              str = g_key_file_get_string (plugin_file, section_header, keys[i], NULL);
-              if (str != NULL)
-                {
-                  value = g_new0 (GValue, 1);
-                  g_value_init (value, G_TYPE_STRING);
-                  g_value_take_string (value, str);
-                }
-            }
-          else
+          gchar *str;
+          g_error_free (error);
+          error = NULL;
+          str = g_key_file_get_string (plugin_file, section_header, keys[i], NULL);
+          if (str != NULL)
             {
               value = g_new0 (GValue, 1);
-              g_value_init (value, G_TYPE_BOOLEAN);
-              g_value_set_boolean (value, b);
+              g_value_init (value, G_TYPE_STRING);
+              g_value_take_string (value, str);
             }
         }
+      else
+        {
+          value = g_new0 (GValue, 1);
+          g_value_init (value, G_TYPE_BOOLEAN);
+          g_value_set_boolean (value, b);
+        }
 
       if (!value)
         continue;



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