From: <sa...@us...> - 2006-10-14 05:29:19
|
Revision: 17479 http://svn.sourceforge.net/gaim/?rev=17479&view=rev Author: sadrul Date: 2006-10-13 22:29:11 -0700 (Fri, 13 Oct 2006) Log Message: ----------- Make sure plugins are marked not-loadable if their ui-requirement can't be met. You are going to need to rebuild all the non-core plugins. The UI specific plugins for Gaim specifies their ui-requirement in the plugin structure. So it'd make sense to load such plugins only if the ui-requirement can be met. As it happens, gntgf (a gnt-plugin for gaim-text) can be loaded from Gaim, which has been reported to have caused Gaim to freeze. gntgf does mark itself as a gnt-plugin. So I think it should be upto libgaim to make sure plugins are marked not-loadable if the ui-requirements can not be met. This commit does exactly that. In doing so, it changes the string plugins use to specify their ui-requirement (the change is from "gtk" to GAIM_GTK_UI -- which is "gtk-gaim"). So this will require all the non-core plugins to be rebuilt. Modified Paths: -------------- trunk/console/gntplugin.h trunk/gtk/gtkplugin.h trunk/libgaim/plugin.c Modified: trunk/console/gntplugin.h =================================================================== --- trunk/console/gntplugin.h 2006-10-14 01:56:10 UTC (rev 17478) +++ trunk/console/gntplugin.h 2006-10-14 05:29:11 UTC (rev 17479) @@ -31,6 +31,8 @@ #include <string.h> +#include "gntgaim.h" + /********************************************************************** * @name GNT Plugins API **********************************************************************/ @@ -39,7 +41,7 @@ typedef GntWidget* (*GGPluginFrame) (); /* Guess where these came from */ -#define GAIM_GNT_PLUGIN_TYPE "gnt" +#define GAIM_GNT_PLUGIN_TYPE GAIM_GNT_UI /** * Decide whether a plugin is a GNT-plugin. Modified: trunk/gtk/gtkplugin.h =================================================================== --- trunk/gtk/gtkplugin.h 2006-10-14 01:56:10 UTC (rev 17478) +++ trunk/gtk/gtkplugin.h 2006-10-14 05:29:11 UTC (rev 17479) @@ -40,7 +40,7 @@ int page_num; /**< Reserved */ }; -#define GAIM_GTK_PLUGIN_TYPE "gtk" +#define GAIM_GTK_PLUGIN_TYPE GAIM_GTK_UI #define GAIM_IS_GTK_PLUGIN(plugin) \ ((plugin)->info != NULL && (plugin)->info->ui_info != NULL && \ Modified: trunk/libgaim/plugin.c =================================================================== --- trunk/libgaim/plugin.c 2006-10-14 01:56:10 UTC (rev 17478) +++ trunk/libgaim/plugin.c 2006-10-14 05:29:11 UTC (rev 17479) @@ -22,6 +22,7 @@ #include "internal.h" #include "accountopt.h" +#include "core.h" #include "dbus-maybe.h" #include "debug.h" #include "notify.h" @@ -358,6 +359,14 @@ gaim_plugin_destroy(plugin); return NULL; } + else if (plugin->info->ui_requirement && + strcmp(plugin->info->ui_requirement, gaim_core_get_ui())) + { + plugin->error = g_strdup_printf("The UI requirement for this plugin is not met."); + gaim_debug_error("plugins", "%s is not loadable: The UI requirement is not met.", plugin->path); + plugin->unloadable = TRUE; + return plugin; + } /* Really old plugins. */ if (plugin->info->magic != GAIM_PLUGIN_MAGIC) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |