From 2f1f9e656a97112194544ed4b780f14396779a4e Mon Sep 17 00:00:00 2001 From: Markus Wintermann Date: Thu, 26 Apr 2018 21:46:34 +0200 Subject: [PATCH] [plugin_installer] Remove plugin on reload --- plugin_installer/plugin_installer.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin_installer/plugin_installer.py b/plugin_installer/plugin_installer.py index 0401a54..36a7bf5 100644 --- a/plugin_installer/plugin_installer.py +++ b/plugin_installer/plugin_installer.py @@ -292,7 +292,13 @@ class PluginInstaller(GajimPlugin): is_active = True log.info('Deactivate Plugin: %s', plugin) app.plugin_manager.deactivate_plugin(plugin) - app.plugin_manager.plugins.remove(plugin) + + if hasattr(app.plugin_manager, 'uninstall_plugin'): + # check if we are running a new version of gajim. Check + # uninstall because remove_plugin existed before + app.plugin_manager.remove_plugin(plugin) + else: + app.plugin_manager.plugins.remove(plugin) model = self.installed_plugins_model for row in range(len(model)):