X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/8e6dbadef2e7f25caed42559c4ffc832e03d387b..79a6e75b6567e8cf2ef677cea6bb2c34075d07c7:/src/dolphinview.cpp diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 4a81b12ea..589940479 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -62,6 +62,7 @@ #include "draganddrophelper.h" #include "folderexpander.h" #include "renamedialog.h" +#include "revisioncontrolobserver.h" #include "tooltips/tooltipmanager.h" #include "settings/dolphinsettings.h" #include "viewproperties.h" @@ -104,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(), @@ -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 revision + // data of the previous URL. + m_dolphinModel->clearRevisionData(); + emit startedPathLoading(url); } @@ -607,6 +613,13 @@ QString DolphinView::statusBarText() const return text; } +QList 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(); @@ -1460,6 +1473,14 @@ void DolphinView::createView() m_previewGenerator = new KFilePreviewGenerator(view); m_previewGenerator->setPreviewShown(m_showPreview); + 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); connect(m_controller, SIGNAL(hideToolTip()),