summaryrefslogtreecommitdiffstats
path: root/qmake/main.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgads@gmail.com>2011-11-15 10:34:38 +0200
committerQt by Nokia <qt-info@nokia.com>2012-01-19 00:17:32 +0100
commitf9b94a7ee13e7b8a1c1482391d935a2d5a754848 (patch)
tree7449c77074c7bdc09d5e2366438ba054ca479a65 /qmake/main.cpp
parent711f367d8f4a1f55c59ff7cdda743b2b3bd5e265 (diff)
qmake: Normalize paths instead of converting to native separators
Task-number: QTBUG-22738 Change-Id: I40163a883d84beff79f52bff141d61dfe921c129 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'qmake/main.cpp')
-rw-r--r--qmake/main.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/qmake/main.cpp b/qmake/main.cpp
index 99015177b2..150e12bd3c 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -103,8 +103,8 @@ int runQMake(int argc, char **argv)
if(!(oldpwd.length() == 3 && oldpwd[0].isLetter() && oldpwd.endsWith(":/")))
#endif
{
- if(oldpwd.right(1) != QString(QChar(QDir::separator())))
- oldpwd += QDir::separator();
+ if(!oldpwd.endsWith(QLatin1Char('/')))
+ oldpwd += QLatin1Char('/');
}
Option::output_dir = oldpwd; //for now this is the output dir
@@ -141,28 +141,33 @@ int runQMake(int argc, char **argv)
for(QStringList::Iterator pfile = files.begin(); pfile != files.end(); pfile++) {
if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
Option::qmake_mode == Option::QMAKE_GENERATE_PRL) {
- QString fn = Option::fixPathToLocalOS((*pfile));
+ QString fn = Option::normalizePath(*pfile);
if(!QFile::exists(fn)) {
- fprintf(stderr, "Cannot find file: %s.\n", fn.toLatin1().constData());
+ fprintf(stderr, "Cannot find file: %s.\n",
+ QDir::toNativeSeparators(fn).toLatin1().constData());
exit_val = 2;
continue;
}
//setup pwd properly
- debug_msg(1, "Resetting dir to: %s", oldpwd.toLatin1().constData());
+ debug_msg(1, "Resetting dir to: %s",
+ QDir::toNativeSeparators(oldpwd).toLatin1().constData());
qmake_setpwd(oldpwd); //reset the old pwd
- int di = fn.lastIndexOf(QDir::separator());
+ int di = fn.lastIndexOf(QLatin1Char('/'));
if(di != -1) {
- debug_msg(1, "Changing dir to: %s", fn.left(di).toLatin1().constData());
+ debug_msg(1, "Changing dir to: %s",
+ QDir::toNativeSeparators(fn.left(di)).toLatin1().constData());
if(!qmake_setpwd(fn.left(di)))
- fprintf(stderr, "Cannot find directory: %s\n", fn.left(di).toLatin1().constData());
+ fprintf(stderr, "Cannot find directory: %s\n",
+ QDir::toNativeSeparators(fn.left(di)).toLatin1().constData());
fn = fn.right(fn.length() - di - 1);
}
// read project..
if(!project.read(fn)) {
fprintf(stderr, "Error processing project file: %s\n",
- fn == "-" ? "(stdin)" : (*pfile).toLatin1().constData());
+ fn == QLatin1String("-") ?
+ "(stdin)" : QDir::toNativeSeparators(*pfile).toLatin1().constData());
exit_val = 3;
continue;
}
@@ -179,7 +184,8 @@ int runQMake(int argc, char **argv)
if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT)
fprintf(stderr, "Unable to generate project file.\n");
else
- fprintf(stderr, "Unable to generate makefile for: %s\n", (*pfile).toLatin1().constData());
+ fprintf(stderr, "Unable to generate makefile for: %s\n",
+ QDir::toNativeSeparators(*pfile).toLatin1().constData());
exit_val = 5;
}
delete mkfile;