Changeset View
Changeset View
Standalone View
Standalone View
src/main.cpp
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 60 | #endif | |||
---|---|---|---|---|---|
137 | const bool openFiles = parser.isSet(QStringLiteral("select")); | 137 | const bool openFiles = parser.isSet(QStringLiteral("select")); | ||
138 | const QStringList args = parser.positionalArguments(); | 138 | const QStringList args = parser.positionalArguments(); | ||
139 | QList<QUrl> urls = Dolphin::validateUris(args); | 139 | QList<QUrl> urls = Dolphin::validateUris(args); | ||
140 | 140 | | |||
141 | if (parser.isSet(QStringLiteral("daemon"))) { | 141 | if (parser.isSet(QStringLiteral("daemon"))) { | ||
142 | return app.exec(); | 142 | return app.exec(); | ||
143 | } | 143 | } | ||
144 | 144 | | |||
145 | if (splitView && urls.size() < 2) { | | |||
146 | // Split view does only make sense if we have at least 2 URLs | | |||
147 | urls.append(urls.last()); | | |||
148 | } | | |||
149 | | ||||
150 | if (!parser.isSet(QStringLiteral("new-window"))) { | 145 | if (!parser.isSet(QStringLiteral("new-window"))) { | ||
151 | if (Dolphin::attachToExistingInstance(urls, openFiles, splitView)) { | 146 | if (Dolphin::attachToExistingInstance(urls, openFiles, splitView)) { | ||
152 | // Successfully attached to existing instance of Dolphin | 147 | // Successfully attached to existing instance of Dolphin | ||
153 | return 0; | 148 | return 0; | ||
154 | } | 149 | } | ||
155 | } | 150 | } | ||
156 | 151 | | |||
157 | if (urls.isEmpty()) { | 152 | if (urls.isEmpty()) { | ||
158 | // We need at least one URL to open Dolphin | 153 | // We need at least one URL to open Dolphin | ||
159 | urls.append(Dolphin::homeUrl()); | 154 | urls.append(Dolphin::homeUrl()); | ||
160 | } | 155 | } | ||
161 | 156 | | |||
157 | if (splitView && urls.size() < 2) { | ||||
158 | // Split view does only make sense if we have at least 2 URLs | ||||
159 | urls.append(urls.last()); | ||||
160 | } | ||||
161 | | ||||
162 | DolphinMainWindow* mainWindow = new DolphinMainWindow(); | 162 | DolphinMainWindow* mainWindow = new DolphinMainWindow(); | ||
163 | 163 | | |||
164 | if (openFiles) { | 164 | if (openFiles) { | ||
165 | mainWindow->openFiles(urls, splitView); | 165 | mainWindow->openFiles(urls, splitView); | ||
166 | } else { | 166 | } else { | ||
167 | mainWindow->openDirectories(urls, splitView); | 167 | mainWindow->openDirectories(urls, splitView); | ||
168 | } | 168 | } | ||
169 | 169 | | |||
Show All 13 Lines |