diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-07-09 18:49:13 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-07-16 15:44:18 +0000 |
commit | eb9da60f0c87cb4a3b2b26a66888c0f95cdfa6b4 (patch) | |
tree | b0c38104c49b682360b42fdbe9936af193965490 /qmake/meta.cpp | |
parent | e2b90768ae2e19fe1a888c4a0ea9f5b31a973811 (diff) |
qmake: purge infra for supporting multiple formats from QMakeMetaInfo
only .prl is actually supported (and we expect this to remain the case),
so just simplify the code.
Change-Id: Ia23f9f257bf89ca214c3deabd8a7744b155c7aa9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'qmake/meta.cpp')
-rw-r--r-- | qmake/meta.cpp | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/qmake/meta.cpp b/qmake/meta.cpp index 9149b87321..a3e5024137 100644 --- a/qmake/meta.cpp +++ b/qmake/meta.cpp @@ -50,23 +50,12 @@ QMakeMetaInfo::readLib(const QString &meta_file) return true; } - bool ret = false; - if(!meta_file.isNull()) { - if (meta_file.endsWith(Option::prl_ext)) { - QMakeProject proj; - if (!proj.read(Option::normalizePath(meta_file), QMakeEvaluator::LoadProOnly)) - return false; - meta_type = "qmake"; - vars = proj.variables(); - ret = true; - } else { - warn_msg(WarnLogic, "QMakeMetaInfo: unknown file format for %s", - QDir::toNativeSeparators(meta_file).toLatin1().constData()); - } - } - if(ret) - cache_vars.insert(meta_file, vars); - return ret; + QMakeProject proj; + if (!proj.read(Option::normalizePath(meta_file), QMakeEvaluator::LoadProOnly)) + return false; + vars = proj.variables(); + cache_vars.insert(meta_file, vars); + return true; } @@ -74,19 +63,10 @@ QString QMakeMetaInfo::findLib(const QString &lib) { QString ret; - QString extns[] = { Option::prl_ext, QString() }; - for(int extn = 0; !extns[extn].isNull(); extn++) { - if(lib.endsWith(extns[extn])) - ret = QFile::exists(lib) ? lib : QString(); - } - if(ret.isNull()) { - for(int extn = 0; !extns[extn].isNull(); extn++) { - if(QFile::exists(lib + extns[extn])) { - ret = lib + extns[extn]; - break; - } - } - } + if (lib.endsWith(Option::prl_ext)) + ret = QFile::exists(lib) ? lib : QString(); + else if (QFile::exists(lib + Option::prl_ext)) + ret = lib + Option::prl_ext; if(ret.isNull()) { debug_msg(2, "QMakeMetaInfo: Cannot find info file for %s", lib.toLatin1().constData()); } else { |