Commit 3ef1bf0f authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

micro-optimizations & cleanups

parent ebb4e044
...@@ -89,7 +89,7 @@ QList<ProFile*> ProFileReader::includeFiles() const ...@@ -89,7 +89,7 @@ QList<ProFile*> ProFileReader::includeFiles() const
QString ProFileReader::value(const QString &variable) const QString ProFileReader::value(const QString &variable) const
{ {
QStringList vals = values(variable); const QStringList &vals = values(variable);
if (!vals.isEmpty()) if (!vals.isEmpty())
return vals.first(); return vals.first();
......
...@@ -40,7 +40,6 @@ namespace Qt4ProjectManager { ...@@ -40,7 +40,6 @@ namespace Qt4ProjectManager {
class Qt4Project; class Qt4Project;
namespace Internal { namespace Internal {
class ProFileReader;
class Qt4ProFileNode; class Qt4ProFileNode;
class Qt4TargetFactory; class Qt4TargetFactory;
class Qt4BuildConfigurationFactory; class Qt4BuildConfigurationFactory;
......
...@@ -3574,7 +3574,8 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateCondit ...@@ -3574,7 +3574,8 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateCondit
logMessage(format("include(file, into, silent) requires one, two or three arguments.")); logMessage(format("include(file, into, silent) requires one, two or three arguments."));
return ReturnFalse; return ReturnFalse;
} }
QString fn = resolvePath(expandEnvVars(args.at(0).toQString())); QString fn = resolvePath(expandEnvVars(args.at(0).toQString(m_tmp1)));
fn.detach();
bool ok; bool ok;
if (parseInto.isEmpty()) { if (parseInto.isEmpty()) {
ok = evaluateFile(fn); ok = evaluateFile(fn);
...@@ -4147,7 +4148,7 @@ QStringList ProFileEvaluator::absoluteFileValues( ...@@ -4147,7 +4148,7 @@ QStringList ProFileEvaluator::absoluteFileValues(
return result; return result;
} }
ProFileEvaluator::TemplateType ProFileEvaluator::templateType() ProFileEvaluator::TemplateType ProFileEvaluator::templateType() const
{ {
const ProStringList &templ = d->values(statics.strTEMPLATE); const ProStringList &templ = d->values(statics.strTEMPLATE);
if (templ.count() >= 1) { if (templ.count() >= 1) {
......
...@@ -74,7 +74,7 @@ public: ...@@ -74,7 +74,7 @@ public:
ProFileEvaluator(ProFileOption *option); ProFileEvaluator(ProFileOption *option);
virtual ~ProFileEvaluator(); virtual ~ProFileEvaluator();
ProFileEvaluator::TemplateType templateType(); ProFileEvaluator::TemplateType templateType() const;
void setVerbose(bool on); // Default is false void setVerbose(bool on); // Default is false
void setCumulative(bool on); // Default is true! void setCumulative(bool on); // Default is true!
void setOutputDir(const QString &dir); // Default is empty void setOutputDir(const QString &dir); // Default is empty
......
...@@ -335,9 +335,8 @@ ProFile::ProFile(const QString &fileName) ...@@ -335,9 +335,8 @@ ProFile::ProFile(const QString &fileName)
m_fileName(fileName) m_fileName(fileName)
{ {
int nameOff = fileName.lastIndexOf(QLatin1Char('/')); int nameOff = fileName.lastIndexOf(QLatin1Char('/'));
m_displayFileName = QString(fileName.constData() + nameOff + 1, m_displayFileName = fileName.mid(nameOff + 1);
fileName.length() - nameOff - 1); m_directoryName = fileName.left(nameOff);
m_directoryName = QString(fileName.constData(), nameOff);
} }
ProFile::~ProFile() ProFile::~ProFile()
......
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