Commit 18f8097a authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

unobfuscate in multiple ways: getcwd() => currentDirectory()

parent 163083c4
...@@ -188,7 +188,7 @@ public: ...@@ -188,7 +188,7 @@ public:
QString format(const char *format) const; QString format(const char *format) const;
QString currentFileName() const; QString currentFileName() const;
QString getcwd() const; QString currentDirectory() const;
ProFile *currentProFile() const; ProFile *currentProFile() const;
bool evaluateConditionalFunction(const QString &function, const QString &arguments, bool *result); bool evaluateConditionalFunction(const QString &function, const QString &arguments, bool *result);
...@@ -958,7 +958,7 @@ QString ProFileEvaluator::Private::currentFileName() const ...@@ -958,7 +958,7 @@ QString ProFileEvaluator::Private::currentFileName() const
return QString(); return QString();
} }
QString ProFileEvaluator::Private::getcwd() const QString ProFileEvaluator::Private::currentDirectory() const
{ {
ProFile *cur = m_profileStack.top(); ProFile *cur = m_profileStack.top();
QFileInfo fi(cur->fileName()); QFileInfo fi(cur->fileName());
...@@ -1747,7 +1747,7 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct ...@@ -1747,7 +1747,7 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct
} }
QString fileName = args.first(); QString fileName = args.first();
// ### this breaks if we have include(c:/reallystupid.pri) but IMHO that's really bad style. // ### this breaks if we have include(c:/reallystupid.pri) but IMHO that's really bad style.
QDir currentProPath(getcwd()); QDir currentProPath(currentDirectory());
fileName = QDir::cleanPath(currentProPath.absoluteFilePath(fileName)); fileName = QDir::cleanPath(currentProPath.absoluteFilePath(fileName));
ok = evaluateFile(fileName, &ok); ok = evaluateFile(fileName, &ok);
break; break;
...@@ -1834,7 +1834,7 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct ...@@ -1834,7 +1834,7 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct
break; break;
} }
//regular expression I guess //regular expression I guess
QString dirstr = getcwd(); QString dirstr = currentDirectory();
int slsh = file.lastIndexOf(Option::dir_sep); int slsh = file.lastIndexOf(Option::dir_sep);
if (slsh != -1) { if (slsh != -1) {
dirstr = file.left(slsh+1); dirstr = file.left(slsh+1);
...@@ -1873,7 +1873,7 @@ QStringList ProFileEvaluator::Private::values(const QString &variableName, ...@@ -1873,7 +1873,7 @@ QStringList ProFileEvaluator::Private::values(const QString &variableName,
return QStringList(m_outputDir); return QStringList(m_outputDir);
if (variableName == QLatin1String("PWD") || //current working dir (of _FILE_) if (variableName == QLatin1String("PWD") || //current working dir (of _FILE_)
variableName == QLatin1String("IN_PWD")) variableName == QLatin1String("IN_PWD"))
return QStringList(getcwd()); return QStringList(currentDirectory());
if (variableName == QLatin1String("DIR_SEPARATOR")) if (variableName == QLatin1String("DIR_SEPARATOR"))
return QStringList(Option::dir_sep); return QStringList(Option::dir_sep);
if (variableName == QLatin1String("DIRLIST_SEPARATOR")) if (variableName == QLatin1String("DIRLIST_SEPARATOR"))
......
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