diff options
| author | Ashish Bansal <[email protected]> | 2015-04-22 18:59:39 +0530 |
|---|---|---|
| committer | Ashish Bansal <[email protected]> | 2015-04-22 18:59:39 +0530 |
| commit | 7042c6c2899a4e46a095a38ee1481b63ca4b96d8 (patch) | |
| tree | 9f4faa535285ec57cafa9ba6cf5173c089509f9d /src/main.cpp | |
| parent | 807230882b0d68d6b24849aa79d69fb4df7e813a (diff) | |
Add dbus interface to dolphin
Implemented org.freedesktop.FileManager1 dbus interface in dolphin
http://www.freedesktop.org/wiki/Specifications/file-manager-interface/
REVIEW: 123313
BUG: 343016
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp index 1c0fdab68..105330059 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,6 +21,8 @@ #include "dolphinmainwindow.h" #include "dolphin_generalsettings.h" +#include "dbusinterface.h" +#include "global.h" #include <KDBusService> #include <KAboutData> @@ -84,6 +86,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) KAboutData::setApplicationData(aboutData); KDBusService dolphinDBusService; + DBusInterface interface; QCommandLineParser parser; parser.addVersionOption(); @@ -94,25 +97,21 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) parser.addOption(QCommandLineOption(QStringList() << QLatin1String("select"), i18nc("@info:shell", "The files and directories passed as arguments " "will be selected."))); parser.addOption(QCommandLineOption(QStringList() << QLatin1String("split"), i18nc("@info:shell", "Dolphin will get started with a split view."))); + parser.addOption(QCommandLineOption(QStringList() << QLatin1String("daemon"), i18nc("@info:shell", "Start Dolphin Daemon (only required for DBus Interface)"))); parser.addPositionalArgument(QLatin1String("+[Url]"), i18nc("@info:shell", "Document to open")); parser.process(app); aboutData.processCommandLine(&parser); + if (parser.isSet("daemon")) { + return app.exec(); + } DolphinMainWindow* m_mainWindow = new DolphinMainWindow(); m_mainWindow->setAttribute(Qt::WA_DeleteOnClose); - QList<QUrl> urls; const QStringList args = parser.positionalArguments(); - foreach (const QString& str, args) { - const QUrl url = QUrl::fromUserInput(str, QString(), QUrl::AssumeLocalFile); - if (url.isValid()) { - urls.append(url); - } else { - qCWarning(DolphinDebug) << "Invalid URL: " << str; - } - } + QList<QUrl> urls = Dolphin::validateUris(args); bool resetSplitSettings = false; if (parser.isSet("split") && !GeneralSettings::splitView()) { |
