Merge remote-tracking branch 'origin/5.0'

Change-Id: I4236e3d2f87d56aea787905f4b78b1f5f933c069
This commit is contained in:
Eike Ziller
2021-08-03 14:19:44 +02:00
37 changed files with 406 additions and 226 deletions

View File

@@ -203,31 +203,6 @@ static inline int askMsgSendFailed()
QMessageBox::Retry);
}
// taken from utils/fileutils.cpp. We cannot use utils here since that depends app_version.h.
static bool copyRecursively(const QString &srcFilePath, const QString &tgtFilePath)
{
QFileInfo srcFileInfo(srcFilePath);
if (srcFileInfo.isDir()) {
QDir targetDir(tgtFilePath);
targetDir.cdUp();
if (!targetDir.mkdir(Utils::FilePath::fromString(tgtFilePath).fileName()))
return false;
QDir sourceDir(srcFilePath);
const QStringList fileNames = sourceDir.entryList
(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System);
for (const QString &fileName : fileNames) {
const QString newSrcFilePath = srcFilePath + '/' + fileName;
const QString newTgtFilePath = tgtFilePath + '/' + fileName;
if (!copyRecursively(newSrcFilePath, newTgtFilePath))
return false;
}
} else {
if (!QFile::copy(srcFilePath, tgtFilePath))
return false;
}
return true;
}
static inline QStringList getPluginPaths()
{
QStringList rc(QDir::cleanPath(QApplication::applicationDirPath()