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 <75146125+kaikli@users.noreply.github.com>
  • Loading branch information
kaikli committed Dec 16, 2024
1 parent f00f320 commit 599b02a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,12 @@ void Application::setupConfigFile()
oldDir.chop(1);
}

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

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

Expand All @@ -552,7 +557,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 599b02a

Please sign in to comment.