]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
allow to change the order of columns in the details view
[dolphin.git] / src / dolphinview.cpp
index 4a81b12ea949802b804cddf18db3ead37f8ae8d0..aa0bb96194631c6ff6d7f8d70ef62205ab135f6e 100644 (file)
@@ -64,6 +64,7 @@
 #include "renamedialog.h"
 #include "tooltips/tooltipmanager.h"
 #include "settings/dolphinsettings.h"
+#include "versioncontrolobserver.h"
 #include "viewproperties.h"
 #include "zoomlevelinfo.h"
 
@@ -104,6 +105,7 @@ DolphinView::DolphinView(QWidget* parent,
     m_proxyModel(proxyModel),
     m_previewGenerator(0),
     m_toolTipManager(0),
+    m_versionControlObserver(0),
     m_rootUrl(),
     m_activeItemUrl(),
     m_createdItemUrl(),
@@ -520,6 +522,10 @@ void DolphinView::updateView(const KUrl& url, const KUrl& rootUrl)
         loadDirectory(url);
     }
 
+    // When changing the URL there is no need to keep the version
+    // data of the previous URL.
+    m_dolphinModel->clearVersionData();
+
     emit startedPathLoading(url);
 }
 
@@ -607,6 +613,13 @@ QString DolphinView::statusBarText() const
     return text;
 }
 
+QList<QAction*> DolphinView::versionControlActions(const KFileItemList& items) const
+{
+    return items.isEmpty()
+           ? m_versionControlObserver->contextMenuActions(url().path(KUrl::AddTrailingSlash))
+           : m_versionControlObserver->contextMenuActions(items);
+}
+
 void DolphinView::setUrl(const KUrl& url)
 {
     m_newFileNames.clear();
@@ -1460,6 +1473,14 @@ void DolphinView::createView()
     m_previewGenerator = new KFilePreviewGenerator(view);
     m_previewGenerator->setPreviewShown(m_showPreview);
 
+    m_versionControlObserver = new VersionControlObserver(view);
+    connect(m_versionControlObserver, SIGNAL(infoMessage(const QString&)),
+            this, SIGNAL(infoMessage(const QString&)));
+    connect(m_versionControlObserver, SIGNAL(errorMessage(const QString&)),
+            this, SIGNAL(errorMessage(const QString&)));
+    connect(m_versionControlObserver, SIGNAL(operationCompletedMessage(const QString&)),
+            this, SIGNAL(operationCompletedMessage(const QString&)));
+
     if (DolphinSettings::instance().generalSettings()->showToolTips()) {
         m_toolTipManager = new ToolTipManager(view, m_proxyModel);
         connect(m_controller, SIGNAL(hideToolTip()),