Commit 7ed0385e authored by Tim Jenssen's avatar Tim Jenssen

QmlDesigner: fix pathes -> paths and use initializer_lists

Change-Id: Ifa155bebd982e798d3ac576cd07ee54d816f5aae
Reviewed-by: Thomas Hartmann's avatarThomas Hartmann <thomas.hartmann@qt.io>
parent 59535078
......@@ -111,23 +111,24 @@ QDateTime PuppetCreator::qtLastModified() const
QDateTime PuppetCreator::puppetSourceLastModified() const
{
QString basePuppetSourcePath = puppetSourceDirectoryPath();
QStringList sourceDirectoryPathes;
QDateTime lastModified;
const QString basePuppetSourcePath = puppetSourceDirectoryPath();
const QStringList sourceDirectoryPaths = {
basePuppetSourcePath + "/commands",
basePuppetSourcePath + "/container",
basePuppetSourcePath + "/instances",
basePuppetSourcePath + "/interfaces",
basePuppetSourcePath + "/types",
basePuppetSourcePath + "/qmlpuppet",
basePuppetSourcePath + "/qmlpuppet/instances",
basePuppetSourcePath + "/qml2puppet",
basePuppetSourcePath + "/qml2puppet/instances"
};
sourceDirectoryPathes.append(basePuppetSourcePath + QStringLiteral("/commands"));
sourceDirectoryPathes.append(basePuppetSourcePath + QStringLiteral("/container"));
sourceDirectoryPathes.append(basePuppetSourcePath + QStringLiteral("/instances"));
sourceDirectoryPathes.append(basePuppetSourcePath + QStringLiteral("/interfaces"));
sourceDirectoryPathes.append(basePuppetSourcePath + QStringLiteral("/types"));
sourceDirectoryPathes.append(basePuppetSourcePath + QStringLiteral("/qmlpuppet"));
sourceDirectoryPathes.append(basePuppetSourcePath + QStringLiteral("/qmlpuppet/instances"));
sourceDirectoryPathes.append(basePuppetSourcePath + QStringLiteral("/qml2puppet"));
sourceDirectoryPathes.append(basePuppetSourcePath + QStringLiteral("/qml2puppet/instances"));
foreach (const QString directoryPath, sourceDirectoryPathes) {
QDateTime lastModified;
foreach (const QString directoryPath, sourceDirectoryPaths) {
foreach (const QFileInfo fileEntry, QDir(directoryPath).entryInfoList()) {
QDateTime filePathLastModified = fileEntry.lastModified();
const QDateTime filePathLastModified = fileEntry.lastModified();
if (lastModified < filePathLastModified)
lastModified = filePathLastModified;
}
......
......@@ -2029,9 +2029,9 @@ void TextToModelMerger::populateQrcMapping(const QString &filePath)
const QString fileName = fileForFullQrcPath(filePath);
path.remove(QLatin1String("qrc:"));
QMap<QString,QStringList> map = ModelManagerInterface::instance()->filesInQrcPath(path);
const QStringList qrcFilePathes = map.value(fileName, QStringList());
if (!qrcFilePathes.isEmpty()) {
QString fileSystemPath = qrcFilePathes.first();
const QStringList qrcFilePaths = map.value(fileName, {});
if (!qrcFilePaths.isEmpty()) {
QString fileSystemPath = qrcFilePaths.first();
fileSystemPath.remove(fileName);
if (path.isEmpty())
path.prepend(QLatin1String("/"));
......
Markdown is supported
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