#include "dolphinviewcontainer.h"
#include <KConfigGroup>
-#include <KRun>
#include <KShell>
#include <kio/global.h>
+#include <KIO/CommandLauncherJob>
+#include <KAcceleratorManager>
#include <QApplication>
#include <QDropEvent>
m_placesSelectorVisible(true),
m_lastViewedTab(0)
{
+ KAcceleratorManager::setNoAccel(this);
+
connect(this, &DolphinTabWidget::tabCloseRequested,
this, QOverload<int>::of(&DolphinTabWidget::closeTab));
connect(this, &DolphinTabWidget::currentChanged,
} else {
tabPage->secondaryViewContainer()->setActive(true);
}
+ // BUG: 417230
+ // Required for updateViewState() call in openFiles() to work as expected
+ // If there is a selection, updateViewState() calls are effectively a no-op
+ tabPage->activeViewContainer()->view()->clearSelection();
continue;
}
if (splitView && (it != dirs.constEnd())) {
// Select the files. Although the files can be split between several
// tabs, there is no need to split 'files' accordingly, as
// the DolphinView will just ignore invalid selections.
- for (int i = oldTabCount; i < tabCount; ++i) {
+ for (int i = 0; i < tabCount; ++i) {
DolphinTabPage* tabPage = tabPageAt(i);
tabPage->markUrlsAsSelected(files);
tabPage->markUrlAsCurrent(files.first());
+ if (i < oldTabCount) {
+ // Force selection of file if directory was already open, BUG: 417230
+ tabPage->activeViewContainer()->view()->updateViewState();
+ }
}
}
}
args << QStringLiteral("--new-window");
- const QString command = QStringLiteral("dolphin %1").arg(KShell::joinArgs(args));
- KRun::runCommand(command, this);
+ KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob("dolphin", args, this);
+ job->setDesktopName(QStringLiteral("org.kde.dolphin"));
+ job->start();
closeTab(index);
}