[gnote] Add ability to auto-disable import plugins
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Add ability to auto-disable import plugins
- Date: Sat, 1 Mar 2014 17:07:36 +0000 (UTC)
commit 997e9ea49f934236f991c0e99f3a873342d224ec
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sat Mar 1 19:05:16 2014 +0200
Add ability to auto-disable import plugins
src/notemanager.cpp | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/notemanager.cpp b/src/notemanager.cpp
index 1bd7aa9..487a50a 100644
--- a/src/notemanager.cpp
+++ b/src/notemanager.cpp
@@ -33,6 +33,7 @@
#include "itagmanager.hpp"
#include "preferences.hpp"
#include "sharp/directory.hpp"
+#include "sharp/dynamicmodule.hpp"
namespace gnote {
@@ -79,7 +80,13 @@ namespace gnote {
if((*iter)->want_to_run(*this)) {
has_imported |= (*iter)->first_run(*this);
}
+ AddinInfo addin_info = m_addin_mgr->get_addin_info(**iter);
+ if(addin_info.get_attribute("AutoDisable") == "true") {
+ (*iter)->shutdown();
+ m_addin_mgr->get_module(addin_info.id())->enabled(false);
+ }
}
+ m_addin_mgr->save_addins_prefs(); // we probably disabled some import plugins
// we MUST call this after import
post_load();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]