Sun, 11 Aug 2013 19:35:41 +0530
Refactored finch to report plugin load/unload errors
| finch/finch.c | file | annotate | diff | comparison | revisions | |
| finch/gntblist.c | file | annotate | diff | comparison | revisions | |
| finch/gntplugin.c | file | annotate | diff | comparison | revisions |
--- a/finch/finch.c Sun Aug 11 19:25:33 2013 +0530 +++ b/finch/finch.c Sun Aug 11 19:35:41 2013 +0530 @@ -30,7 +30,7 @@ #include "ft.h" #include "log.h" #include "notify.h" -#include "prefs.h" +#include "plugins.h" #include "prpl.h" #include "pounce.h" #include "savedstatuses.h"
--- a/finch/gntblist.c Sun Aug 11 19:25:33 2013 +0530 +++ b/finch/gntblist.c Sun Aug 11 19:35:41 2013 +0530 @@ -31,6 +31,7 @@ #include <log.h> #include <notify.h> #include <request.h> +#include <plugins.h> #include <savedstatuses.h> #include <server.h> #include <signal.h>
--- a/finch/gntplugin.c Sun Aug 11 19:25:33 2013 +0530 +++ b/finch/gntplugin.c Sun Aug 11 19:35:41 2013 +0530 @@ -192,21 +192,27 @@ static void plugin_toggled_cb(GntWidget *tree, PurplePlugin *plugin, gpointer null) { + GError *error = NULL; + if (gnt_tree_get_choice(GNT_TREE(tree), plugin)) { - if (!purple_plugin_load(plugin)) { - purple_notify_error(NULL, _("ERROR"), _("loading plugin failed"), NULL); + if (!purple_plugin_load(plugin, &error)) { + purple_notify_error(NULL, _("ERROR"), _("loading plugin failed"), + error->message); gnt_tree_set_choice(GNT_TREE(tree), plugin, FALSE); + g_error_free(error); } } else { GntWidget *win; - if (!purple_plugin_unload(plugin)) { - purple_notify_error(NULL, _("ERROR"), _("unloading plugin failed"), NULL); + if (!purple_plugin_unload(plugin, &error)) { + purple_notify_error(NULL, _("ERROR"), _("unloading plugin failed"), + error->message); purple_plugin_disable(plugin); gnt_tree_set_choice(GNT_TREE(tree), plugin, TRUE); + g_error_free(error); } if (confwins && (win = g_hash_table_lookup(confwins, plugin)) != NULL)