*/
#include "global.h"
+
+#include "dolphin_generalsettings.h"
#include "dolphindebug.h"
+#include <KRun>
+
+#include <QApplication>
+#include <QIcon>
+
QList<QUrl> Dolphin::validateUris(const QStringList& uriList)
{
+ const QString currentDir = QDir::currentPath();
QList<QUrl> urls;
foreach (const QString& str, uriList) {
- const QUrl url = QUrl::fromUserInput(str, QString(), QUrl::AssumeLocalFile);
+ const QUrl url = QUrl::fromUserInput(str, currentDir, QUrl::AssumeLocalFile);
if (url.isValid()) {
urls.append(url);
} else {
}
return urls;
}
+
+QUrl Dolphin::homeUrl()
+{
+ return QUrl::fromUserInput(GeneralSettings::homeUrl(), QString(), QUrl::AssumeLocalFile);
+}
+
+void Dolphin::openNewWindow(const QList<QUrl> &urls, QWidget *window, const OpenNewWindowFlags &flags)
+{
+ QString command = QStringLiteral("dolphin");
+
+ if (flags.testFlag(OpenNewWindowFlag::Select)) {
+ command.append(QLatin1String(" --select"));
+ }
+
+ if (!urls.isEmpty()) {
+ command.append(QLatin1String(" %U"));
+ }
+
+ KRun::run(command, urls, window, qApp->applicationDisplayName(), qApp->windowIcon().name());
+}