Changeset View
Changeset View
Standalone View
Standalone View
src/main.cpp
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | 110 | aboutData.addAuthor(i18nc("@info:credit", "Max Blazejak"), | |||
---|---|---|---|---|---|
111 | i18nc("@info:credit", "Developer"), | 111 | i18nc("@info:credit", "Developer"), | ||
112 | QStringLiteral("m43ksrocks@gmail.com")); | 112 | QStringLiteral("m43ksrocks@gmail.com")); | ||
113 | aboutData.addAuthor(i18nc("@info:credit", "Michael Austin"), | 113 | aboutData.addAuthor(i18nc("@info:credit", "Michael Austin"), | ||
114 | i18nc("@info:credit", "Documentation"), | 114 | i18nc("@info:credit", "Documentation"), | ||
115 | QStringLiteral("tuxedup@users.sourceforge.net")); | 115 | QStringLiteral("tuxedup@users.sourceforge.net")); | ||
116 | 116 | | |||
117 | KAboutData::setApplicationData(aboutData); | 117 | KAboutData::setApplicationData(aboutData); | ||
118 | 118 | | |||
119 | KDBusService dolphinDBusService; | | |||
120 | DBusInterface interface; | | |||
121 | | ||||
122 | QCommandLineParser parser; | 119 | QCommandLineParser parser; | ||
123 | aboutData.setupCommandLine(&parser); | 120 | aboutData.setupCommandLine(&parser); | ||
124 | 121 | | |||
125 | // command line options | 122 | // command line options | ||
126 | parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("select"), i18nc("@info:shell", "The files and folders passed as arguments " | 123 | parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("select"), i18nc("@info:shell", "The files and folders passed as arguments " | ||
127 | "will be selected."))); | 124 | "will be selected."))); | ||
128 | parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("split"), i18nc("@info:shell", "Dolphin will get started with a split view."))); | 125 | parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("split"), i18nc("@info:shell", "Dolphin will get started with a split view."))); | ||
129 | parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("new-window"), i18nc("@info:shell", "Dolphin will explicitly open in a new window."))); | 126 | parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("new-window"), i18nc("@info:shell", "Dolphin will explicitly open in a new window."))); | ||
130 | parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("daemon"), i18nc("@info:shell", "Start Dolphin Daemon (only required for DBus Interface)"))); | 127 | parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("daemon"), i18nc("@info:shell", "Start Dolphin Daemon (only required for DBus Interface)"))); | ||
131 | parser.addPositionalArgument(QStringLiteral("+[Url]"), i18nc("@info:shell", "Document to open")); | 128 | parser.addPositionalArgument(QStringLiteral("+[Url]"), i18nc("@info:shell", "Document to open")); | ||
132 | 129 | | |||
133 | parser.process(app); | 130 | parser.process(app); | ||
134 | aboutData.processCommandLine(&parser); | 131 | aboutData.processCommandLine(&parser); | ||
135 | 132 | | |||
136 | const bool splitView = parser.isSet(QStringLiteral("split")) || GeneralSettings::splitView(); | 133 | const bool splitView = parser.isSet(QStringLiteral("split")) || GeneralSettings::splitView(); | ||
137 | const bool openFiles = parser.isSet(QStringLiteral("select")); | 134 | const bool openFiles = parser.isSet(QStringLiteral("select")); | ||
138 | const QStringList args = parser.positionalArguments(); | 135 | const QStringList args = parser.positionalArguments(); | ||
139 | QList<QUrl> urls = Dolphin::validateUris(args); | 136 | QList<QUrl> urls = Dolphin::validateUris(args); | ||
140 | 137 | | |||
141 | if (parser.isSet(QStringLiteral("daemon"))) { | 138 | if (parser.isSet(QStringLiteral("daemon"))) { | ||
139 | KDBusService dolphinDBusService; | ||||
140 | DBusInterface interface; | ||||
142 | return app.exec(); | 141 | return app.exec(); | ||
143 | } | 142 | } | ||
144 | 143 | | |||
145 | if (!parser.isSet(QStringLiteral("new-window"))) { | 144 | if (!parser.isSet(QStringLiteral("new-window"))) { | ||
146 | if (Dolphin::attachToExistingInstance(urls, openFiles, splitView)) { | 145 | if (Dolphin::attachToExistingInstance(urls, openFiles, splitView)) { | ||
147 | // Successfully attached to existing instance of Dolphin | 146 | // Successfully attached to existing instance of Dolphin | ||
148 | return 0; | 147 | return 0; | ||
elvisangelaccio: What about this code path? Previously it would create the dbus objects, now with this patch it… | |||||
No, if the code reaches here, this instance was basically a glorified URL forwarder, and we wouldn't want it to be reachable via DBus at all. feverfew: No, if the code reaches here, this instance was basically a glorified URL forwarder, and we… | |||||
149 | } | 148 | } | ||
150 | } | 149 | } | ||
151 | 150 | | |||
152 | if (urls.isEmpty()) { | 151 | if (urls.isEmpty()) { | ||
153 | // We need at least one URL to open Dolphin | 152 | // We need at least one URL to open Dolphin | ||
154 | urls.append(Dolphin::homeUrl()); | 153 | urls.append(Dolphin::homeUrl()); | ||
155 | } | 154 | } | ||
156 | 155 | | |||
Show All 16 Lines | 171 | if (app.isSessionRestored()) { | |||
173 | const QString className = KXmlGuiWindow::classNameOfToplevel(1); | 172 | const QString className = KXmlGuiWindow::classNameOfToplevel(1); | ||
174 | if (className == QLatin1String("DolphinMainWindow")) { | 173 | if (className == QLatin1String("DolphinMainWindow")) { | ||
175 | mainWindow->restore(1); | 174 | mainWindow->restore(1); | ||
176 | } else { | 175 | } else { | ||
177 | qCWarning(DolphinDebug) << "Unknown class " << className << " in session saved data!"; | 176 | qCWarning(DolphinDebug) << "Unknown class " << className << " in session saved data!"; | ||
178 | } | 177 | } | ||
179 | } | 178 | } | ||
180 | 179 | | |||
180 | KDBusService dolphinDBusService; | ||||
181 | DBusInterface interface; | ||||
182 | | ||||
181 | return app.exec(); // krazy:exclude=crash; | 183 | return app.exec(); // krazy:exclude=crash; | ||
182 | } | 184 | } |
What about this code path? Previously it would create the dbus objects, now with this patch it would not. Is that a problem?