[libpeas] Coding style fixes



commit e96a37e6255bfc9abe1bc718b3c222219dff3da8
Author: Garrett Regier <alias301 gmail com>
Date:   Tue Jun 29 03:43:48 2010 -0700

    Coding style fixes

 libpeas/peas-activatable.c                         |    4 +-
 libpeas/peas-engine.c                              |   51 +++++++++++--------
 libpeas/peas-engine.h                              |    7 +--
 libpeas/peas-extension-base.c                      |    4 +-
 libpeas/peas-extension-base.h                      |    6 +-
 libpeas/peas-extension-set.c                       |    6 +-
 libpeas/peas-extension-set.h                       |   23 +++++----
 libpeas/peas-extension.c                           |    6 +-
 libpeas/peas-extension.h                           |    4 +-
 libpeas/peas-introspection.c                       |    7 ++-
 libpeas/peas-introspection.h                       |    5 +-
 libpeas/peas-object-module.c                       |   18 ++++---
 libpeas/peas-object-module.h                       |    6 +-
 libpeas/peas-plugin-info.c                         |   18 +++----
 libpeas/peas-plugin-info.h                         |    2 +-
 libpeasui/peas-ui-configurable.c                   |    6 +-
 libpeasui/peas-ui-configurable.h                   |   16 +++---
 libpeasui/peas-ui-plugin-info.c                    |    2 +
 libpeasui/peas-ui-plugin-info.h                    |    1 -
 libpeasui/peas-ui-plugin-manager.c                 |   40 +++++++---------
 loaders/c/peas-extension-c.h                       |    8 ++--
 loaders/c/peas-plugin-loader-c.c                   |    4 +-
 loaders/python/peas-extension-python.h             |   11 ++--
 loaders/python/peas-plugin-loader-python.c         |    5 +-
 loaders/python/peas-plugin-loader-python.h         |    6 +-
 loaders/seed/peas-extension-seed.h                 |   10 ++--
 loaders/seed/peas-plugin-loader-seed.c             |    2 +-
 loaders/seed/peas-plugin-loader-seed.h             |    4 +-
 peas-demo/peas-demo-window.c                       |    2 +-
 peas-demo/peas-demo.c                              |    3 +-
 .../helloworld/peasdemo-hello-world-plugin.c       |    6 +-
 31 files changed, 148 insertions(+), 145 deletions(-)
---
diff --git a/libpeas/peas-activatable.c b/libpeas/peas-activatable.c
index e66104a..1df309d 100644
--- a/libpeas/peas-activatable.c
+++ b/libpeas/peas-activatable.c
@@ -94,8 +94,8 @@ peas_activatable_deactivate (PeasActivatable *activatable,
  * @activatable: A #PeasActivatable.
  * @object: A #GObject.
  *
- * Triggers an update of the plugin insternal state to take into account
- * state changes in the targetted object, due to a plugin or an user action.
+ * Triggers an update of the plugin's internal state to take into account
+ * state changes in the targetted object, due to a plugin or user action.
  */
 void
 peas_activatable_update_state (PeasActivatable *activatable,
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index 155d4b0..b47a063 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -82,9 +82,9 @@ struct _PeasEnginePrivate {
 };
 
 static void peas_engine_load_plugin_real   (PeasEngine     *engine,
-                                            PeasPluginInfo * info);
-static void peas_engine_unload_plugin_real (PeasEngine     * engine,
-                                            PeasPluginInfo * info);
+                                            PeasPluginInfo *info);
+static void peas_engine_unload_plugin_real (PeasEngine     *engine,
+                                            PeasPluginInfo *info);
 
 static void
 load_plugin_info (PeasEngine  *engine,
@@ -117,7 +117,7 @@ load_dir_real (PeasEngine  *engine,
                const gchar *extension,
                const gchar *module_dir,
                const gchar *data_dir,
-               unsigned int recursions)
+               guint        recursions)
 {
   GError *error = NULL;
   GDir *d;
@@ -202,10 +202,10 @@ hash_lowercase (gconstpointer data)
 }
 
 static gboolean
-equal_lowercase (gconstpointer a,
-                 gconstpointer b)
+equal_lowercase (const gchar *a,
+                 const gchar *b)
 {
-  return g_ascii_strcasecmp ((const gchar *) a, (const gchar *) b) == 0;
+  return g_ascii_strcasecmp (a, b) == 0;
 }
 
 static void
@@ -253,7 +253,7 @@ peas_engine_init (PeasEngine *engine)
 
   /* mapping from loadername -> loader object */
   engine->priv->loaders = g_hash_table_new_full (hash_lowercase,
-                                                 equal_lowercase,
+                                                 (GEqualFunc) equal_lowercase,
                                                  (GDestroyNotify) g_free,
                                                  (GDestroyNotify) loader_destroy);
 }
@@ -315,9 +315,9 @@ peas_engine_set_property (GObject      *object,
 }
 
 static void
-peas_engine_get_property (GObject   *object,
-                          guint      prop_id,
-                          GValue    *value,
+peas_engine_get_property (GObject    *object,
+                          guint       prop_id,
+                          GValue     *value,
                           GParamSpec *pspec)
 {
   PeasEngine *engine = PEAS_ENGINE (object);
@@ -380,6 +380,7 @@ peas_engine_class_init (PeasEngineClass *klass)
   object_class->get_property = peas_engine_get_property;
   object_class->constructed = peas_engine_constructed;
   object_class->finalize = peas_engine_finalize;
+
   klass->load_plugin = peas_engine_load_plugin_real;
   klass->unload_plugin = peas_engine_unload_plugin_real;
 
@@ -393,7 +394,8 @@ peas_engine_class_init (PeasEngineClass *klass)
    * the .gedit-plugin extension, and the engine will look for a
    * "Gedit Plugin" section in it to load the plugin data.
    */
-  g_object_class_install_property (object_class, PROP_APP_NAME,
+  g_object_class_install_property (object_class,
+                                   PROP_APP_NAME,
                                    g_param_spec_string ("app-name",
                                                         "Application Name",
                                                         "The application name",
@@ -411,7 +413,8 @@ peas_engine_class_init (PeasEngineClass *klass)
    * the base module directory. For instance, the python loader will
    * look for python modules in "${base-module-dir}/python/".
    */
-  g_object_class_install_property (object_class, PROP_BASE_MODULE_DIR,
+  g_object_class_install_property (object_class,
+                                   PROP_BASE_MODULE_DIR,
                                    g_param_spec_string ("base-module-dir",
                                                         "Base module dir",
                                                         "The base application dir for binding modules lookup",
@@ -452,7 +455,8 @@ peas_engine_class_init (PeasEngineClass *klass)
    * };
    * ]|
    */
-  g_object_class_install_property (object_class, PROP_SEARCH_PATHS,
+  g_object_class_install_property (object_class,
+                                   PROP_SEARCH_PATHS,
                                    g_param_spec_boxed ("search-paths",
                                                        "Search paths",
                                                        "The list of paths where to look for plugins",
@@ -552,7 +556,7 @@ load_plugin_loader (PeasEngine  *engine,
     }
   else
     {
-      g_warning ("Plugin loader module `%s' could not be loaded",
+      g_warning ("Plugin loader module '%s' could not be loaded",
                  loader_id);
       g_object_unref (module);
       module = NULL;
@@ -673,7 +677,7 @@ load_plugin (PeasEngine     *engine,
 
   if (loader == NULL)
     {
-      g_warning ("Could not find loader `%s' for plugin `%s'",
+      g_warning ("Could not find loader '%s' for plugin '%s'",
                  info->loader, info->name);
       info->available = FALSE;
       return FALSE;
@@ -767,9 +771,9 @@ peas_engine_unload_plugin (PeasEngine     *engine,
 }
 
 gboolean
-peas_engine_provides_extension (PeasEngine *engine,
+peas_engine_provides_extension (PeasEngine     *engine,
                                 PeasPluginInfo *info,
-                                GType extension_type)
+                                GType           extension_type)
 {
   PeasPluginLoader *loader;
 
@@ -784,9 +788,9 @@ peas_engine_provides_extension (PeasEngine *engine,
 }
 
 PeasExtension *
-peas_engine_get_extension (PeasEngine *engine,
+peas_engine_get_extension (PeasEngine     *engine,
                            PeasPluginInfo *info,
-                           GType extension_type)
+                           GType           extension_type)
 {
   PeasPluginLoader *loader;
 
@@ -842,7 +846,7 @@ string_in_strv (const gchar  *needle,
 /**
  * peas_engine_set_loaded_plugins:
  * @engine: A #PeasEngine.
- * @plugin_names: A NULL-terminated array of plugin names.
+ * @plugin_names: A %NULL-terminated array of plugin names.
  *
  * Sets the list of loaded plugins for @engine. When this function is called,
  * the #PeasEngine will load all the plugins whose names are in @plugin_names,
@@ -878,7 +882,7 @@ peas_engine_set_loaded_plugins (PeasEngine   *engine,
 
 /**
  * peas_engine_new:
- * @app_name: The name of the app
+ * @app_name: (allow-none): The name of the application
  * @base_module_dir: The base directory for language modules
  * @search_paths: The paths where to look for plugins
  *
@@ -892,6 +896,9 @@ peas_engine_new (const gchar  *app_name,
                  const gchar  *base_module_dir,
                  const gchar **search_paths)
 {
+  g_return_val_if_fail (base_module_dir != NULL, NULL);
+  g_return_val_if_fail (search_paths != NULL, NULL);
+
   return PEAS_ENGINE (g_object_new (PEAS_TYPE_ENGINE,
                                     "app-name", app_name,
                                     "base-module-dir", base_module_dir,
diff --git a/libpeas/peas-engine.h b/libpeas/peas-engine.h
index 440fb09..f1e80f8 100644
--- a/libpeas/peas-engine.h
+++ b/libpeas/peas-engine.h
@@ -37,13 +37,12 @@ G_BEGIN_DECLS
 
 /**
  * PeasEngine:
- * @parent: the parent object.
  *
  * Engine at the heart of the Peas plugin system.
  */
-typedef struct _PeasEngine        PeasEngine;
-typedef struct _PeasEngineClass   PeasEngineClass;
-typedef struct _PeasEnginePrivate PeasEnginePrivate;
+typedef struct _PeasEngine         PeasEngine;
+typedef struct _PeasEngineClass    PeasEngineClass;
+typedef struct _PeasEnginePrivate  PeasEnginePrivate;
 
 struct _PeasEngine {
   GObject parent;
diff --git a/libpeas/peas-extension-base.c b/libpeas/peas-extension-base.c
index 155b762..88c58b4 100644
--- a/libpeas/peas-extension-base.c
+++ b/libpeas/peas-extension-base.c
@@ -121,8 +121,8 @@ peas_extension_base_class_init (PeasExtensionBaseClass *klass)
   g_object_class_install_property (object_class,
                                    PROP_PLUGIN_INFO,
                                    g_param_spec_boxed ("plugin-info",
-                                                       "ExtensionBase Information",
-                                                       "Information relative to the current plugin",
+                                                       "Plugin Information",
+                                                       "Information related to the current plugin",
                                                        PEAS_TYPE_PLUGIN_INFO,
                                                        G_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT_ONLY |
diff --git a/libpeas/peas-extension-base.h b/libpeas/peas-extension-base.h
index 6e97e7d..e06b951 100644
--- a/libpeas/peas-extension-base.h
+++ b/libpeas/peas-extension-base.h
@@ -43,15 +43,15 @@ G_BEGIN_DECLS
 
 /**
  * PeasExtensionBase:
- * @parent: the parent object.
  *
  * Base class for C extensions.
  */
-typedef struct _PeasExtensionBase        PeasExtensionBase;
-typedef struct _PeasExtensionBaseClass   PeasExtensionBaseClass;
+typedef struct _PeasExtensionBase       PeasExtensionBase;
+typedef struct _PeasExtensionBaseClass  PeasExtensionBaseClass;
 
 struct _PeasExtensionBase {
   GObject parent;
+
   PeasPluginInfo *plugin_info;
 };
 
diff --git a/libpeas/peas-extension-set.c b/libpeas/peas-extension-set.c
index 8698877..9d8a783 100644
--- a/libpeas/peas-extension-set.c
+++ b/libpeas/peas-extension-set.c
@@ -241,7 +241,7 @@ peas_extension_set_class_init (PeasExtensionSetClass *klass)
  *
  * Call a method on all the #PeasExtension instances contained in @set.
  *
- * Return value: #TRUE on successful call.
+ * Return value: %TRUE on successful call.
  */
 gboolean
 peas_extension_set_call (PeasExtensionSet *set,
@@ -266,7 +266,7 @@ peas_extension_set_call (PeasExtensionSet *set,
  *
  * Call a method on all the #PeasExtension instances contained in @set.
  *
- * Return value: #TRUE on successful call.
+ * Return value: %TRUE on successful call.
  */
 gboolean
 peas_extension_set_call_valist (PeasExtensionSet *set,
@@ -285,7 +285,7 @@ peas_extension_set_call_valist (PeasExtensionSet *set,
 /**
  * peas_extension_set_new:
  * @engine: A #PeasEngine.
- * @exten_type: the extension #GType
+ * @exten_type: the extension #GType.
  *
  * Create an #ExtensionSet for all the @exten_type extensions defined in
  * the plugins loaded in @engine.
diff --git a/libpeas/peas-extension-set.h b/libpeas/peas-extension-set.h
index dee226a..4aa78c0 100644
--- a/libpeas/peas-extension-set.h
+++ b/libpeas/peas-extension-set.h
@@ -37,12 +37,13 @@ G_BEGIN_DECLS
 #define PEAS_IS_EXTENSION_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PEAS_TYPE_EXTENSION_SET))
 #define PEAS_EXTENSION_SET_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), PEAS_TYPE_EXTENSION_SET, PeasExtensionSetClass))
 
-typedef struct _PeasExtensionSet        PeasExtensionSet;
-typedef struct _PeasExtensionSetClass   PeasExtensionSetClass;
-typedef struct _PeasExtensionSetPrivate PeasExtensionSetPrivate;
+typedef struct _PeasExtensionSet         PeasExtensionSet;
+typedef struct _PeasExtensionSetClass    PeasExtensionSetClass;
+typedef struct _PeasExtensionSetPrivate  PeasExtensionSetPrivate;
 
 struct _PeasExtensionSet {
   GObject parent;
+
   PeasExtensionSetPrivate *priv;
 };
 
@@ -55,12 +56,12 @@ struct _PeasExtensionSetClass {
                                            va_list           args);
 
   /* Signals */
-  void (*extension_added) (PeasExtensionSet *set,
-                           PeasPluginInfo *info,
-                           PeasExtension *exten);
-  void (*extension_removed) (PeasExtensionSet *set,
-                             PeasPluginInfo *info,
-                             PeasExtension *exten);
+  void       (*extension_added)           (PeasExtensionSet *set,
+                                           PeasPluginInfo   *info,
+                                           PeasExtension    *exten);
+  void       (*extension_removed)         (PeasExtensionSet *set,
+                                           PeasPluginInfo   *info,
+                                           PeasExtension    *exten);
 };
 
 /*
@@ -75,8 +76,8 @@ gboolean           peas_extension_set_call_valist (PeasExtensionSet *set,
                                                    const gchar      *method_name,
                                                    va_list           args);
 
-PeasExtensionSet  *peas_extension_set_new         (PeasEngine *engine,
-                                                   GType       exten_type);
+PeasExtensionSet  *peas_extension_set_new         (PeasEngine       *engine,
+                                                   GType             exten_type);
 
 G_END_DECLS
 
diff --git a/libpeas/peas-extension.c b/libpeas/peas-extension.c
index efe05c4..9734c2b 100644
--- a/libpeas/peas-extension.c
+++ b/libpeas/peas-extension.c
@@ -55,7 +55,7 @@ peas_extension_class_init (PeasExtensionClass *klass)
  *
  * Call a method of the object behind @extension.
  *
- * Return value: #TRUE on successful call.
+ * Return value: %TRUE on successful call.
  */
 gboolean
 peas_extension_call (PeasExtension *exten,
@@ -80,12 +80,12 @@ peas_extension_call (PeasExtension *exten,
  *
  * Call a method of the object behind @extension, using @args as arguments.
  *
- * Return value: #TRUE on successful call.
+ * Return value: %TRUE on successful call.
  */
 gboolean
 peas_extension_call_valist (PeasExtension *exten,
                             const gchar   *method_name,
-                            va_list args)
+                            va_list        args)
 {
   PeasExtensionClass *klass;
 
diff --git a/libpeas/peas-extension.h b/libpeas/peas-extension.h
index 4c5dc3b..cec650d 100644
--- a/libpeas/peas-extension.h
+++ b/libpeas/peas-extension.h
@@ -42,8 +42,8 @@ G_BEGIN_DECLS
  *
  * Base class for plugins.
  */
-typedef struct _PeasExtension        PeasExtension;
-typedef struct _PeasExtensionClass   PeasExtensionClass;
+typedef struct _PeasExtension       PeasExtension;
+typedef struct _PeasExtensionClass  PeasExtensionClass;
 
 struct _PeasExtension {
   GObject parent;
diff --git a/libpeas/peas-introspection.c b/libpeas/peas-introspection.c
index 4266e9a..6517004 100644
--- a/libpeas/peas-introspection.c
+++ b/libpeas/peas-introspection.c
@@ -24,11 +24,10 @@
 #endif
 
 #include "peas-introspection.h"
-#include <girepository.h>
 
 static void
-read_next_argument (GArgument *cur_arg,
-                    va_list args,
+read_next_argument (GArgument  *cur_arg,
+                    va_list     args,
                     GITypeInfo *arg_type_info)
 {
   /* Notes: According to GCC 4.4,
@@ -121,6 +120,8 @@ read_next_argument (GArgument *cur_arg,
     case GI_TYPE_TAG_ERROR:
       cur_arg->v_pointer = va_arg (args, gpointer);
       break;
+    default:
+      g_return_if_reached ();
     }
 }
 
diff --git a/libpeas/peas-introspection.h b/libpeas/peas-introspection.h
index 46f121c..0c373f4 100644
--- a/libpeas/peas-introspection.h
+++ b/libpeas/peas-introspection.h
@@ -27,11 +27,10 @@
 
 G_BEGIN_DECLS
 
-GICallableInfo 
-            *peas_method_get_info                 (GType        iface_type,
+GICallableInfo  *peas_method_get_info             (GType        iface_type,
                                                    const gchar *method_name);
 
-gboolean     peas_method_apply_valist             (GObject     *instance,
+gboolean        peas_method_apply_valist          (GObject     *instance,
                                                    GType        iface_type,
                                                    const gchar *method_name,
                                                    va_list      args);
diff --git a/libpeas/peas-object-module.c b/libpeas/peas-object-module.c
index 6d54f06..c6aaaf8 100644
--- a/libpeas/peas-object-module.c
+++ b/libpeas/peas-object-module.c
@@ -187,7 +187,8 @@ peas_object_module_get_property (GObject    *object,
       g_value_set_boolean (value, module->priv->resident);
       break;
     default:
-      g_return_if_reached ();
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
     }
 }
 
@@ -213,7 +214,8 @@ peas_object_module_set_property (GObject      *object,
       module->priv->resident = g_value_get_boolean (value);
       break;
     default:
-      g_return_if_reached ();
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
     }
 }
 
@@ -265,11 +267,11 @@ peas_object_module_new (const gchar *module_name,
                         const gchar *path,
                         gboolean     resident)
 {
-  return (PeasObjectModule *) g_object_new (PEAS_TYPE_OBJECT_MODULE,
-                                            "module-name", module_name,
-                                            "path", path,
-                                            "resident", resident,
-                                            NULL);
+  return PEAS_OBJECT_MODULE (g_object_new (PEAS_TYPE_OBJECT_MODULE,
+                                           "module-name", module_name,
+                                           "path", path,
+                                           "resident", resident,
+                                           NULL));
 }
 
 void
@@ -402,7 +404,7 @@ create_gobject_from_type (guint       n_parameters,
       g_object_class_find_property (cls, "plugin-info") != NULL)
     n_parameters --;
 
-  instance = g_object_newv (exten_type, n_parameters, parameters);
+  instance = G_OBJECT (g_object_newv (exten_type, n_parameters, parameters));
 
   g_type_class_unref (cls);
 
diff --git a/libpeas/peas-object-module.h b/libpeas/peas-object-module.h
index fc400de..945cea1 100644
--- a/libpeas/peas-object-module.h
+++ b/libpeas/peas-object-module.h
@@ -37,9 +37,9 @@ G_BEGIN_DECLS
 #define PEAS_IS_OBJECT_MODULE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), PEAS_TYPE_OBJECT_MODULE))
 #define PEAS_OBJECT_MODULE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), PEAS_TYPE_OBJECT_MODULE, PeasObjectModuleClass))
 
-typedef struct _PeasObjectModule        PeasObjectModule;
-typedef struct _PeasObjectModuleClass   PeasObjectModuleClass;
-typedef struct _PeasObjectModulePrivate PeasObjectModulePrivate;
+typedef struct _PeasObjectModule         PeasObjectModule;
+typedef struct _PeasObjectModuleClass    PeasObjectModuleClass;
+typedef struct _PeasObjectModulePrivate  PeasObjectModulePrivate;
 
 typedef GObject *(*PeasFactoryFunc)   (guint          n_parameters,
                                        GParameter    *parameters,
diff --git a/libpeas/peas-plugin-info.c b/libpeas/peas-plugin-info.c
index a221a31..f47deae 100644
--- a/libpeas/peas-plugin-info.c
+++ b/libpeas/peas-plugin-info.c
@@ -69,7 +69,7 @@ _peas_plugin_info_unref (PeasPluginInfo *info)
   g_free (info);
 }
 
-/**
+/*
  * peas_plugin_info_get_type:
  *
  * Retrieves the #GType object which is associated with the #PeasPluginInfo
@@ -83,7 +83,7 @@ peas_plugin_info_get_type (void)
   static GType the_type = 0;
 
   if (G_UNLIKELY (!the_type))
-    the_type = g_boxed_type_register_static ("PeasPluginInfo",
+    the_type = g_boxed_type_register_static (g_intern_static_string ("PeasPluginInfo"),
                                              (GBoxedCopyFunc) _peas_plugin_info_ref,
                                              (GBoxedFreeFunc) _peas_plugin_info_unref);
 
@@ -91,10 +91,8 @@ peas_plugin_info_get_type (void)
 }
 
 static void
-value_free (gpointer data)
+value_free (GValue *value)
 {
-  GValue *value = (GValue *) data;
-
   g_value_unset (value);
   g_free (value);
 }
@@ -157,13 +155,13 @@ parse_extra_keys (PeasPluginInfo   *info,
           info->keys = g_hash_table_new_full (g_str_hash,
                                               g_str_equal,
                                               g_free,
-                                              value_free);
+                                              (GDestroyNotify) value_free);
         }
       g_hash_table_insert (info->keys, g_strdup (keys[i]), value);
     }
 }
 
-/**
+/*
  * _peas_plugin_info_new:
  * @filename: The filename where to read the plugin information.
  * @app_name: The application name.
@@ -185,7 +183,7 @@ _peas_plugin_info_new (const gchar *filename,
   gchar *section_header;
   gchar *str;
   gchar **keys;
-  int integer;
+  gint integer;
 
   g_return_val_if_fail (filename != NULL, NULL);
   g_return_val_if_fail (app_name != NULL, NULL);
@@ -240,7 +238,7 @@ _peas_plugin_info_new (const gchar *filename,
   else
     {
       /* default to the C loader */
-      info->loader = g_strdup ("c");
+      info->loader = g_strdup ("C");
     }
 
   /* Get Name */
@@ -290,7 +288,7 @@ _peas_plugin_info_new (const gchar *filename,
 
   /* Get extra keys */
   keys = g_key_file_get_keys (plugin_file, section_header, NULL, NULL);
-  parse_extra_keys (info, plugin_file, section_header, (const char **) keys);
+  parse_extra_keys (info, plugin_file, section_header, (const gchar **) keys);
   g_strfreev (keys);
 
   g_free (section_header);
diff --git a/libpeas/peas-plugin-info.h b/libpeas/peas-plugin-info.h
index 6074bde..8279ff6 100644
--- a/libpeas/peas-plugin-info.h
+++ b/libpeas/peas-plugin-info.h
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
 /**
  * PeasPluginInfo:
  *
- * Boxed type for the information relative to a plugin.
+ * Boxed type for the information related to a plugin.
  */
 typedef struct _PeasPluginInfo PeasPluginInfo;
 
diff --git a/libpeasui/peas-ui-configurable.c b/libpeasui/peas-ui-configurable.c
index 2a84bc0..f781219 100644
--- a/libpeasui/peas-ui-configurable.c
+++ b/libpeasui/peas-ui-configurable.c
@@ -80,7 +80,7 @@ peas_ui_configurable_is_configurable (PeasUIConfigurable *configurable)
 /**
  * peas_ui_configurable_create_configure_dialog:
  * @configurable: A #PeasUIConfigurable
- * @conf_dlg: (out) A #GtkWindow used for configuration
+ * @conf_dlg: (out): A #GtkWindow used for configuration
  *
  * Creates the configure dialog widget for the plugin.
  *
@@ -89,8 +89,8 @@ peas_ui_configurable_is_configurable (PeasUIConfigurable *configurable)
  * Returns: %TRUE on success.
  */
 gboolean
-peas_ui_configurable_create_configure_dialog (PeasUIConfigurable *configurable,
-                                              GtkWidget         **conf_dlg)
+peas_ui_configurable_create_configure_dialog (PeasUIConfigurable  *configurable,
+                                              GtkWidget          **conf_dlg)
 {
   PeasUIConfigurableInterface *iface;
 
diff --git a/libpeasui/peas-ui-configurable.h b/libpeasui/peas-ui-configurable.h
index 8a8821b..40cb7ad 100644
--- a/libpeasui/peas-ui-configurable.h
+++ b/libpeasui/peas-ui-configurable.h
@@ -35,25 +35,25 @@ G_BEGIN_DECLS
 #define PEAS_UI_IS_CONFIGURABLE(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PEAS_UI_TYPE_CONFIGURABLE))
 #define PEAS_UI_CONFIGURABLE_GET_IFACE(obj)    (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PEAS_UI_TYPE_CONFIGURABLE, PeasUIConfigurableInterface))
 
-typedef struct _PeasUIConfigurable          PeasUIConfigurable; /* dummy typedef */
-typedef struct _PeasUIConfigurableInterface     PeasUIConfigurableInterface;
+typedef struct _PeasUIConfigurable           PeasUIConfigurable; /* dummy typedef */
+typedef struct _PeasUIConfigurableInterface  PeasUIConfigurableInterface;
 
 struct _PeasUIConfigurableInterface
 {
   GTypeInterface g_iface;
 
-  gboolean    (*create_configure_dialog)  (PeasUIConfigurable *configurable,
-                                           GtkWidget         **conf_dlg);
+  gboolean    (*create_configure_dialog)  (PeasUIConfigurable  *configurable,
+                                           GtkWidget          **conf_dlg);
 
   /* Plugins should usually not override this, it's handled automatically
    * by the PeasPluginClass */
-  gboolean    (*is_configurable)          (PeasUIConfigurable *configurable);
+  gboolean    (*is_configurable)          (PeasUIConfigurable  *configurable);
 };
 
 GType       peas_ui_configurable_get_type                (void);
-gboolean    peas_ui_configurable_is_configurable         (PeasUIConfigurable *configurable);
-gboolean    peas_ui_configurable_create_configure_dialog (PeasUIConfigurable *configurable,
-                                                          GtkWidget         **conf_dlg);
+gboolean    peas_ui_configurable_is_configurable         (PeasUIConfigurable  *configurable);
+gboolean    peas_ui_configurable_create_configure_dialog (PeasUIConfigurable  *configurable,
+                                                          GtkWidget          **conf_dlg);
 
 G_END_DECLS
 
diff --git a/libpeasui/peas-ui-plugin-info.c b/libpeasui/peas-ui-plugin-info.c
index 66ce2bf..4743021 100644
--- a/libpeasui/peas-ui-plugin-info.c
+++ b/libpeasui/peas-ui-plugin-info.c
@@ -25,6 +25,8 @@
 
 #include <libpeas/peas-plugin-info-priv.h>
 
+#include <gtk/gtk.h>
+
 #include "peas-ui-plugin-info.h"
 #include "peas-ui-configurable.h"
 
diff --git a/libpeasui/peas-ui-plugin-info.h b/libpeasui/peas-ui-plugin-info.h
index edac295..84655b1 100644
--- a/libpeasui/peas-ui-plugin-info.h
+++ b/libpeasui/peas-ui-plugin-info.h
@@ -22,7 +22,6 @@
 #ifndef __PEAS_UI_PLUGIN_INFO_H__
 #define __PEAS_UI_PLUGIN_INFO_H__
 
-#include <gtk/gtk.h>
 #include <libpeas/peas-plugin-info.h>
 
 G_BEGIN_DECLS
diff --git a/libpeasui/peas-ui-plugin-manager.c b/libpeasui/peas-ui-plugin-manager.c
index 4760ae4..50a9c6a 100644
--- a/libpeasui/peas-ui-plugin-manager.c
+++ b/libpeasui/peas-ui-plugin-manager.c
@@ -161,22 +161,21 @@ about_button_cb (GtkWidget           *button,
   PeasPluginInfo *info;
 
   info = plugin_manager_get_selected_plugin (pm);
-
   g_return_if_fail (info != NULL);
 
   /* if there is another about dialog already open destroy it */
   if (pm->priv->about)
     gtk_widget_destroy (pm->priv->about);
 
-  pm->priv->about = g_object_new (GTK_TYPE_ABOUT_DIALOG,
-                                  "program-name", peas_plugin_info_get_name (info),
-                                  "copyright", peas_plugin_info_get_copyright (info),
-                                  "authors", peas_plugin_info_get_authors (info),
-                                  "comments", peas_plugin_info_get_description (info),
-                                  "website", peas_plugin_info_get_website (info),
-                                  "logo-icon-name", peas_ui_plugin_info_get_icon_name (info),
-                                  "version", peas_plugin_info_get_version (info),
-                                  NULL);
+  pm->priv->about = GTK_WIDGET (g_object_new (GTK_TYPE_ABOUT_DIALOG,
+                                              "program-name", peas_plugin_info_get_name (info),
+                                              "copyright", peas_plugin_info_get_copyright (info),
+                                              "authors", peas_plugin_info_get_authors (info),
+                                              "comments", peas_plugin_info_get_description (info),
+                                              "website", peas_plugin_info_get_website (info),
+                                              "logo-icon-name", peas_ui_plugin_info_get_icon_name (info),
+                                              "version", peas_plugin_info_get_version (info),
+                                              NULL));
 
   gtk_window_set_destroy_with_parent (GTK_WINDOW (pm->priv->about), TRUE);
 
@@ -334,11 +333,9 @@ row_activated_cb (GtkTreeView         *tree_view,
   GtkTreeModel *model;
 
   model = gtk_tree_view_get_model (GTK_TREE_VIEW (pm->priv->tree));
-
   g_return_if_fail (model != NULL);
 
   gtk_tree_model_get_iter (model, &iter, path);
-
   g_return_if_fail (&iter != NULL);
 
   plugin_manager_toggle_active (pm, &iter, model);
@@ -378,8 +375,7 @@ plugin_manager_populate_lists (PeasUIPluginManager *pm)
       GtkTreeSelection *selection;
       PeasPluginInfo *info;
 
-      selection =
-        gtk_tree_view_get_selection (GTK_TREE_VIEW (pm->priv->tree));
+      selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (pm->priv->tree));
       g_return_if_fail (selection != NULL);
 
       gtk_tree_selection_select_iter (selection, &iter);
@@ -402,7 +398,6 @@ plugin_manager_set_active (PeasUIPluginManager *pm,
   gboolean res = TRUE;
 
   gtk_tree_model_get (model, iter, INFO_COLUMN, &info, -1);
-
   g_return_val_if_fail (info != NULL, FALSE);
 
   if (active)
@@ -466,10 +461,10 @@ plugin_manager_set_active_all (PeasUIPluginManager *pm,
   GtkTreeIter iter;
 
   model = gtk_tree_view_get_model (GTK_TREE_VIEW (pm->priv->tree));
-
   g_return_if_fail (model != NULL);
 
-  gtk_tree_model_get_iter_first (model, &iter);
+  if (!gtk_tree_model_get_iter_first (model, &iter))
+    return;
 
   do
     plugin_manager_set_active (pm, &iter, model, active);
@@ -842,10 +837,8 @@ plugin_toggled_cb (PeasEngine          *engine,
       info_found = info == tinfo;
     }
 
-  if (!info_found)
+  if (!info_found && gtk_tree_model_get_iter_first (model, &iter))
     {
-      gtk_tree_model_get_iter_first (model, &iter);
-
       do
         {
           PeasPluginInfo *tinfo;
@@ -899,7 +892,7 @@ peas_ui_plugin_manager_init (PeasUIPluginManager *pm)
   hbuttonbox = gtk_hbutton_box_new ();
   gtk_box_pack_start (GTK_BOX (pm), hbuttonbox, FALSE, FALSE, 0);
   gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox), GTK_BUTTONBOX_END);
-  gtk_box_set_spacing (GTK_BOX (hbuttonbox), 8);
+  gtk_box_set_spacing (GTK_BOX (hbuttonbox), 8); /* should use the default or HIG */
 
   pm->priv->about_button = gtk_button_new_from_stock (GTK_STOCK_ABOUT);
   gtk_container_add (GTK_CONTAINER (hbuttonbox), pm->priv->about_button);
@@ -941,7 +934,6 @@ peas_ui_plugin_manager_constructed (GObject *object)
       gtk_widget_set_sensitive (pm->priv->about_button, FALSE);
       gtk_widget_set_sensitive (pm->priv->configure_button, FALSE);
     }
-
 }
 
 static void
@@ -966,11 +958,13 @@ peas_ui_plugin_manager_finalize (GObject *object)
  *
  * Creates a new plugin manager for the given #PeasEngine.
  *
- * Returns: the new #PeasUIPluginManager
+ * Returns: the new #PeasUIPluginManager.
  */
 GtkWidget *
 peas_ui_plugin_manager_new (PeasEngine *engine)
 {
+  g_return_val_if_fail (PEAS_IS_ENGINE (engine), NULL);
+
   return GTK_WIDGET (g_object_new (PEAS_UI_TYPE_PLUGIN_MANAGER,
                                    "engine", engine,
                                    NULL));
diff --git a/loaders/c/peas-extension-c.h b/loaders/c/peas-extension-c.h
index f11081e..59d3582 100644
--- a/loaders/c/peas-extension-c.h
+++ b/loaders/c/peas-extension-c.h
@@ -33,8 +33,8 @@ G_BEGIN_DECLS
 #define PEAS_IS_EXTENSION_C_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PEAS_TYPE_EXTENSION_C))
 #define PEAS_EXTENSION_C_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), PEAS_TYPE_EXTENSION_C, PeasExtensionCClass))
 
-typedef struct _PeasExtensionC         PeasExtensionC;
-typedef struct _PeasExtensionCClass    PeasExtensionCClass;
+typedef struct _PeasExtensionC       PeasExtensionC;
+typedef struct _PeasExtensionCClass  PeasExtensionCClass;
 
 struct _PeasExtensionC {
   PeasExtension parent;
@@ -50,8 +50,8 @@ struct _PeasExtensionCClass {
 GType            peas_extension_c_get_type  (void) G_GNUC_CONST;
 void             peas_extension_c_register  (GTypeModule *module);
 
-PeasExtension   *peas_extension_c_new       (GType    gtype,
-                                             GObject *instance);
+PeasExtension   *peas_extension_c_new       (GType        gtype,
+                                             GObject     *instance);
 
 G_END_DECLS
 
diff --git a/loaders/c/peas-plugin-loader-c.c b/loaders/c/peas-plugin-loader-c.c
index 75246b3..08551d8 100644
--- a/loaders/c/peas-plugin-loader-c.c
+++ b/loaders/c/peas-plugin-loader-c.c
@@ -55,7 +55,7 @@ peas_plugin_loader_c_add_module_directory (PeasPluginLoader *loader,
 }
 
 static gboolean
-peas_plugin_loader_c_load (PeasPluginLoader * loader,
+peas_plugin_loader_c_load (PeasPluginLoader *loader,
                            PeasPluginInfo   *info)
 {
   PeasPluginLoaderC *cloader = PEAS_PLUGIN_LOADER_C (loader);
@@ -217,6 +217,6 @@ peas_plugin_loader_c_class_init (PeasPluginLoaderCClass *klass)
 }
 
 static void
-peas_plugin_loader_c_class_finalize (PeasPluginLoaderCClass * klass)
+peas_plugin_loader_c_class_finalize (PeasPluginLoaderCClass *klass)
 {
 }
diff --git a/loaders/python/peas-extension-python.h b/loaders/python/peas-extension-python.h
index a20f298..21e3006 100644
--- a/loaders/python/peas-extension-python.h
+++ b/loaders/python/peas-extension-python.h
@@ -38,13 +38,14 @@ G_BEGIN_DECLS
 #define PEAS_IS_EXTENSION_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PEAS_TYPE_EXTENSION_PYTHON))
 #define PEAS_EXTENSION_PYTHON_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), PEAS_TYPE_EXTENSION_PYTHON, PeasExtensionPythonClass))
 
-typedef struct _PeasExtensionPython         PeasExtensionPython;
-typedef struct _PeasExtensionPythonClass    PeasExtensionPythonClass;
+typedef struct _PeasExtensionPython       PeasExtensionPython;
+typedef struct _PeasExtensionPythonClass  PeasExtensionPythonClass;
 
 struct _PeasExtensionPython {
   PeasExtension parent;
 
-  GType gtype;
+  /* maybe add this to PeasExtension? */
+  GType     gtype;
   PyObject *instance;
 };
 
@@ -55,8 +56,8 @@ struct _PeasExtensionPythonClass {
 GType            peas_extension_python_get_type (void) G_GNUC_CONST;
 void             peas_extension_python_register (GTypeModule *module);
 
-PeasExtension   *peas_extension_python_new      (GType     gtype,
-                                                 PyObject *instance);
+PeasExtension   *peas_extension_python_new      (GType        gtype,
+                                                 PyObject    *instance);
 
 G_END_DECLS
 
diff --git a/loaders/python/peas-plugin-loader-python.c b/loaders/python/peas-plugin-loader-python.c
index 89a7beb..5d9258d 100644
--- a/loaders/python/peas-plugin-loader-python.c
+++ b/loaders/python/peas-plugin-loader-python.c
@@ -451,7 +451,7 @@ peas_python_init (PeasPluginLoaderPython *loader)
 
   prgname = g_get_prgname ();
   if (prgname != NULL)
-      argv[0] = prgname;
+    argv[0] = prgname;
 
   PySys_SetArgv (1, argv);
 
@@ -587,8 +587,7 @@ peas_plugin_loader_python_class_init (PeasPluginLoaderPythonClass *klass)
   loader_class->provides_extension = peas_plugin_loader_python_provides_extension;
   loader_class->garbage_collect = peas_plugin_loader_python_garbage_collect;
 
-  g_type_class_add_private (object_class,
-                            sizeof (PeasPluginLoaderPythonPrivate));
+  g_type_class_add_private (object_class, sizeof (PeasPluginLoaderPythonPrivate));
 }
 
 static void
diff --git a/loaders/python/peas-plugin-loader-python.h b/loaders/python/peas-plugin-loader-python.h
index e9990d2..70b82dd 100644
--- a/loaders/python/peas-plugin-loader-python.h
+++ b/loaders/python/peas-plugin-loader-python.h
@@ -36,9 +36,9 @@ G_BEGIN_DECLS
 #define PEAS_IS_PLUGIN_LOADER_PYTHON_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), PEAS_TYPE_PLUGIN_LOADER_PYTHON))
 #define PEAS_PLUGIN_LOADER_PYTHON_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), PEAS_TYPE_PLUGIN_LOADER_PYTHON, PeasPluginLoaderPythonClass))
 
-typedef struct _PeasPluginLoaderPython             PeasPluginLoaderPython;
-typedef struct _PeasPluginLoaderPythonClass        PeasPluginLoaderPythonClass;
-typedef struct _PeasPluginLoaderPythonPrivate      PeasPluginLoaderPythonPrivate;
+typedef struct _PeasPluginLoaderPython         PeasPluginLoaderPython;
+typedef struct _PeasPluginLoaderPythonClass    PeasPluginLoaderPythonClass;
+typedef struct _PeasPluginLoaderPythonPrivate  PeasPluginLoaderPythonPrivate;
 
 struct _PeasPluginLoaderPython {
   PeasPluginLoader parent;
diff --git a/loaders/seed/peas-extension-seed.h b/loaders/seed/peas-extension-seed.h
index a226c45..01da382 100644
--- a/loaders/seed/peas-extension-seed.h
+++ b/loaders/seed/peas-extension-seed.h
@@ -34,8 +34,8 @@ G_BEGIN_DECLS
 #define PEAS_IS_EXTENSION_SEED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PEAS_TYPE_EXTENSION_SEED))
 #define PEAS_EXTENSION_SEED_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), PEAS_TYPE_EXTENSION_SEED, PeasExtensionSeedClass))
 
-typedef struct _PeasExtensionSeed        PeasExtensionSeed;
-typedef struct _PeasExtensionSeedClass   PeasExtensionSeedClass;
+typedef struct _PeasExtensionSeed       PeasExtensionSeed;
+typedef struct _PeasExtensionSeedClass  PeasExtensionSeedClass;
 
 struct _PeasExtensionSeed {
   PeasExtension parent;
@@ -52,9 +52,9 @@ struct _PeasExtensionSeedClass {
 GType            peas_extension_seed_get_type (void) G_GNUC_CONST;
 void             peas_extension_seed_register (GTypeModule    *type_module);
 
-PeasExtension   *peas_extension_seed_new      (GType       exten_type,
-                                               SeedContext js_context,
-                                               SeedObject  js_object);
+PeasExtension   *peas_extension_seed_new      (GType           exten_type,
+                                               SeedContext     js_context,
+                                               SeedObject      js_object);
 
 G_END_DECLS
 
diff --git a/loaders/seed/peas-plugin-loader-seed.c b/loaders/seed/peas-plugin-loader-seed.c
index 3237199..0ac4cc0 100644
--- a/loaders/seed/peas-plugin-loader-seed.c
+++ b/loaders/seed/peas-plugin-loader-seed.c
@@ -114,7 +114,7 @@ peas_plugin_loader_seed_load (PeasPluginLoader *loader,
 
       if (seed_value_is_object (context, extensions))
         {
-          sinfo = g_slice_new (SeedInfo);
+          sinfo = (SeedInfo *) g_slice_new (SeedInfo);
           sinfo->context = context;
           sinfo->extensions = extensions;
           seed_context_ref (context);
diff --git a/loaders/seed/peas-plugin-loader-seed.h b/loaders/seed/peas-plugin-loader-seed.h
index 20bbc2f..b43b481 100644
--- a/loaders/seed/peas-plugin-loader-seed.h
+++ b/loaders/seed/peas-plugin-loader-seed.h
@@ -34,8 +34,8 @@ G_BEGIN_DECLS
 #define PEAS_IS_PLUGIN_LOADER_SEED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PEAS_TYPE_PLUGIN_LOADER_SEED))
 #define PEAS_PLUGIN_LOADER_SEED_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), PEAS_TYPE_PLUGIN_LOADER_SEED, PeasPluginLoaderSeedClass))
 
-typedef struct _PeasPluginLoaderSeed         PeasPluginLoaderSeed;
-typedef struct _PeasPluginLoaderSeedClass    PeasPluginLoaderSeedClass;
+typedef struct _PeasPluginLoaderSeed       PeasPluginLoaderSeed;
+typedef struct _PeasPluginLoaderSeedClass  PeasPluginLoaderSeedClass;
 
 struct _PeasPluginLoaderSeed {
   PeasPluginLoader parent;
diff --git a/peas-demo/peas-demo-window.c b/peas-demo/peas-demo-window.c
index fcdcfa2..a0d06d3 100644
--- a/peas-demo/peas-demo-window.c
+++ b/peas-demo/peas-demo-window.c
@@ -113,7 +113,7 @@ demo_window_new (PeasEngine *engine)
 {
   DemoWindow *dw;
 
-  dw = g_object_new (DEMO_TYPE_WINDOW, NULL);
+  dw = DEMO_WINDOW (g_object_new (DEMO_TYPE_WINDOW, NULL));
   demo_window_set_data (dw, engine);
 
   return GTK_WIDGET (dw);
diff --git a/peas-demo/peas-demo.c b/peas-demo/peas-demo.c
index e5dd801..58cfe17 100644
--- a/peas-demo/peas-demo.c
+++ b/peas-demo/peas-demo.c
@@ -90,7 +90,8 @@ create_main_window (void)
 }
 
 int
-main (int argc, char **argv)
+main (int    argc,
+      char **argv)
 {
   gchar const * const search_paths[] = {
     /* Uninstalled plugins */
diff --git a/peas-demo/plugins/helloworld/peasdemo-hello-world-plugin.c b/peas-demo/plugins/helloworld/peasdemo-hello-world-plugin.c
index afd3b73..fdacad5 100644
--- a/peas-demo/plugins/helloworld/peasdemo-hello-world-plugin.c
+++ b/peas-demo/plugins/helloworld/peasdemo-hello-world-plugin.c
@@ -10,7 +10,7 @@
 
 #define WINDOW_DATA_KEY "PeasDemoHelloWorldPluginWindowData"
 
-static void peas_activatable_iface_init (PeasActivatableInterface *iface);
+static void peas_activatable_iface_init     (PeasActivatableInterface    *iface);
 static void peas_ui_configurable_iface_init (PeasUIConfigurableInterface *iface);
 
 G_DEFINE_DYNAMIC_TYPE_EXTENDED (PeasDemoHelloWorldPlugin,
@@ -114,8 +114,8 @@ on_configure_dialog_response (GtkDialog *dialog,
 }
 
 static gboolean
-peasdemo_hello_world_plugin_create_configure_dialog (PeasUIConfigurable *configurable,
-                                                     GtkWidget         **dialog)
+peasdemo_hello_world_plugin_create_configure_dialog (PeasUIConfigurable  *configurable,
+                                                     GtkWidget          **dialog)
 {
   g_debug (G_STRFUNC);
 



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