Commit 031666c6 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Rewrite SettingsAccessor::settingsFiles()

This no longer has the default name first, but that does
not matter since we check all files anyway.

Change-Id: Ib3505d2cafa57e86290237e74dd1f89374da4509
Reviewed-by: default avatarDaniel Teske <>
parent 327abfb3
......@@ -776,24 +776,28 @@ bool SettingsAccessor::addVersionUpgrader(VersionUpgrader *upgrader)
return true;
/* Will always return the default name first */
/* Will always return the default name first (if applicable) */
QList<FileName> SettingsAccessor::settingsFiles(const QString &suffix) const
const QString defaultName = defaultFileName(suffix);
QDir projectDir = QDir(project()->projectDirectory().toString());
QList<Utils::FileName> result;
if (QFileInfo(defaultName).exists())
result << Utils::FileName::fromString(defaultName);
QFileInfoList fiList = projectDir.entryInfoList(
QStringList(QFileInfo(defaultName).fileName() + QLatin1String("*")), QDir::Files);
const Utils::FileName baseName = project()->projectFilePath();
QFileInfo fi = baseName.toFileInfo();
QDir dir = QDir(fi.absolutePath());
QString filter = fi.fileName() + suffix + QLatin1String("*");
QFileInfoList list = dir.entryInfoList(QStringList() << filter, QDir::Files);
foreach (const QFileInfo &fi, fiList) {
foreach (const QFileInfo &fi, list) {
const Utils::FileName path = Utils::FileName::fromString(fi.absoluteFilePath());
if (!result.contains(path))
if (!result.contains(path)) {
if (path.endsWith(suffix))
return result;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment