From: Camila Date: Tue, 27 Dec 2022 17:25:23 +0000 (+0100) Subject: Look for a previous config file with a different name. X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~11^2~23^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dbce267feb12842b4a35440a0f847be648964b89;p=nextcloud-desktop.git Look for a previous config file with a different name. Signed-off-by: Camila --- diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 2aa726ffa..d6c6db292 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -143,6 +143,17 @@ bool Application::configVersionMigration() // (The client version is adjusted further down) bool versionChanged = configFile.clientVersionString() != MIRALL_VERSION_STRING; + if (versionChanged) { + QDir directory(configFile.configPath()); + const auto anyConfigFileList = directory.entryInfoList({"*.cfg"}, QDir::Files); + for (const auto &file : anyConfigFileList) { + if (file.baseName() != APPLICATION_CONFIG_NAME) { + QFile::rename(file.canonicalFilePath(), configFile.configFile()); + break; + } + } + } + // We want to message the user either for destructive changes, // or if we're ignoring something and the client version changed. bool warningMessage = !deleteKeys.isEmpty() || (!ignoreKeys.isEmpty() && versionChanged);