Commit d8457b63 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Check if the puppet source are newer than puppet



And recompile puppet in that case.

Change-Id: Ia19d54aaa83a4b267de515b6eac5d367f943d7c6
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent 24be5840
......@@ -78,6 +78,31 @@ QDateTime PuppetCreator::qtLastModified() const
return QDateTime();
}
QDateTime PuppetCreator::puppetSourceLastModified() const
{
QString basePuppetSourcePath = puppetSourceDirectoryPath();
QStringList sourceDirectoryPathes;
QDateTime lastModified;
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 directoryPathLastModified = QFileInfo(directoryPath).lastModified();
if (lastModified < directoryPathLastModified)
lastModified = directoryPathLastModified;
}
return lastModified;
}
PuppetCreator::PuppetCreator(ProjectExplorer::Kit *kit, const QString &qtCreatorVersion)
: m_qtCreatorVersion(qtCreatorVersion),
m_kit(kit),
......@@ -379,8 +404,13 @@ QString PuppetCreator::qmlpuppetProjectFile()
bool PuppetCreator::checkPuppetIsReady(const QString &puppetPath) const
{
QFileInfo puppetFileInfo(puppetPath);
if (puppetFileInfo.exists()) {
QDateTime puppetExecutableLastModified = puppetFileInfo.lastModified();
return puppetExecutableLastModified > qtLastModified() && puppetExecutableLastModified > puppetSourceLastModified();
}
return puppetFileInfo.exists() && puppetFileInfo.lastModified() > qtLastModified();
return false;
}
bool PuppetCreator::checkQml2puppetIsReady() const
......
......@@ -107,6 +107,7 @@ protected:
QByteArray qtHash() const;
QDateTime qtLastModified() const;
QDateTime puppetSourceLastModified() const;
private:
QString m_qtCreatorVersion;
......
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