Improved the patch

This commit is contained in:
arnav dhamija 2017-02-13 15:39:01 +05:30
parent 36bd947233
commit b92ccf2ff5

View file

@ -58,6 +58,7 @@
#include <KIO/JobUiDelegate> #include <KIO/JobUiDelegate>
#include <KLocalizedString> #include <KLocalizedString>
#include <KProtocolManager> #include <KProtocolManager>
#include <KProtocolInfo>
#include <QMenu> #include <QMenu>
#include <KMessageBox> #include <KMessageBox>
#include <KFileItemListProperties> #include <KFileItemListProperties>
@ -527,7 +528,6 @@ void DolphinMainWindow::toggleSplitView()
void DolphinMainWindow::toggleSplitStash() void DolphinMainWindow::toggleSplitStash()
{ {
DolphinTabPage* tabPage = m_tabWidget->currentTabPage(); DolphinTabPage* tabPage = m_tabWidget->currentTabPage();
QAction* stashSplit = actionCollection()->action(QStringLiteral("split_stash"));
tabPage->setSplitViewEnabled(false); tabPage->setSplitViewEnabled(false);
tabPage->setSplitViewEnabled(true, QUrl("stash:/")); tabPage->setSplitViewEnabled(true, QUrl("stash:/"));
} }
@ -1054,6 +1054,7 @@ void DolphinMainWindow::setupActions()
stashSplit->setToolTip(i18nc("@info", "Opens the stash virtual directory in a split window")); stashSplit->setToolTip(i18nc("@info", "Opens the stash virtual directory in a split window"));
stashSplit->setIcon(QIcon::fromTheme(QStringLiteral("folder-visiting"))); stashSplit->setIcon(QIcon::fromTheme(QStringLiteral("folder-visiting")));
stashSplit->setCheckable(false); stashSplit->setCheckable(false);
stashSplit->setVisible(KProtocolInfo::isKnownProtocol("stash"));
connect(stashSplit, &QAction::triggered, this, &DolphinMainWindow::toggleSplitStash); connect(stashSplit, &QAction::triggered, this, &DolphinMainWindow::toggleSplitStash);
QAction* reload = actionCollection()->addAction(QStringLiteral("reload")); QAction* reload = actionCollection()->addAction(QStringLiteral("reload"));
@ -1471,7 +1472,6 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
void DolphinMainWindow::updateSplitAction() void DolphinMainWindow::updateSplitAction()
{ {
QAction* splitAction = actionCollection()->action(QStringLiteral("split_view")); QAction* splitAction = actionCollection()->action(QStringLiteral("split_view"));
QAction* stashSplit = actionCollection()->action(QStringLiteral("split_stash"));
const DolphinTabPage* tabPage = m_tabWidget->currentTabPage(); const DolphinTabPage* tabPage = m_tabWidget->currentTabPage();
if (tabPage->splitViewEnabled()) { if (tabPage->splitViewEnabled()) {
if (tabPage->primaryViewActive()) { if (tabPage->primaryViewActive()) {