Commit 1aabbab6 authored by seryc's avatar seryc
Browse files

FIXED bug 163. Add a method to unregister actions of actionExtension in the...

FIXED bug 163. Add a method to unregister actions of actionExtension in the application map of actions.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@2159 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 127539d6
......@@ -446,6 +446,8 @@ bool ExtensionManager::unloadActionExtension(QString fileName) {
}
//-- unregister extension
getActionExtensionMap().remove(fileName);
// -- unregister actions from application
Application::unregisterAllActions(ext);
//-- delete extensions (and all its actions)
delete ext;
return true;
......
......@@ -634,6 +634,18 @@ int Application::registerAllActions(ActionExtension * ext) {
return registered;
}
// -------------------- unregisterAllActions --------------------
int Application::unregisterAllActions(ActionExtension * ext) {
int registered = 0;
foreach(Action * action, ext->getActions()) {
getActionMap().remove(action->getName());
registered++;
}
return registered;
}
// ---------------- actionLessThan ----------------
bool actionLessThan(const camitk::Action * a1, const camitk::Action * a2) {
// This method is needed by qsort in the sort method to sort action by name
......
......@@ -245,6 +245,11 @@ public:
* @return the number of actions effectively registered (in case an action's name is already registered it won't be a second time)
*/
static int registerAllActions(ActionExtension *);
/** unregister all actions from the given ActionExtension
* @return the number of actions effectively unregistered (in case an action's name is already registered it won't be a second time) --> TODO: to be discuss !
*/
static int unregisterAllActions(ActionExtension *);
///@}
/** @name Main Window management
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment