Add application argument to force import of legacy accounts
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 5 May 2023 02:44:49 +0000 (10:44 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 16 May 2023 13:23:43 +0000 (21:23 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/application.cpp

index 8eca93d502b0d5847392ed81a12d6c9ba0885b23..bb70d685fec9181371810f4fed11afdcf8db151a 100644 (file)
@@ -97,7 +97,8 @@ namespace {
         "  --localdirpath       : (optional) path where to create a local sync folder when creating an account via command-line.\n"
         "  --isvfsenabled       : whether to set a VFS or non-VFS folder (1 for 'yes' or 0 for 'no') when creating an account via command-line.\n"
         "  --remotedirpath      : (optional) path to a remote subfolder when creating an account via command-line.\n"
-        "  --serverurl          : a server URL to use when creating an account via command-line.\n";
+        "  --serverurl          : a server URL to use when creating an account via command-line.\n"
+        "  --forcelegacyimport  : forcefully import account configurations from legacy clients (if available).\n";
 
     QString applicationTrPath()
     {
@@ -755,8 +756,9 @@ void Application::parseOptions(const QStringList &options)
             } else {
                 showHint("Invalid URL passed to --overridelocaldir");
             }
-        }
-        else {
+        } else if (option == QStringLiteral("--forcelegacyimport")) {
+            AccountManager::instance()->setForceLegacyImport(true);
+        } else {
             QString errorMessage;
             if (!AccountSetupCommandLineManager::instance()->parseCommandlineOption(option, it, errorMessage)) {
                 if (!errorMessage.isEmpty()) {