diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-02-23 17:05:28 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-28 09:13:31 +0100 |
commit | 059200a44ba7177d0c9ec6bb5e6ee0b7e0c3f017 (patch) | |
tree | 7642a3980b3f4bbc082acfaa4b583c97ca683783 /qmake/project.cpp | |
parent | bf29a8a27dad02f4956695e60e5be929e5ede039 (diff) |
move .qmake.cache search to Option
this is a one-time operation which depends only on the invocation, so
this new home is much more appropriate.
Change-Id: I11ef30a8227afed06e58e64e65809dba25e81567
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'qmake/project.cpp')
-rw-r--r-- | qmake/project.cpp | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp index 0445c8eee9..1179812b1b 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -1281,35 +1281,9 @@ QMakeProject::read(uchar cmd) base_vars["TEMPLATE_PREFIX"] = QStringList(Option::user_template_prefix); if ((cmd & ReadSetup) && Option::mkfile::do_cache) { // parse the cache - int cache_depth = -1; - QString qmake_cache = Option::mkfile::cachefile; - if(qmake_cache.isEmpty()) { //find it as it has not been specified - QString dir = Option::output_dir; - while(!QFile::exists((qmake_cache = dir + QLatin1String("/.qmake.cache")))) { - dir = dir.left(dir.lastIndexOf(QLatin1Char('/'))); - if(dir.isEmpty() || dir.indexOf(QLatin1Char('/')) == -1) { - qmake_cache = ""; - break; - } - if(cache_depth == -1) - cache_depth = 1; - else - cache_depth++; - } - } else { - QString abs_cache = QFileInfo(Option::mkfile::cachefile).absoluteDir().path(); - if(Option::output_dir.startsWith(abs_cache)) - cache_depth = Option::output_dir.mid(abs_cache.length()).count('/'); - } - if(!qmake_cache.isEmpty()) { - QHash<QString, QStringList> cache; - if(read(qmake_cache, cache)) { - Option::mkfile::cachefile_depth = cache_depth; - Option::mkfile::cachefile = qmake_cache; - if(Option::mkfile::qmakespec.isEmpty() && !cache["QMAKESPEC"].isEmpty()) - Option::mkfile::qmakespec = cache["QMAKESPEC"].first(); - } - } + if (Option::output_dir.startsWith(Option::mkfile::project_build_root)) + Option::mkfile::cachefile_depth = + Option::output_dir.mid(Option::mkfile::project_build_root.length()).count('/'); } if (cmd & ReadSetup) { // parse mkspec QString qmakespec = fixEnvVariables(Option::mkfile::qmakespec); |