The locking around the plugin access in actions doesn't seem to be

necessary, as actions is only called from the main thread.

Also it wasn't checked consistently; if the lock could not be taken, the
plugin was accessed anyway.
This commit is contained in:
Simeon Bird 2013-01-12 10:37:57 -05:00
parent 7fe1278b1e
commit cad45e4150

View file

@ -108,12 +108,7 @@ QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) cons
if (pluginV2) {
// Use version 2 of the KVersionControlPlugin which allows providing actions
// also for non-versioned directories.
if (m_updateItemStatesThread && m_updateItemStatesThread->lockPlugin()) {
actions = pluginV2->actions(items);
m_updateItemStatesThread->unlockPlugin();
} else {
actions = pluginV2->actions(items);
}
actions = pluginV2->actions(items);
} else if (isVersioned()) {
// Support deprecated interfaces from KVersionControlPlugin version 1.
// Context menu actions where only available for versioned directories.
@ -125,14 +120,8 @@ QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) cons
}
}
if (m_updateItemStatesThread && m_updateItemStatesThread->lockPlugin()) {
actions = directory.isEmpty() ? m_plugin->contextMenuActions(items)
: m_plugin->contextMenuActions(directory);
m_updateItemStatesThread->unlockPlugin();
} else {
actions = directory.isEmpty() ? m_plugin->contextMenuActions(items)
: m_plugin->contextMenuActions(directory);
}
actions = directory.isEmpty() ? m_plugin->contextMenuActions(items)
: m_plugin->contextMenuActions(directory);
}
return actions;