[geany/geany-plugins] 72e3fe: Fix a few small bugs.

Matthew Brush git-noreply at geany.org
Fri Feb 1 03:18:20 UTC 2013


Branch:      refs/heads/master
Author:      Matthew Brush <matt at geany.org>
Committer:   Matthew Brush <matt at geany.org>
Date:        Fri, 01 Feb 2013 03:18:20 UTC
Commit:      72e3febe407a20be0e1c9a9fc4e1057cdc1e6cad
             https://github.com/geany/geany-plugins/commit/72e3febe407a20be0e1c9a9fc4e1057cdc1e6cad

Log Message:
-----------
Fix a few small bugs.

* Change 'uint' typo to 'guint'.
* Change accidental hardcoded default_value.
* Add wrapper function for g_object_class_install_properties since
  it's only available since GLIB 2.26.
* Make PROP_O equal zero because it's always supposed to be zero.


Modified Paths:
--------------
    markdown/src/conf.c

Modified: markdown/src/conf.c
21 files changed, 17 insertions(+), 4 deletions(-)
===================================================================
@@ -64,7 +64,7 @@
 
 enum
 {
-  PROP_0,
+  PROP_0 = 0,
   PROP_TEMPLATE_FILE,
   PROP_FONT_NAME,
   PROP_CODE_FONT_NAME,
@@ -242,7 +242,7 @@ static gboolean on_idle_timeout(MarkdownConfig *conf)
 
 static guint
 markdown_config_get_uint_key(MarkdownConfig *conf, const gchar *group,
-  const gchar *key, uint default_value)
+  const gchar *key, guint default_value)
 {
   guint out_uint;
   GError *error = NULL;
@@ -251,7 +251,7 @@ static gboolean on_idle_timeout(MarkdownConfig *conf)
   if (error) {
     g_debug("Config read failed: %s", error->message);
     g_error_free(error); error = NULL;
-    out_uint = 12;
+    out_uint = default_value;
   }
 
   return out_uint;
@@ -339,6 +339,19 @@ static gboolean on_idle_timeout(MarkdownConfig *conf)
 }
 
 static void
+markdown_install_class_properties(GObjectClass *gclass, guint n_pspecs,
+  GParamSpec **pspecs)
+{
+#if GLIB_CHECK_VERSION(2, 26, 0)
+  g_object_class_install_properties(gclass, n_pspecs, pspecs);
+#else
+  guint i;
+  for (i = 1; i < n_pspecs; i++)
+    g_object_class_install_property(gclass, i, pspecs[i]);
+#endif
+}
+
+static void
 markdown_config_class_init(MarkdownConfigClass *klass)
 {
   GObjectClass *g_object_class;
@@ -369,7 +382,7 @@ static gboolean on_idle_timeout(MarkdownConfig *conf)
     MARKDOWN_CONFIG_VIEW_POS_MAX-1, (guint) MARKDOWN_CONFIG_VIEW_POS_SIDEBAR,
     G_PARAM_READWRITE);
 
-  g_object_class_install_properties(g_object_class, PROP_LAST, md_props);
+  markdown_install_class_properties(g_object_class, PROP_LAST, md_props);
 }
 
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list