Skip to content

Commit

Permalink
fix config dir migration on linux
Browse files Browse the repository at this point in the history
Signed-off-by: kaikli <[email protected]>
  • Loading branch information
kaikli committed Dec 18, 2024
1 parent 6266424 commit de8e3df
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,15 @@ void Application::setupConfigFile()
return;
}

const QStringList filesList =
!Utility::isWindows()
? QDir(oldDir).entryList(QDir::Files).filter(QRegularExpression("^(?!.*\\.log).*$"))
: QDir(oldDir).entryList(QDir::Files);

if (filesList.isEmpty()) {
return;
}

auto confDir = ConfigFile().configPath();

// macOS 10.11.x does not like trailing slash for rename/move.
Expand All @@ -552,7 +561,6 @@ void Application::setupConfigFile()

// Try to move the files one by one
if (QFileInfo(confDir).isDir() || QDir().mkdir(confDir)) {
const QStringList filesList = QDir(oldDir).entryList(QDir::Files);
qCInfo(lcApplication) << "Will move the individual files" << filesList;
for (const auto &name : filesList) {
if (!QFile::rename(oldDir + "/" + name, confDir + "/" + name)) {
Expand Down

0 comments on commit de8e3df

Please sign in to comment.