summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2014-11-24 16:02:38 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-02-17 18:27:44 +0000
commite0962270d74db5950b9567d4996189f115a1c75a (patch)
tree45fd68d3c18cb57ca1c1d17912c3478f2cf97c3f /qmake/generators/win32
parent1cacf1e70d01cc989d973739ce4d5c7f00c5068c (diff)
replace incorrect uses of fixPathToLocalOS() (mostly)
in most cases, it actually means normalizePath() (because the file name is used with qt i/o functions afterwards). this affects QMakeLocalFile::local() as well, so many not immediately obvious places are affected as well. there was also one case of fixPathToTargetOS() falling into this category. this is mostly a no-op, as the qt functions are agnostic to the path separator. in some other cases (in particular in the vcproj generator), it actually means fixPathToTargetOS(). this is mostly a no-op as well, as the two functions are equal except on msys anyway. in the <meta file>FileName() functions, the use of a fixPath*() function is bogus in the first place - fileFixify() already does fixPathToTargetOS(), and this is correct when the file name is used verbatim in a make command (which it is). otherwise it's irrelevant. Change-Id: I26712da8f888c704f8b7f42dbe24c941b6ad031d Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r--qmake/generators/win32/mingw_make.cpp6
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp6
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp4
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp17
-rw-r--r--qmake/generators/win32/winmakefile.cpp12
5 files changed, 23 insertions, 22 deletions
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index b5bb7b5b7e..af5e62330e 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -91,9 +91,9 @@ bool MingwMakefileGenerator::findLibraries()
if (ver > 0)
extension += QString::number(ver);
extension += suffix;
- if(QMakeMetaInfo::libExists((*dir_it).local() + Option::dir_sep + steam) ||
- exists((*dir_it).local() + Option::dir_sep + steam + extension + ".a") ||
- exists((*dir_it).local() + Option::dir_sep + steam + extension + ".dll.a")) {
+ if (QMakeMetaInfo::libExists((*dir_it).local() + '/' + steam)
+ || exists((*dir_it).local() + '/' + steam + extension + ".a")
+ || exists((*dir_it).local() + '/' + steam + extension + ".dll.a")) {
out = *it + extension;
break;
}
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index a6ca07efee..3bb70c5c19 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -1900,11 +1900,11 @@ bool VCXProjectWriter::outputFileConfig(OutputFilterData *d, XmlOutput &xml, Xml
fileAdded = true;
xmlFilter << tag("CustomBuild")
- << attrTag("Include",Option::fixPathToLocalOS(filename))
+ << attrTag("Include", Option::fixPathToTargetOS(filename))
<< attrTagS("Filter", filter.Name);
xml << tag("CustomBuild")
- << attrTag("Include",Option::fixPathToLocalOS(filename));
+ << attrTag("Include", Option::fixPathToTargetOS(filename));
if (filter.Name.startsWith("Form Files")
|| filter.Name.startsWith("Generated Files")
@@ -1963,7 +1963,7 @@ bool VCXProjectWriter::outputFileConfig(OutputFilterData *d, XmlOutput &xml, Xml
void VCXProjectWriter::outputFileConfig(XmlOutput &xml, XmlOutput &xmlFilter,
const QString &filePath, const QString &filterName)
{
- const QString nativeFilePath = Option::fixPathToLocalOS(filePath);
+ const QString nativeFilePath = Option::fixPathToTargetOS(filePath);
if (filterName.startsWith("Source Files")) {
xmlFilter << tag("ClCompile")
<< attrTag("Include", nativeFilePath)
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 913e2a26ce..4a65d24687 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -2901,7 +2901,7 @@ void VCProjectWriter::write(XmlOutput &xml, VCFilter &tool)
for (int i = 0; i < tool.Files.count(); ++i) {
const VCFilterFile &info = tool.Files.at(i);
xml << tag(q_File)
- << attrS(_RelativePath, Option::fixPathToLocalOS(info.file))
+ << attrS(_RelativePath, Option::fixPathToTargetOS(info.file))
<< data(); // In case no custom builds, to avoid "/>" endings
outputFileConfig(tool, xml, tool.Files.at(i).file);
xml << closetag(q_File);
@@ -2960,7 +2960,7 @@ void VCProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, const QSt
void VCProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, const VCFilterFile &info, const QString &filtername)
{
xml << tag(q_File)
- << attrS(_RelativePath, Option::fixPathToLocalOS(info.file));
+ << attrS(_RelativePath, Option::fixPathToTargetOS(info.file));
for (int i = 0; i < project.SingleProjects.count(); ++i) {
VCFilter filter = project.SingleProjects.at(i).filterByName(filtername);
if (filter.Config) // only if the filter is not empty
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 5da6f5807d..57557732c5 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -324,7 +324,8 @@ QUuid VcprojGenerator::getProjectUUID(const QString &filename)
// If none, create one based on the MD5 of absolute project path
if(uuid.isNull() || !filename.isEmpty()) {
- QString abspath = Option::fixPathToLocalOS(filename.isEmpty()?project->first("QMAKE_MAKEFILE").toQString():filename);
+ QString abspath = Option::fixPathToTargetOS(
+ filename.isEmpty() ? project->first("QMAKE_MAKEFILE").toQString() : filename);
QByteArray digest = QCryptographicHash::hash(abspath.toUtf8(), QCryptographicHash::Sha1);
memcpy((unsigned char*)(&uuid), digest.constData(), sizeof(QUuid));
validUUID = !uuid.isNull();
@@ -457,14 +458,14 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
while (collectedIt.hasNext()) {
QPair<QString, ProStringList> subdir = collectedIt.next();
QString profile = subdir.first;
- QFileInfo fi(fileInfo(Option::fixPathToLocalOS(profile, true)));
+ QFileInfo fi(fileInfo(Option::normalizePath(profile)));
if (fi.exists()) {
if (fi.isDir()) {
if (!profile.endsWith(Option::dir_sep))
profile += Option::dir_sep;
profile += fi.baseName() + Option::pro_ext;
QString profileKey = fi.absoluteFilePath();
- fi = QFileInfo(fileInfo(Option::fixPathToLocalOS(profile, true)));
+ fi = QFileInfo(fileInfo(Option::normalizePath(profile)));
if (!fi.exists())
continue;
projLookup.insert(profileKey, fi.absoluteFilePath());
@@ -1344,13 +1345,13 @@ void VcprojGenerator::initDeploymentTool()
|| devicePath.at(0) == QLatin1Char('\\')
|| devicePath.at(0) == QLatin1Char('%'))) {
// create output path
- devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('\\') + devicePath));
+ devicePath = Option::fixPathToTargetOS(targetPath + QLatin1Char('\\') + devicePath);
}
}
// foreach d in item.files
foreach (const ProString &src, project->values(ProKey(item + ".files"))) {
QString itemDevicePath = devicePath;
- QString source = Option::fixPathToLocalOS(src.toQString());
+ QString source = Option::normalizePath(src.toQString());
QString nameFilter;
QFileInfo info(source);
QString searchPath;
@@ -1359,7 +1360,7 @@ void VcprojGenerator::initDeploymentTool()
itemDevicePath += "\\" + info.fileName();
searchPath = info.absoluteFilePath();
} else {
- nameFilter = source.split('\\').last();
+ nameFilter = info.fileName();
searchPath = info.absolutePath();
}
@@ -1371,10 +1372,10 @@ void VcprojGenerator::initDeploymentTool()
while(iterator.hasNext()) {
iterator.next();
if (conf.WinRT) {
- QString absoluteItemFilePath = Option::fixPathToLocalOS(QFileInfo(iterator.filePath()).absoluteFilePath());
+ QString absoluteItemFilePath = Option::fixPathToTargetOS(QFileInfo(iterator.filePath()).absoluteFilePath());
vcProject.DeploymentFiles.addFile(absoluteItemFilePath);
} else {
- QString absoluteItemPath = Option::fixPathToLocalOS(QFileInfo(iterator.filePath()).absolutePath());
+ QString absoluteItemPath = Option::fixPathToTargetOS(QFileInfo(iterator.filePath()).absolutePath());
// Identify if it is just another subdir
int diffSize = absoluteItemPath.size() - pathSize;
// write out rules
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index bcacdb0615..69a3e9c783 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -52,12 +52,12 @@ Win32MakefileGenerator::Win32MakefileGenerator() : MakefileGenerator()
int
Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem, const QString &ext)
{
- QString bd = Option::fixPathToLocalOS(d, true);
+ QString bd = Option::normalizePath(d);
if(!exists(bd))
return -1;
QMakeMetaInfo libinfo(project);
- bool libInfoRead = libinfo.readLib(bd + Option::dir_sep + stem);
+ bool libInfoRead = libinfo.readLib(bd + '/' + stem);
// If the library, for which we're trying to find the highest version
// number, is a static library
@@ -146,8 +146,8 @@ Win32MakefileGenerator::findLibraries()
extension += QString::number(ver);
extension += suffix;
extension += ".lib";
- if(QMakeMetaInfo::libExists((*it).local() + Option::dir_sep + lib) ||
- exists((*it).local() + Option::dir_sep + lib + extension)) {
+ if (QMakeMetaInfo::libExists((*it).local() + '/' + lib)
+ || exists((*it).local() + '/' + lib + extension)) {
out = (*it).real() + Option::dir_sep + lib + extension;
break;
}
@@ -156,7 +156,7 @@ Win32MakefileGenerator::findLibraries()
if(out.isEmpty())
out = lib + ".lib";
(*it) = out;
- } else if(!exists(Option::fixPathToLocalOS(opt))) {
+ } else if (!exists(Option::normalizePath(opt))) {
QList<QMakeLocalFileName> lib_dirs;
QString file = Option::fixPathToTargetOS(opt);
int slsh = file.lastIndexOf(Option::dir_sep);
@@ -223,7 +223,7 @@ Win32MakefileGenerator::processPrlFiles()
else
tmp = opt;
for(QList<QMakeLocalFileName>::Iterator it = libdirs.begin(); it != libdirs.end(); ++it) {
- QString prl = (*it).local() + Option::dir_sep + tmp;
+ QString prl = (*it).local() + '/' + tmp;
if (processPrlFile(prl))
break;
}