[gedit/eggplugins: 2/6] [plugins] Drop the gedit_debug usage
- From: Steve Frécinaux <sfre src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit/eggplugins: 2/6] [plugins] Drop the gedit_debug usage
- Date: Fri, 9 Oct 2009 18:02:44 +0000 (UTC)
commit 8bfd573999c3a1e60a782786ace8ba4424078ce9
Author: Steve Frécinaux <code istique net>
Date: Thu Oct 8 23:40:40 2009 +0200
[plugins] Drop the gedit_debug usage
libplugins/gedit-object-module.c | 14 -----------
libplugins/gedit-plugin-info.c | 46 ++----------------------------------
libplugins/gedit-plugin.h | 1 -
libplugins/gedit-plugins-engine.c | 37 -----------------------------
4 files changed, 3 insertions(+), 95 deletions(-)
---
diff --git a/libplugins/gedit-object-module.c b/libplugins/gedit-object-module.c
index 7ae7686..40c797f 100644
--- a/libplugins/gedit-object-module.c
+++ b/libplugins/gedit-object-module.c
@@ -40,7 +40,6 @@
#include "config.h"
#include "gedit-object-module.h"
-#include <gedit/gedit-debug.h>
typedef GType (*GeditObjectModuleRegisterFunc) (GTypeModule *);
@@ -73,12 +72,8 @@ gedit_object_module_load (GTypeModule *gmodule)
GeditObjectModuleRegisterFunc register_func;
gchar *path;
- gedit_debug_message (DEBUG_PLUGINS, "Loading %s module from %s",
- module->priv->module_name, module->priv->path);
-
path = g_module_build_path (module->priv->path, module->priv->module_name);
g_return_val_if_fail (path != NULL, FALSE);
- gedit_debug_message (DEBUG_PLUGINS, "Module filename: %s", path);
module->priv->library = g_module_open (path,
G_MODULE_BIND_LAZY);
@@ -132,8 +127,6 @@ gedit_object_module_unload (GTypeModule *gmodule)
{
GeditObjectModule *module = GEDIT_OBJECT_MODULE (gmodule);
- gedit_debug_message (DEBUG_PLUGINS, "Unloading %s", module->priv->path);
-
g_module_close (module->priv->library);
module->priv->library = NULL;
@@ -143,8 +136,6 @@ gedit_object_module_unload (GTypeModule *gmodule)
static void
gedit_object_module_init (GeditObjectModule *module)
{
- gedit_debug_message (DEBUG_PLUGINS, "GeditObjectModule %p initialising", module);
-
module->priv = G_TYPE_INSTANCE_GET_PRIVATE (module,
GEDIT_TYPE_OBJECT_MODULE,
GeditObjectModulePrivate);
@@ -155,8 +146,6 @@ gedit_object_module_finalize (GObject *object)
{
GeditObjectModule *module = GEDIT_OBJECT_MODULE (object);
- gedit_debug_message (DEBUG_PLUGINS, "GeditObjectModule %p finalising", module);
-
g_free (module->priv->path);
g_free (module->priv->module_name);
g_free (module->priv->type_registration);
@@ -300,9 +289,6 @@ gedit_object_module_new_object (GeditObjectModule *module,
g_return_val_if_fail (module->priv->type != 0, NULL);
- gedit_debug_message (DEBUG_PLUGINS, "Creating object of type %s",
- g_type_name (module->priv->type));
-
va_start (var_args, first_property_name);
result = g_object_new_valist (module->priv->type, first_property_name, var_args);
va_end (var_args);
diff --git a/libplugins/gedit-plugin-info.c b/libplugins/gedit-plugin-info.c
index 0aa28c3..de3ea06 100644
--- a/libplugins/gedit-plugin-info.c
+++ b/libplugins/gedit-plugin-info.c
@@ -39,7 +39,6 @@
#include "gedit-plugin-info.h"
#include "gedit-plugin-info-priv.h"
-#include <gedit/gedit-debug.h>
#include "gedit-plugin.h"
void
@@ -62,11 +61,7 @@ _gedit_plugin_info_unref (GeditPluginInfo *info)
return;
if (info->plugin != NULL)
- {
- gedit_debug_message (DEBUG_PLUGINS, "Unref plugin %s", info->name);
-
g_object_unref (info->plugin);
- }
g_free (info->file);
g_free (info->module_name);
@@ -122,8 +117,6 @@ _gedit_plugin_info_new (const gchar *file)
g_return_val_if_fail (file != NULL, NULL);
- gedit_debug_message (DEBUG_PLUGINS, "Loading plugin: %s", file);
-
info = g_new0 (GeditPluginInfo, 1);
info->refcount = 1;
info->file = g_strdup (file);
@@ -135,27 +128,13 @@ _gedit_plugin_info_new (const gchar *file)
goto error;
}
- if (!g_key_file_has_key (plugin_file,
- "Gedit Plugin",
- "IAge",
- NULL))
- {
- gedit_debug_message (DEBUG_PLUGINS,
- "IAge key does not exist in file: %s", file);
+ if (!g_key_file_has_key (plugin_file, "Gedit Plugin", "IAge", NULL))
goto error;
- }
/* Check IAge=2 */
- if (g_key_file_get_integer (plugin_file,
- "Gedit Plugin",
- "IAge",
- NULL) != 2)
- {
- gedit_debug_message (DEBUG_PLUGINS,
- "Wrong IAge in file: %s", file);
+ if (g_key_file_get_integer (plugin_file, "Gedit Plugin", "IAge", NULL) != 2)
goto error;
- }
-
+
/* Get module name */
str = g_key_file_get_string (plugin_file,
"Gedit Plugin",
@@ -179,10 +158,7 @@ _gedit_plugin_info_new (const gchar *file)
NULL,
NULL);
if (info->dependencies == NULL)
- {
- gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Depends' in %s", file);
info->dependencies = g_new0 (gchar *, 1);
- }
/* Get the loader for this plugin */
str = g_key_file_get_string (plugin_file,
@@ -220,8 +196,6 @@ _gedit_plugin_info_new (const gchar *file)
NULL, NULL);
if (str)
info->desc = str;
- else
- gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Description' in %s", file);
/* Get Icon */
str = g_key_file_get_locale_string (plugin_file,
@@ -230,9 +204,6 @@ _gedit_plugin_info_new (const gchar *file)
NULL, NULL);
if (str)
info->icon_name = str;
- else
- gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Icon' in %s, using 'gedit-plugin'", file);
-
/* Get Authors */
info->authors = g_key_file_get_string_list (plugin_file,
@@ -240,9 +211,6 @@ _gedit_plugin_info_new (const gchar *file)
"Authors",
NULL,
NULL);
- if (info->authors == NULL)
- gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Authors' in %s", file);
-
/* Get Copyright */
str = g_key_file_get_string (plugin_file,
@@ -251,8 +219,6 @@ _gedit_plugin_info_new (const gchar *file)
NULL);
if (str)
info->copyright = str;
- else
- gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Copyright' in %s", file);
/* Get Website */
str = g_key_file_get_string (plugin_file,
@@ -261,8 +227,6 @@ _gedit_plugin_info_new (const gchar *file)
NULL);
if (str)
info->website = str;
- else
- gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Website' in %s", file);
/* Get Version */
str = g_key_file_get_string (plugin_file,
@@ -271,8 +235,6 @@ _gedit_plugin_info_new (const gchar *file)
NULL);
if (str)
info->version = str;
- else
- gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Version' in %s", file);
g_key_file_free (plugin_file);
@@ -312,8 +274,6 @@ gedit_plugin_info_is_available (GeditPluginInfo *info)
gboolean
gedit_plugin_info_is_configurable (GeditPluginInfo *info)
{
- gedit_debug_message (DEBUG_PLUGINS, "Is '%s' configurable?", info->name);
-
g_return_val_if_fail (info != NULL, FALSE);
if (info->plugin == NULL || !info->available)
diff --git a/libplugins/gedit-plugin.h b/libplugins/gedit-plugin.h
index 299cf47..a3345a0 100644
--- a/libplugins/gedit-plugin.h
+++ b/libplugins/gedit-plugin.h
@@ -34,7 +34,6 @@
#include <glib-object.h>
#include <gtk/gtk.h>
-#include <gedit/gedit-debug.h>
/* TODO: add a .h file that includes all the .h files normally needed to
* develop a plugin */
diff --git a/libplugins/gedit-plugins-engine.c b/libplugins/gedit-plugins-engine.c
index 5e99283..4cfc32d 100644
--- a/libplugins/gedit-plugins-engine.c
+++ b/libplugins/gedit-plugins-engine.c
@@ -41,7 +41,6 @@
#include "gedit-plugin-loader.h"
#include "gedit-object-module.h"
#include "gedit-plugin.h"
-#include <gedit/gedit-debug.h>
#include <gedit/gedit-app.h>
#include <gedit/gedit-window.h>
#include <gedit/gedit-prefs-manager.h>
@@ -102,8 +101,6 @@ load_dir_real (GeditPluginsEngine *engine,
g_return_val_if_fail (dir != NULL, TRUE);
- gedit_debug_message (DEBUG_PLUGINS, "DIR: %s", dir);
-
d = g_dir_open (dir, 0, &error);
if (!d)
{
@@ -149,10 +146,6 @@ load_plugin_info (GeditPluginsEngine *engine,
* drop this one (user plugins override system plugins) */
if (gedit_plugins_engine_get_plugin_info (engine, gedit_plugin_info_get_module_name (info)) != NULL)
{
- gedit_debug_message (DEBUG_PLUGINS, "Two or more plugins named '%s'. "
- "Only the first will be considered.\n",
- gedit_plugin_info_get_module_name (info));
-
_gedit_plugin_info_unref (info);
return TRUE;
@@ -160,7 +153,6 @@ load_plugin_info (GeditPluginsEngine *engine,
engine->priv->plugin_list = g_list_prepend (engine->priv->plugin_list, info);
- gedit_debug_message (DEBUG_PLUGINS, "Plugin %s loaded", info->name);
return TRUE;
}
@@ -186,8 +178,6 @@ load_all_plugins (GeditPluginsEngine *engine)
/* load system plugins */
pdirs_env = g_getenv ("GEDIT_PLUGINS_PATH");
- gedit_debug_message (DEBUG_PLUGINS, "GEDIT_PLUGINS_PATH=%s", pdirs_env);
-
if (pdirs_env != NULL)
{
gchar **pdirs;
@@ -271,8 +261,6 @@ add_loader (GeditPluginsEngine *engine,
static void
gedit_plugins_engine_init (GeditPluginsEngine *engine)
{
- gedit_debug (DEBUG_PLUGINS);
-
if (!g_module_supported ())
{
g_warning ("gedit is not able to initialize the plugins engine.");
@@ -317,8 +305,6 @@ gedit_plugins_engine_finalize (GObject *object)
GeditPluginsEngine *engine = GEDIT_PLUGINS_ENGINE (object);
GList *item;
- gedit_debug (DEBUG_PLUGINS);
-
/* Firs deactivate all plugins */
for (item = engine->priv->plugin_list; item; item = item->next)
{
@@ -504,8 +490,6 @@ gedit_plugins_engine_get_default (void)
const GList *
gedit_plugins_engine_get_plugin_list (GeditPluginsEngine *engine)
{
- gedit_debug (DEBUG_PLUGINS);
-
return engine->priv->plugin_list;
}
@@ -609,8 +593,6 @@ gboolean
gedit_plugins_engine_activate_plugin (GeditPluginsEngine *engine,
GeditPluginInfo *info)
{
- gedit_debug (DEBUG_PLUGINS);
-
g_return_val_if_fail (info != NULL, FALSE);
if (!gedit_plugin_info_is_available (info))
@@ -674,8 +656,6 @@ gboolean
gedit_plugins_engine_deactivate_plugin (GeditPluginsEngine *engine,
GeditPluginInfo *info)
{
- gedit_debug (DEBUG_PLUGINS);
-
g_return_val_if_fail (info != NULL, FALSE);
if (!gedit_plugin_info_is_active (info))
@@ -695,8 +675,6 @@ gedit_plugins_engine_activate_plugins (GeditPluginsEngine *engine,
GSList *active_plugins = NULL;
GList *pl;
- gedit_debug (DEBUG_PLUGINS);
-
g_return_if_fail (GEDIT_IS_PLUGINS_ENGINE (engine));
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -733,8 +711,6 @@ gedit_plugins_engine_activate_plugins (GeditPluginsEngine *engine,
engine->priv->activate_from_prefs = FALSE;
}
- gedit_debug_message (DEBUG_PLUGINS, "End");
-
/* also call update_ui after activation */
gedit_plugins_engine_update_plugins_ui (engine, window);
}
@@ -745,8 +721,6 @@ gedit_plugins_engine_deactivate_plugins (GeditPluginsEngine *engine,
{
GList *pl;
- gedit_debug (DEBUG_PLUGINS);
-
g_return_if_fail (GEDIT_IS_PLUGINS_ENGINE (engine));
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -761,8 +735,6 @@ gedit_plugins_engine_deactivate_plugins (GeditPluginsEngine *engine,
/* call deactivate for the plugin for this window */
gedit_plugin_deactivate (info->plugin, window);
}
-
- gedit_debug_message (DEBUG_PLUGINS, "End");
}
void
@@ -771,8 +743,6 @@ gedit_plugins_engine_update_plugins_ui (GeditPluginsEngine *engine,
{
GList *pl;
- gedit_debug (DEBUG_PLUGINS);
-
g_return_if_fail (GEDIT_IS_PLUGINS_ENGINE (engine));
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -784,7 +754,6 @@ gedit_plugins_engine_update_plugins_ui (GeditPluginsEngine *engine,
if (!gedit_plugin_info_is_active (info))
continue;
- gedit_debug_message (DEBUG_PLUGINS, "Updating UI of %s", info->name);
gedit_plugin_update_ui (info->plugin, window);
}
}
@@ -798,8 +767,6 @@ gedit_plugins_engine_configure_plugin (GeditPluginsEngine *engine,
GtkWindowGroup *wg;
- gedit_debug (DEBUG_PLUGINS);
-
g_return_if_fail (info != NULL);
conf_dlg = gedit_plugin_create_configure_dialog (info->plugin);
@@ -828,8 +795,6 @@ gedit_plugins_engine_active_plugins_changed (GeditPluginsEngine *engine)
GSList *active_plugins;
GList *pl;
- gedit_debug (DEBUG_PLUGINS);
-
active_plugins = gedit_prefs_manager_get_active_plugins ();
for (pl = engine->priv->plugin_list; pl; pl = pl->next)
@@ -856,7 +821,5 @@ gedit_plugins_engine_active_plugins_changed (GeditPluginsEngine *engine)
void
gedit_plugins_engine_rescan_plugins (GeditPluginsEngine *engine)
{
- gedit_debug (DEBUG_PLUGINS);
-
load_all_plugins (engine);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]