]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
Fix infinite recursion if the default text is empty.
[dolphin.git] / src / dolphinview.cpp
index c454d65a52f4c7d123eb9080b20a1cce876133ab..5899404793361b156efcdd43e8175cfc81c451fb 100644 (file)
@@ -105,6 +105,7 @@ DolphinView::DolphinView(QWidget* parent,
     m_proxyModel(proxyModel),
     m_previewGenerator(0),
     m_toolTipManager(0),
+    m_revisionControlObserver(0),
     m_rootUrl(),
     m_activeItemUrl(),
     m_createdItemUrl(),
@@ -521,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 revision
+    // data of the previous URL.
+    m_dolphinModel->clearRevisionData();
+
     emit startedPathLoading(url);
 }
 
@@ -608,6 +613,13 @@ QString DolphinView::statusBarText() const
     return text;
 }
 
+QList<QAction*> DolphinView::revisionControlActions(const KFileItemList& items) const
+{
+    return items.isEmpty()
+           ? m_revisionControlObserver->contextMenuActions(url().path(KUrl::AddTrailingSlash))
+           : m_revisionControlObserver->contextMenuActions(items);
+}
+
 void DolphinView::setUrl(const KUrl& url)
 {
     m_newFileNames.clear();
@@ -1461,7 +1473,13 @@ void DolphinView::createView()
     m_previewGenerator = new KFilePreviewGenerator(view);
     m_previewGenerator->setPreviewShown(m_showPreview);
 
-    new RevisionControlObserver(view);
+    m_revisionControlObserver = new RevisionControlObserver(view);
+    connect(m_revisionControlObserver, SIGNAL(infoMessage(const QString&)),
+            this, SIGNAL(infoMessage(const QString&)));
+    connect(m_revisionControlObserver, SIGNAL(errorMessage(const QString&)),
+            this, SIGNAL(errorMessage(const QString&)));
+    connect(m_revisionControlObserver, SIGNAL(operationCompletedMessage(const QString&)),
+            this, SIGNAL(operationCompletedMessage(const QString&)));
 
     if (DolphinSettings::instance().generalSettings()->showToolTips()) {
         m_toolTipManager = new ToolTipManager(view, m_proxyModel);