From 93cb7e02616df9746f7cdae09434e7488f4e7d28 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 9 Sep 2011 19:21:22 +0200 Subject: Version control: Show context menu entries of plugins --- .../versioncontrol/versioncontrolobserver.cpp | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/views/versioncontrol') diff --git a/src/views/versioncontrol/versioncontrolobserver.cpp b/src/views/versioncontrol/versioncontrolobserver.cpp index ba83b7515..c8d9d6874 100644 --- a/src/views/versioncontrol/versioncontrolobserver.cpp +++ b/src/views/versioncontrol/versioncontrolobserver.cpp @@ -90,19 +90,28 @@ KFileItemModel* VersionControlObserver::model() const QList VersionControlObserver::contextMenuActions(const KFileItemList& items) const { QList actions; - if (isVersioned() && m_updateItemStatesThread->lockPlugin()) { - actions = m_plugin->contextMenuActions(items); - m_updateItemStatesThread->unlockPlugin(); + if (isVersioned()) { + if (m_updateItemStatesThread && m_updateItemStatesThread->lockPlugin()) { + actions = m_plugin->contextMenuActions(items); + m_updateItemStatesThread->unlockPlugin(); + } else { + actions = m_plugin->contextMenuActions(items); + } } + return actions; } QList VersionControlObserver::contextMenuActions(const QString& directory) const { QList actions; - if (isVersioned() && m_updateItemStatesThread->lockPlugin()) { - actions = m_plugin->contextMenuActions(directory); - m_updateItemStatesThread->unlockPlugin(); + if (isVersioned()) { + if (m_updateItemStatesThread && m_updateItemStatesThread->lockPlugin()) { + actions = m_plugin->contextMenuActions(directory); + m_updateItemStatesThread->unlockPlugin(); + } else { + actions = m_plugin->contextMenuActions(directory); + } } return actions; @@ -303,7 +312,7 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director bool VersionControlObserver::isVersioned() const { - return false; //m_dolphinModel->hasVersionData() && m_plugin; + return m_versionedDirectory && m_plugin; } #include "versioncontrolobserver.moc" -- cgit v1.3