]> cloud.milkyroute.net Git - dolphin.git/commitdiff
The locking around the plugin access in actions doesn't seem to be
authorSimeon Bird <bladud@gmail.com>
Sat, 12 Jan 2013 15:37:57 +0000 (10:37 -0500)
committerSimeon Bird <bladud@gmail.com>
Tue, 15 Jan 2013 16:12:09 +0000 (11:12 -0500)
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.

src/views/versioncontrol/versioncontrolobserver.cpp

index f4dd877d340cb0a57a4e40a340656416539ad830..402a2de54c1644169ceae455486050015461ff7e 100644 (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;