Skip to content

Commit 282a179

Browse files
mgallienbackportbot[bot]
authored andcommitted
chore: parse command line options before migrating configuration
parse command line options earlier such that they are available when trying to migrate legacy configuration folder Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
1 parent d91636a commit 282a179

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

src/gui/application.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,21 @@ Application::Application(int &argc, char **argv)
254254
setApplicationName(_theme->appName());
255255
setWindowIcon(_theme->applicationIcon());
256256

257+
parseOptions(arguments());
258+
//no need to waste time;
259+
if (_helpOnly || _versionOnly) {
260+
return;
261+
}
262+
263+
if (_quitInstance) {
264+
QTimer::singleShot(0, qApp, &QApplication::quit);
265+
return;
266+
}
267+
268+
if (!_singleApp.isPrimaryInstance()) {
269+
return;
270+
}
271+
257272
if (!ConfigFile().exists()) {
258273
setApplicationName(_theme->appNameGUI());
259274
QString legacyDir = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/" + APPLICATION_CONFIG_NAME;
@@ -306,21 +321,6 @@ Application::Application(int &argc, char **argv)
306321
}
307322
}
308323

309-
parseOptions(arguments());
310-
//no need to waste time;
311-
if (_helpOnly || _versionOnly) {
312-
return;
313-
}
314-
315-
if (_quitInstance) {
316-
QTimer::singleShot(0, qApp, &QApplication::quit);
317-
return;
318-
}
319-
320-
if (!_singleApp.isPrimaryInstance()) {
321-
return;
322-
}
323-
324324
setupLogging();
325325
setupTranslations();
326326

0 commit comments

Comments
 (0)