From: arnav dhamija Date: Mon, 13 Feb 2017 16:54:01 +0000 (+0530) Subject: Merge branch 'stashAction' X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/ccb3658b3aa7f5b0f0b71cb6e91808bdfe58af64?hp=-c Merge branch 'stashAction' This adds the support for the Stash action which will be helpful for the upcoming stash:/ ioslave --- ccb3658b3aa7f5b0f0b71cb6e91808bdfe58af64 diff --combined src/dolphinmainwindow.cpp index 5bca8d06f,31b4cfed7..a2e9c0dd8 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@@ -50,6 -50,7 +50,6 @@@ #include #include #include -#include #include #include #include @@@ -57,6 -58,7 +57,7 @@@ #include #include #include + #include #include #include #include @@@ -523,10 -525,17 +524,17 @@@ void DolphinMainWindow::toggleSplitView updateViewActions(); } + void DolphinMainWindow::toggleSplitStash() + { + DolphinTabPage* tabPage = m_tabWidget->currentTabPage(); + tabPage->setSplitViewEnabled(false); + tabPage->setSplitViewEnabled(true, QUrl("stash:/")); + } + void DolphinMainWindow::reloadView() { clearStatusBar(); - m_activeViewContainer->view()->reload(); + m_activeViewContainer->reload(); } void DolphinMainWindow::stopLoading() @@@ -722,7 -731,7 +730,7 @@@ void DolphinMainWindow::handleUrl(cons } else if (KProtocolManager::supportsListing(url)) { // stat the URL to see if it is a dir or not m_lastHandleUrlStatJob = KIO::stat(url, KIO::HideProgressInfo); - if (m_lastHandleUrlStatJob->ui()) { + if (m_lastHandleUrlStatJob->uiDelegate()) { KJobWidgets::setWindow(m_lastHandleUrlStatJob, this); } connect(m_lastHandleUrlStatJob, &KIO::Job::result, @@@ -868,8 -877,10 +876,8 @@@ void DolphinMainWindow::updateControlMe helpMenu->addSeparator(); helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::ReportBug))); helpMenu->addSeparator(); -#if KCONFIGWIDGETS_VERSION >= QT_VERSION_CHECK(5, 26, 0) helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Donate))); helpMenu->addSeparator(); -#endif helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::SwitchApplicationLanguage))); helpMenu->addSeparator(); helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::AboutApp))); @@@ -958,17 -969,13 +966,17 @@@ void DolphinMainWindow::setUrlAsCaption } } - QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName(); - if (fileName.isEmpty()) { - fileName = '/'; + if (GeneralSettings::showFullPathInTitlebar()) { + const QString path = url.adjusted(QUrl::StripTrailingSlash).path(); + caption.append(path); + } else { + QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName(); + if (fileName.isEmpty()) { + fileName = '/'; + } + caption.append(fileName); } - caption.append(fileName); - setWindowTitle(caption); } @@@ -1041,6 -1048,15 +1049,15 @@@ void DolphinMainWindow::setupActions( actionCollection()->setDefaultShortcut(split, Qt::Key_F3); connect(split, &QAction::triggered, this, &DolphinMainWindow::toggleSplitView); + QAction* stashSplit = actionCollection()->addAction(QStringLiteral("split_stash")); + actionCollection()->setDefaultShortcut(stashSplit, Qt::CTRL | Qt::Key_S); + stashSplit->setText(i18nc("@action:intoolbar Stash", "Stash")); + stashSplit->setToolTip(i18nc("@info", "Opens the stash virtual directory in a split window")); + stashSplit->setIcon(QIcon::fromTheme(QStringLiteral("folder-visiting"))); + stashSplit->setCheckable(false); + stashSplit->setVisible(KProtocolInfo::isKnownProtocol("stash")); + connect(stashSplit, &QAction::triggered, this, &DolphinMainWindow::toggleSplitStash); + QAction* reload = actionCollection()->addAction(QStringLiteral("reload")); reload->setText(i18nc("@action:inmenu View", "Reload")); actionCollection()->setDefaultShortcut(reload, Qt::Key_F5); @@@ -1131,14 -1147,14 +1148,14 @@@ activateNextTab->setText(i18nc("@action:inmenu", "Activate Next Tab")); activateNextTab->setEnabled(false); connect(activateNextTab, &QAction::triggered, m_tabWidget, &DolphinTabWidget::activateNextTab); - actionCollection()->setDefaultShortcuts(activateNextTab, QApplication::isRightToLeft() ? prevTabKeys : nextTabKeys); + actionCollection()->setDefaultShortcuts(activateNextTab, nextTabKeys); QAction* activatePrevTab = actionCollection()->addAction(QStringLiteral("activate_prev_tab")); activatePrevTab->setIconText(i18nc("@action:inmenu", "Previous Tab")); activatePrevTab->setText(i18nc("@action:inmenu", "Activate Previous Tab")); activatePrevTab->setEnabled(false); connect(activatePrevTab, &QAction::triggered, m_tabWidget, &DolphinTabWidget::activatePrevTab); - actionCollection()->setDefaultShortcuts(activatePrevTab, QApplication::isRightToLeft() ? nextTabKeys : prevTabKeys); + actionCollection()->setDefaultShortcuts(activatePrevTab, prevTabKeys); // for context menu QAction* openInNewTab = actionCollection()->addAction(QStringLiteral("open_in_new_tab")); @@@ -1405,7 -1421,6 +1422,7 @@@ void DolphinMainWindow::refreshViews( const bool splitView = GeneralSettings::splitView(); m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView); updateSplitAction(); + setUrlAsCaption(activeViewContainer()->url()); } emit settingsChanged();