Commit ec1bc282 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

Merge remote branch 'origin/2.0'

Conflicts:
	src/shared/proparser/profileevaluator.cpp
parents af44136e 51a75e3c
......@@ -10,6 +10,7 @@ class QmlProjectItemPrivate : public QObject {
public:
QString sourceDirectory;
QStringList importPaths;
QStringList absoluteImportPaths;
QList<QmlFileFilterItem*> qmlFileFilters() const;
......@@ -77,23 +78,34 @@ void QmlProjectItem::setSourceDirectory(const QString &directoryPath)
}
}
setImportPaths(d->importPaths);
emit sourceDirectoryChanged();
}
QStringList QmlProjectItem::importPaths() const
{
Q_D(const QmlProjectItem);
return d->importPaths;
return d->absoluteImportPaths;
}
void QmlProjectItem::setImportPaths(const QStringList &importPaths)
{
Q_D(QmlProjectItem);
if (d->importPaths == importPaths)
if (d->importPaths != importPaths)
d->importPaths = importPaths;
// convert to absolute paths
QStringList absoluteImportPaths;
const QDir sourceDir(sourceDirectory());
foreach (const QString &importPath, importPaths)
absoluteImportPaths += QDir::cleanPath(sourceDir.absoluteFilePath(importPath));
if (d->absoluteImportPaths == absoluteImportPaths)
return;
d->importPaths = importPaths;
d->absoluteImportPaths = absoluteImportPaths;
emit importPathsChanged();
}
......
......@@ -156,7 +156,7 @@ Core::GeneratedFiles QmlProjectApplicationWizard::generateFiles(const QWizard *w
<< " }" << endl
//: Comment added to generated .qmlproject file
<< " /* " << tr("List of plugin directories passed to QML runtime", "qmlproject Template") << " */" << endl
<< " // importPaths: [ \" ../exampleplugin \" ]" << endl
<< " // importPaths: [ \"../exampleplugin\" ]" << endl
<< "}" << endl;
}
Core::GeneratedFile generatedCreatorFile(creatorFileName);
......
......@@ -172,7 +172,7 @@ Core::GeneratedFiles QmlProjectImportWizard::generateFiles(const QWizard *w,
<< " }" << endl
//: Comment added to generated .qmlproject file
<< " /* " << tr("List of plugin directories passed to QML runtime", "qmlproject Template") << " */" << endl
<< " // importPaths: [ \" ../exampleplugin \" ]" << endl
<< " // importPaths: [ \"../exampleplugin\" ]" << endl
<< "}" << endl;
}
Core::GeneratedFile generatedCreatorFile(creatorFileName);
......
......@@ -1048,10 +1048,28 @@ void ProFileEvaluator::Private::visitProVariable(
m_filevaluemap[currentProFile()][varName] = varVal;
}
} else {
// We are greedy for values.
zipEmpty(&varVal);
valuesRef(varName) += varVal;
m_filevaluemap[currentProFile()][varName] += varVal;
if (!varVal.isEmpty()) {
// We are greedy for values. But avoid exponential growth.
ProStringList &v = valuesRef(varName);
if (v.isEmpty()) {
v = varVal;
} else {
ProStringList old = v;
v = varVal;
QSet<ProString> has;
has.reserve(v.size());
foreach (const ProString &s, v)
has.insert(s);
v.reserve(v.size() + old.size());
foreach (const ProString &s, old)
if (!has.contains(s))
v << s;
}
// These values will not be used for further processing inside
// the evaluator. Duplicate elimination happens later.
m_filevaluemap[currentProFile()][varName] += varVal;
}
}
break;
case TokAppendUnique: // *=
......@@ -3140,7 +3158,7 @@ ProFileEvaluator::TemplateType ProFileEvaluator::templateType() const
{
const ProStringList &templ = d->values(statics.strTEMPLATE);
if (templ.count() >= 1) {
const QString &t = templ.last().toQString();
const QString &t = templ.at(0).toQString();
if (!t.compare(QLatin1String("app"), Qt::CaseInsensitive))
return TT_Application;
if (!t.compare(QLatin1String("lib"), Qt::CaseInsensitive))
......
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