diff --git a/moo/mooedit/mooplugin-macro.h b/moo/mooedit/mooplugin-macro.h index 0bb153f1..b2c6dc87 100644 --- a/moo/mooedit/mooplugin-macro.h +++ b/moo/mooedit/mooplugin-macro.h @@ -55,11 +55,11 @@ name__##_plugin_class_init (MooPluginClass *klass) \ \ klass->init = (MooPluginInitFunc) name__##_plugin_init; \ klass->deinit = (MooPluginDeinitFunc) name__##_plugin_deinit; \ - klass->attach_win = (MooPluginAttachWinFunc) attach_win__; \ - klass->detach_win = (MooPluginDetachWinFunc) detach_win__; \ - klass->attach_doc = (MooPluginAttachDocFunc) attach_doc__; \ - klass->detach_doc = (MooPluginDetachDocFunc) detach_doc__; \ - klass->create_prefs_page = (MooPluginPrefsPageFunc) prefs_page_func__; \ + klass->attach_win = attach_win__; \ + klass->detach_win = detach_win__; \ + klass->attach_doc = attach_doc__; \ + klass->detach_doc = detach_doc__; \ + klass->create_prefs_page = prefs_page_func__; \ } \ \ static void \ diff --git a/moo/mooedit/plugins/moofileselector.c b/moo/mooedit/plugins/moofileselector.c index d2f8a72b..2477f21a 100644 --- a/moo/mooedit/plugins/moofileselector.c +++ b/moo/mooedit/plugins/moofileselector.c @@ -57,6 +57,7 @@ typedef struct { } FileSelectorPlugin; #define Plugin FileSelectorPlugin +#define FILE_SELECTOR_PLUGIN(mpl) ((FileSelectorPlugin*)mpl) enum { @@ -1436,11 +1437,12 @@ file_selector_plugin_deinit (Plugin *plugin) static void -file_selector_plugin_attach (Plugin *plugin, +file_selector_plugin_attach (MooPlugin *mplugin, MooEditWindow *window) { MooEditor *editor; GtkWidget *filesel; + Plugin *plugin = FILE_SELECTOR_PLUGIN (mplugin); editor = moo_edit_window_get_editor (window); @@ -1459,11 +1461,14 @@ file_selector_plugin_attach (Plugin *plugin, static void -file_selector_plugin_detach (Plugin *plugin, +file_selector_plugin_detach (MooPlugin *mplugin, MooEditWindow *window) { + Plugin *plugin = FILE_SELECTOR_PLUGIN (mplugin); GtkWidget *filesel = moo_edit_window_get_pane (window, MOO_FILE_SELECTOR_PLUGIN_ID); + g_return_if_fail (filesel != NULL); + plugin->instances = g_slist_remove (plugin->instances, filesel); moo_edit_window_remove_pane (window, MOO_FILE_SELECTOR_PLUGIN_ID); }