}
const auto serviceName = QStringLiteral("org.kde.dolphin-%1").arg(QCoreApplication::applicationPid());
if(!Dolphin::attachToExistingInstance(urls, true, GeneralSettings::splitView(), serviceName)) {
- Dolphin::openNewWindow(urls);
+ Dolphin::openNewWindow(urls, nullptr, Dolphin::OpenNewWindowFlag::Select);
};
}
bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFiles, bool splitView, const QString& preferredService)
{
// TODO: once Wayland clients can raise or activate themselves remove check from conditional
- if (KWindowSystem::isPlatformWayland() || inputUrls.isEmpty()) {
+ if (KWindowSystem::isPlatformWayland() || inputUrls.isEmpty() || !GeneralSettings::openExternallyCalledFolderInNewTab()) {
return false;
}
<label>Should the full path be shown in the title bar</label>
<default>false</default>
</entry>
+ <entry name="OpenExternallyCalledFolderInNewTab" type="Bool">
+ <label>Should an externally called folder open in a new tab in an existing Dolphin instance</label>
+ <default>true</default>
+ </entry>
<entry name="Version" type="Int">
<label>Internal version of Dolphin, containing 3 digits for major, minor, bugfix</label>
<default>0</default>
m_editableUrl(nullptr),
m_showFullPath(nullptr),
m_filterBar(nullptr),
- m_showFullPathInTitlebar(nullptr)
+ m_showFullPathInTitlebar(nullptr),
+ m_openExternallyCalledFolderInNewTab(nullptr)
{
QFormLayout* topLayout = new QFormLayout(this);
topLayout->addRow(QString(), m_filterBar);
m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path in title bar"));
topLayout->addRow(QString(), m_showFullPathInTitlebar);
+ m_openExternallyCalledFolderInNewTab = new QCheckBox(i18nc("@option:check Startup Settings", "Open new folders in tabs"));
+ topLayout->addRow(QString(), m_openExternallyCalledFolderInNewTab);
loadSettings();
connect(m_showFullPath, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
connect(m_filterBar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
connect(m_showFullPathInTitlebar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
+ connect(m_openExternallyCalledFolderInNewTab, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
}
StartupSettingsPage::~StartupSettingsPage()
settings->setShowFullPath(m_showFullPath->isChecked());
settings->setFilterBar(m_filterBar->isChecked());
settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked());
-
+ settings->setOpenExternallyCalledFolderInNewTab(m_openExternallyCalledFolderInNewTab->isChecked());
settings->save();
}
m_showFullPath->setChecked(GeneralSettings::showFullPath());
m_filterBar->setChecked(GeneralSettings::filterBar());
m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar());
+ m_openExternallyCalledFolderInNewTab->setChecked(GeneralSettings::openExternallyCalledFolderInNewTab());
}