mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Look for a previous config file with a different name.
Signed-off-by: Camila <hello@camila.codes>
This commit is contained in:
parent
bf258542cd
commit
dbce267feb
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user