summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-04-20 14:28:58 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-05-06 09:35:23 (GMT)
commit9cd62e4f7b23894a672297f6eebda64cdbd53cb0 (patch)
tree1bf434f9323d1a51020a6306eab894d23ce175c0
parente6bb6ba76942d98e4b50a7fd32bf44e211f2fa5e (diff)
downloadQt-9cd62e4f7b23894a672297f6eebda64cdbd53cb0.zip
Qt-9cd62e4f7b23894a672297f6eebda64cdbd53cb0.tar.gz
Qt-9cd62e4f7b23894a672297f6eebda64cdbd53cb0.tar.bz2
make QLibraryInfo return clean paths
as a side effect, don't use QDir for path resolution - it doesn't buy us anything. Task-number: QTBUG-1371 Reviewed-by: joerg
-rw-r--r--src/corelib/global/qlibraryinfo.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index e69e0a6..6060dde 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -450,10 +450,11 @@ QLibraryInfo::location(LibraryLocation loc)
}
if (QDir::isRelativePath(ret)) {
+ QString baseDir;
if (loc == PrefixPath) {
// we make the prefix path absolute to the executable's directory
#ifdef BOOTSTRAPPING
- return QDir(QFileInfo(qmake_libraryInfoFile()).absolutePath()).absoluteFilePath(ret);
+ baseDir = QFileInfo(qmake_libraryInfoFile()).absolutePath();
#else
if (QCoreApplication::instance()) {
#ifdef Q_OS_MAC
@@ -466,15 +467,16 @@ QLibraryInfo::location(LibraryLocation loc)
}
}
#endif
- return QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(ret);
+ baseDir = QCoreApplication::applicationDirPath();
} else {
- return QDir::current().absoluteFilePath(ret);
+ baseDir = QDir::currentPath();
}
#endif
} else {
// we make any other path absolute to the prefix directory
- return QDir(location(PrefixPath)).absoluteFilePath(ret);
+ baseDir = location(PrefixPath);
}
+ ret = QDir::cleanPath(baseDir + QLatin1Char('/') + ret);
}
return ret;
}