Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Müller <80399010+fmoc@users.noreply.github.com>2021-11-22 17:17:08 +0300
committerGitHub <noreply@github.com>2021-11-22 17:17:08 +0300
commit78796ed66cad10df2015850b896391a74e17cf03 (patch)
treea1e080088d20fc5df363ce300fa0a45d8abad3a2 /src/common
parentade59778d12e51e57980b84569870f489e50f59a (diff)
Reverse order of migrations (#9226)
* Reverse order of paths to migrate This way, we won't accidentally migrate an older configuration if a newer one is available. * Add log prefix for non-legacy migration code as well * Also break if file-based migration works * Add stripTrailingSlash to Utility * Simplify code * Make configLocationsToMigrate const Co-authored-by: Hannah von Reth <hannah.vonreth@owncloud.com>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/utility.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/utility.h b/src/common/utility.h
index fb3c22a5a..6f23d9d31 100644
--- a/src/common/utility.h
+++ b/src/common/utility.h
@@ -147,6 +147,14 @@ OCSYNC_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcUtility)
// case sensitivity.
OCSYNC_EXPORT bool fileNamesEqual(const QString &fn1, const QString &fn2);
+ inline auto stripTrailingSlash(QStringView s)
+ {
+ if (s.endsWith(QLatin1Char('/'))) {
+ s.chop(1);
+ }
+ return s.toString();
+ }
+
// Call the given command with the switch --version and rerun the first line
// of the output.
// If command is empty, the function calls the running application which, on