summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.unix9
-rw-r--r--qmake/Makefile.win3211
-rw-r--r--qmake/Makefile.win32-g++9
-rw-r--r--qmake/Makefile.win32-g++-sh9
-rw-r--r--qmake/generators/makefile.cpp68
-rw-r--r--qmake/generators/metamakefile.cpp4
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp46
-rw-r--r--qmake/option.cpp13
-rw-r--r--qmake/project.cpp6
-rw-r--r--qmake/qmake.pri4
10 files changed, 88 insertions, 91 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index c7f4dc4..6ba5b6b 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -13,7 +13,7 @@ OBJS=project.o property.o main.o makefile.o unixmake2.o unixmake.o \
symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o
#qt code
-QOBJS=qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \
+QOBJS=qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \
qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlistdata.o qfile.o \
qfsfileengine_unix.o qfsfileengine_iterator_unix.o qfsfileengine.o \
qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o \
@@ -47,6 +47,7 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge
generators/win32/msvc_objectmodel.cpp generators/win32/msvc_nmake.cpp generators/win32/borland_bmake.cpp \
generators/symbian/symmake.cpp generators/symbian/initprojectdeploy_symbian.cpp \
generators/symbian/symmake_abld.cpp generators/symbian/symmake_sbsv2.cpp \
+ $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp \
$(SOURCE_PATH)/src/corelib/tools/qstring.cpp $(SOURCE_PATH)/src/corelib/io/qfile.cpp \
$(SOURCE_PATH)/src/corelib/io/qtextstream.cpp $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp \
$(SOURCE_PATH)/src/corelib/global/qmalloc.cpp \
@@ -165,6 +166,12 @@ qcore_mac.o: $(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp
qurl.o: $(SOURCE_PATH)/src/corelib/io/qurl.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qurl.cpp
+qutfcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+
+qtextcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
+
qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 54c2872..40b08eb 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -110,6 +110,8 @@ QTOBJS= \
qmalloc.obj \
qmap.obj \
qregexp.obj \
+ qtextcodec.obj \
+ qutfcodec.obj \
qstring.obj \
qstringlist.obj \
qtextstream.obj \
@@ -198,6 +200,8 @@ clean::
-del qmalloc.obj
-del qmap.obj
-del qregexp.obj
+ -del qtextcodec.obj
+ -del qutfcodec.obj
-del qstring.obj
-del qstringlist.obj
-del qtextstream.obj
@@ -347,6 +351,9 @@ qbytearraymatcher.obj: $(SOURCE_PATH)\src\corelib\tools\qbytearraymatcher.cpp
qchar.obj: $(SOURCE_PATH)\src\corelib\tools\qchar.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qchar.cpp
+qutfcodec.obj: $(SOURCE_PATH)\src\corelib\codecs\qutfcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\codecs\qutfcodec.cpp
+
qstring.obj: $(SOURCE_PATH)\src\corelib\tools\qstring.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qstring.cpp
@@ -389,8 +396,8 @@ qfsfileengine_iterator.obj: $(SOURCE_PATH)\src\corelib\io\qfsfileengine_iterator
qabstractfileengine.obj: $(SOURCE_PATH)\src\corelib\io\qabstractfileengine.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qabstractfileengine.cpp
-qtextcodec.obj: $(SOURCE_PATH)\src\codecs\qtextcodec.cpp
- $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\codecs\qtextcodec.cpp
+qtextcodec.obj: $(SOURCE_PATH)\src\corelib\codecs\qtextcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\codecs\qtextcodec.cpp
qregexp.obj: $(SOURCE_PATH)\src\corelib\tools\qregexp.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qregexp.cpp
diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++
index dd65145..a3ddf11 100644
--- a/qmake/Makefile.win32-g++
+++ b/qmake/Makefile.win32-g++
@@ -75,6 +75,8 @@ QTOBJS= \
qmalloc.o \
qmap.o \
qregexp.o \
+ qtextcodec.o \
+ qutfcodec.o \
qstring.o \
qstringlist.o \
qtextstream.o \
@@ -198,6 +200,9 @@ qvsnprintf.o: $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
+qutfcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+
qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
@@ -237,8 +242,8 @@ qfsfileengine.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp
qfsfileengine_iterator.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
-qtextcodec.o: $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
- $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
+qtextcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
qregexp.o: $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh
index 646815b..85a7e45 100644
--- a/qmake/Makefile.win32-g++-sh
+++ b/qmake/Makefile.win32-g++-sh
@@ -75,6 +75,8 @@ QTOBJS= \
qmalloc.o \
qmap.o \
qregexp.o \
+ qtextcodec.o \
+ qutfcodec.o \
qstring.o \
qstringlist.o \
qtextstream.o \
@@ -197,6 +199,9 @@ qvsnprintf.o: $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
+qutfcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
+
qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
@@ -236,8 +241,8 @@ qfsfileengine.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp
qfsfileengine_iterator.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
-qtextcodec.o: $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
- $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
+qtextcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp
qregexp.o: $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 5eaa39f..4d74573 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -121,7 +121,7 @@ bool MakefileGenerator::mkdir(const QString &in_path) const
QDir d;
if(path.startsWith(QDir::separator())) {
d.cd(QString(QDir::separator()));
- path = path.right(path.length() - 1);
+ path.remove(0, 1);
}
bool ret = true;
#ifdef Q_OS_WIN
@@ -129,7 +129,7 @@ bool MakefileGenerator::mkdir(const QString &in_path) const
if(!QDir::isRelativePath(path)) {
if(QFile::exists(path.left(3))) {
d.cd(path.left(3));
- path = path.right(path.length() - 3);
+ path.remove(0, 3);
} else {
warn_msg(WarnLogic, "Cannot access drive '%s' (%s)",
path.left(3).toLatin1().data(), path.toLatin1().data());
@@ -201,13 +201,13 @@ MakefileGenerator::initOutPaths()
if(Option::mkfile::do_cache && !Option::mkfile::cachefile.isEmpty() &&
v.contains("QMAKE_ABSOLUTE_SOURCE_ROOT")) {
QString root = v["QMAKE_ABSOLUTE_SOURCE_ROOT"].first();
- root = Option::fixPathToTargetOS(root);
+ root = QDir::fromNativeSeparators(root);
if(!root.isEmpty()) {
QFileInfo fi = fileInfo(Option::mkfile::cachefile);
if(!fi.makeAbsolute()) {
QString cache_r = fi.path(), pwd = Option::output_dir;
if(pwd.startsWith(cache_r) && !pwd.startsWith(root)) {
- pwd = Option::fixPathToTargetOS(root + pwd.mid(cache_r.length()));
+ pwd = root + pwd.mid(cache_r.length());
if(exists(pwd))
v.insert("QMAKE_ABSOLUTE_SOURCE_PATH", QStringList(pwd));
}
@@ -217,7 +217,7 @@ MakefileGenerator::initOutPaths()
}
if(!v["QMAKE_ABSOLUTE_SOURCE_PATH"].isEmpty()) {
QString &asp = v["QMAKE_ABSOLUTE_SOURCE_PATH"].first();
- asp = Option::fixPathToTargetOS(asp);
+ asp = QDir::fromNativeSeparators(asp);
if(asp.isEmpty() || asp == Option::output_dir) //if they're the same, why bother?
v["QMAKE_ABSOLUTE_SOURCE_PATH"].clear();
}
@@ -243,7 +243,7 @@ MakefileGenerator::initOutPaths()
if(!(dirs[x] == "DLLDESTDIR"))
#endif
{
- if(pathRef.right(Option::dir_sep.length()) != Option::dir_sep)
+ if(!pathRef.endsWith(Option::dir_sep))
pathRef += Option::dir_sep;
}
@@ -346,7 +346,7 @@ MakefileGenerator::findFilesInVPATH(QStringList l, uchar flags, const QString &v
QString real_dir = Option::fixPathToLocalOS((*vpath_it));
if(exists(real_dir + QDir::separator() + val)) {
QString dir = (*vpath_it);
- if(dir.right(Option::dir_sep.length()) != Option::dir_sep)
+ if(!dir.endsWith(Option::dir_sep))
dir += Option::dir_sep;
val = dir + val;
if(!(flags & VPATH_NoFixify))
@@ -365,7 +365,7 @@ MakefileGenerator::findFilesInVPATH(QStringList l, uchar flags, const QString &v
real_dir = dir;
if(!(flags & VPATH_NoFixify))
real_dir = fileFixify(real_dir, qmake_getpwd(), Option::output_dir);
- regex = regex.right(regex.length() - dir.length());
+ regex.remove(0, dir.length());
}
if(real_dir.isEmpty() || exists(real_dir)) {
QStringList files = QDir(real_dir).entryList(QStringList(regex));
@@ -725,14 +725,14 @@ MakefileGenerator::init()
if(project->isActiveConfig("qmake_cache")) {
QString cache_file;
if(!project->isEmpty("QMAKE_INTERNAL_CACHE_FILE")) {
- cache_file = Option::fixPathToLocalOS(project->first("QMAKE_INTERNAL_CACHE_FILE"));
+ cache_file = QDir::fromNativeSeparators(project->first("QMAKE_INTERNAL_CACHE_FILE"));
} else {
cache_file = ".qmake.internal.cache";
if(project->isActiveConfig("build_pass"))
cache_file += ".BUILD." + project->first("BUILD_PASS");
}
- if(cache_file.indexOf(QDir::separator()) == -1)
- cache_file.prepend(Option::output_dir + QDir::separator());
+ if(cache_file.indexOf('/') == -1)
+ cache_file.prepend(Option::output_dir + '/');
QMakeSourceFileInfo::setCacheFile(cache_file);
}
@@ -789,7 +789,7 @@ MakefileGenerator::init()
QString dir, regex = Option::fixPathToLocalOS((*dep_it));
if(regex.lastIndexOf(Option::dir_sep) != -1) {
dir = regex.left(regex.lastIndexOf(Option::dir_sep) + 1);
- regex = regex.right(regex.length() - dir.length());
+ regex.remove(0, dir.length());
}
QStringList files = QDir(dir).entryList(QStringList(regex));
if(files.isEmpty()) {
@@ -939,7 +939,7 @@ MakefileGenerator::writePrlFile(QTextStream &t)
QString target = project->first("TARGET");
int slsh = target.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- target = target.right(target.length() - slsh - 1);
+ target.remove(0, slsh + 1);
QString bdir = Option::output_dir;
if(bdir.isEmpty())
bdir = qmake_getpwd();
@@ -1057,11 +1057,11 @@ MakefileGenerator::prlFileName(bool fixify)
ret = project->first("TARGET");
int slsh = ret.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- ret = ret.right(ret.length() - slsh);
+ ret.remove(0, slsh);
if(!ret.endsWith(Option::prl_ext)) {
int dot = ret.indexOf('.');
if(dot != -1)
- ret = ret.left(dot);
+ ret.truncate(dot);
ret += Option::prl_ext;
}
if(!project->isEmpty("QMAKE_BUNDLE"))
@@ -1211,7 +1211,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
if(project->values((*it) + ".CONFIG").indexOf("no_path") == -1 &&
project->values((*it) + ".CONFIG").indexOf("dummy_install") == -1) {
dst = fileFixify(unescapeFilePath(project->values(pvar).first()), FileFixifyAbsolute, false);
- if(dst.right(1) != Option::dir_sep)
+ if(!dst.endsWith(Option::dir_sep))
dst += Option::dir_sep;
}
dst = escapeFilePath(dst);
@@ -1240,9 +1240,9 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
int slsh = filestr.lastIndexOf(Option::dir_sep);
if(slsh != -1) {
dirstr = filestr.left(slsh+1);
- filestr = filestr.right(filestr.length() - slsh - 1);
+ filestr.remove(0, slsh+1);
}
- if(dirstr.right(Option::dir_sep.length()) != Option::dir_sep)
+ if(!dirstr.endsWith(Option::dir_sep))
dirstr += Option::dir_sep;
if(exists(wild)) { //real file
QString file = wild;
@@ -1342,7 +1342,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
const QStringList &dirs = project->values(pvar);
for(QStringList::ConstIterator pit = dirs.begin(); pit != dirs.end(); ++pit) {
QString tmp_dst = fileFixify((*pit), FileFixifyAbsolute, false);
- if (!isWindowsShell() && tmp_dst.right(1) != Option::dir_sep)
+ if (!isWindowsShell() && !tmp_dst.endsWith(Option::dir_sep))
tmp_dst += Option::dir_sep;
t << mkdir_p_asstring(filePrefixRoot(root, tmp_dst)) << "\n\t";
}
@@ -2277,8 +2277,8 @@ MakefileGenerator::findSubDirsSubTargets() const
st->profile = file.section(Option::dir_sep, -1) + Option::pro_ext;
st->in_directory = file;
}
- while(st->in_directory.right(1) == Option::dir_sep)
- st->in_directory = st->in_directory.left(st->in_directory.length() - 1);
+ while(st->in_directory.endsWith(Option::dir_sep))
+ st->in_directory.chop(1);
if(fileInfo(st->in_directory).isRelative())
st->out_directory = st->in_directory;
else
@@ -2358,7 +2358,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if (!(flags & SubTargetSkipDefaultVariables)) {
QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
if(ofile.lastIndexOf(Option::dir_sep) != -1)
- ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
+ ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1);
t << "MAKEFILE = " << ofile << endl;
/* Calling Option::fixPathToTargetOS() is necessary for MinGW/MSYS, which requires
* back-slashes to be turned into slashes. */
@@ -2802,11 +2802,13 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q
return cacheVal;
//do the fixin'
- const QString pwd = qmake_getpwd() + "/";
+ QString pwd = qmake_getpwd();
+ if (!pwd.endsWith('/'))
+ pwd += '/';
QString orig_file = ret;
if(ret.startsWith(QLatin1Char('~'))) {
if(ret.startsWith(QLatin1String("~/")))
- ret = QDir::homePath() + Option::dir_sep + ret.mid(1);
+ ret = QDir::homePath() + ret.mid(1);
else
warn_msg(WarnLogic, "Unable to expand ~ in %s", ret.toLatin1().constData());
}
@@ -2895,13 +2897,13 @@ MakefileGenerator::checkMultipleDefinition(const QString &f, const QString &w)
QString file = f;
int slsh = f.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- file = file.right(file.length() - slsh - 1);
+ file.remove(0, slsh + 1);
QStringList &l = project->values(w);
for(QStringList::Iterator val_it = l.begin(); val_it != l.end(); ++val_it) {
QString file2((*val_it));
slsh = file2.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- file2 = file2.right(file2.length() - slsh - 1);
+ file2.remove(0, slsh + 1);
if(file2 == file) {
warn_msg(WarnLogic, "Found potential symbol conflict of %s (%s) in %s",
file.toLatin1().constData(), (*val_it).toLatin1().constData(), w.toLatin1().constData());
@@ -3055,7 +3057,7 @@ MakefileGenerator::openOutput(QFile &file, const QString &build) const
file.setFileName(Option::output_dir + "/" + file.fileName()); //pwd when qmake was run
QFileInfo fi(fileInfo(file.fileName()));
if(fi.isDir())
- outdir = file.fileName() + QDir::separator();
+ outdir = file.fileName() + '/';
}
if(!outdir.isEmpty() || file.fileName().isEmpty()) {
QString fname = "Makefile";
@@ -3075,7 +3077,7 @@ MakefileGenerator::openOutput(QFile &file, const QString &build) const
file.setFileName(file.fileName() + "." + build);
if(project->isEmpty("QMAKE_MAKEFILE"))
project->values("QMAKE_MAKEFILE").append(file.fileName());
- int slsh = file.fileName().lastIndexOf(Option::dir_sep);
+ int slsh = file.fileName().lastIndexOf('/');
if(slsh != -1)
mkdir(file.fileName().left(slsh));
if(file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
@@ -3085,9 +3087,13 @@ MakefileGenerator::openOutput(QFile &file, const QString &build) const
od = fileInfo(fi.readLink()).absolutePath();
else
od = fi.path();
- od = Option::fixPathToTargetOS(od);
- if(QDir::isRelativePath(od))
- od.prepend(Option::output_dir);
+ od = QDir::fromNativeSeparators(od);
+ if(QDir::isRelativePath(od)) {
+ QString dir = Option::output_dir;
+ if (!dir.endsWith('/') && !od.isEmpty())
+ dir += '/';
+ od.prepend(dir);
+ }
Option::output_dir = od;
return true;
}
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 63b0f17..d36be3c 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -294,9 +294,9 @@ SubdirsMetaMakefileGenerator::init()
init_flag = true;
if(Option::recursive) {
- QString old_output_dir = QDir::cleanPath(Option::output_dir);
+ QString old_output_dir = Option::output_dir;
QString old_output = Option::output.fileName();
- QString oldpwd = QDir::cleanPath(qmake_getpwd());
+ QString oldpwd = qmake_getpwd();
QString thispwd = oldpwd;
if(!thispwd.endsWith('/'))
thispwd += '/';
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 303e3e1..78a552b 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -120,14 +120,7 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
QString rSubkeyPath = keyPath(rSubkey);
HKEY handle = 0;
- LONG res;
- QT_WA( {
- res = RegOpenKeyExW(parentHandle, (WCHAR*)rSubkeyPath.utf16(),
- 0, KEY_READ, &handle);
- } , {
- res = RegOpenKeyExA(parentHandle, rSubkeyPath.toLocal8Bit(),
- 0, KEY_READ, &handle);
- } );
+ LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, KEY_READ, &handle);
if (res != ERROR_SUCCESS)
return QString();
@@ -135,11 +128,7 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
// get the size and type of the value
DWORD dataType;
DWORD dataSize;
- QT_WA( {
- res = RegQueryValueExW(handle, (WCHAR*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize);
- }, {
- res = RegQueryValueExA(handle, rSubkeyName.toLocal8Bit(), 0, &dataType, 0, &dataSize);
- } );
+ res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize);
if (res != ERROR_SUCCESS) {
RegCloseKey(handle);
return QString();
@@ -147,13 +136,8 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
// get the value
QByteArray data(dataSize, 0);
- QT_WA( {
- res = RegQueryValueExW(handle, (WCHAR*)rSubkeyName.utf16(), 0, 0,
- reinterpret_cast<unsigned char*>(data.data()), &dataSize);
- }, {
- res = RegQueryValueExA(handle, rSubkeyName.toLocal8Bit(), 0, 0,
- reinterpret_cast<unsigned char*>(data.data()), &dataSize);
- } );
+ res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, 0,
+ reinterpret_cast<unsigned char*>(data.data()), &dataSize);
if (res != ERROR_SUCCESS) {
RegCloseKey(handle);
return QString();
@@ -163,11 +147,7 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
switch (dataType) {
case REG_EXPAND_SZ:
case REG_SZ: {
- QT_WA( {
- result = QString::fromUtf16(((const ushort*)data.constData()));
- }, {
- result = QString::fromLatin1(data.constData());
- } );
+ result = QString::fromWCharArray(((const wchar_t *)data.constData()));
break;
}
@@ -175,12 +155,7 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
QStringList l;
int i = 0;
for (;;) {
- QString s;
- QT_WA( {
- s = QString::fromUtf16((const ushort*)data.constData() + i);
- }, {
- s = QString::fromLatin1(data.constData() + i);
- } );
+ QString s = QString::fromWCharArray((const wchar_t *)data.constData() + i);
i += s.length() + 1;
if (s.isEmpty())
@@ -193,11 +168,7 @@ static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey)
case REG_NONE:
case REG_BINARY: {
- QT_WA( {
- result = QString::fromUtf16((const ushort*)data.constData(), data.size()/2);
- }, {
- result = QString::fromLatin1(data.constData(), data.size());
- } );
+ result = QString::fromWCharArray((const wchar_t *)data.constData(), data.size() / 2);
break;
}
@@ -1268,9 +1239,8 @@ void VcprojGenerator::initDeploymentTool()
foreach(QString item, project->values("DEPLOYMENT")) {
// get item.path
QString devicePath = project->first(item + ".path");
- // if the path does not exist, skip it
if (devicePath.isEmpty())
- continue;
+ devicePath = targetPath;
// check if item.path is relative (! either /,\ or %)
if (!(devicePath.at(0) == QLatin1Char('/')
|| devicePath.at(0) == QLatin1Char('\\')
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 0e4a608..5f8c4f4 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -716,16 +716,9 @@ QString qmake_libraryInfoFile()
{
QString ret;
#if defined( Q_OS_WIN )
- QFileInfo filePath;
- QT_WA({
- unsigned short module_name[256];
- GetModuleFileNameW(0, reinterpret_cast<wchar_t *>(module_name), sizeof(module_name));
- filePath = QString::fromUtf16(module_name);
- }, {
- char module_name[256];
- GetModuleFileNameA(0, module_name, sizeof(module_name));
- filePath = QString::fromLocal8Bit(module_name);
- });
+ wchar_t module_name[MAX_PATH];
+ GetModuleFileName(0, module_name, MAX_PATH);
+ QFileInfo filePath = QString::fromWCharArray(module_name);
ret = filePath.filePath();
#else
QString argv0 = QFile::decodeName(QByteArray(Option::application_argv0));
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 0a5e9a3..92eb461 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -3261,9 +3261,9 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList
ret = "Windows";
} else if(type == "name") {
DWORD name_length = 1024;
- TCHAR name[1024];
- if(GetComputerName(name, &name_length))
- ret = QString::fromUtf16((ushort*)name, name_length);
+ wchar_t name[1024];
+ if (GetComputerName(name, &name_length))
+ ret = QString::fromWCharArray(name);
} else if(type == "version" || type == "version_string") {
QSysInfo::WinVersion ver = QSysInfo::WindowsVersion;
if(type == "version")
diff --git a/qmake/qmake.pri b/qmake/qmake.pri
index 2304fab..6808f68 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -68,6 +68,8 @@ bootstrap { #Qt code
qmap.cpp \
qmetatype.cpp \
qregexp.cpp \
+ qtextcodec.cpp \
+ qutfcodec.cpp \
qstring.cpp \
qstringlist.cpp \
qtemporaryfile.cpp \
@@ -107,6 +109,8 @@ bootstrap { #Qt code
qmap.h \
qmetatype.h \
qregexp.h \
+ qtextcodec.h \
+ qutfcodec.h \
qstring.h \
qstringlist.h \
qstringmatcher.h \