diff --git a/src/shared/proparser/ioutils.cpp b/src/shared/proparser/ioutils.cpp index 8a2c9112d28ba65d3187101948172d9c55aa7d01..f43c29aa9ae9a2df78c7e9f7bfe2f67a207b59eb 100644 --- a/src/shared/proparser/ioutils.cpp +++ b/src/shared/proparser/ioutils.cpp @@ -52,7 +52,7 @@ IoUtils::FileType IoUtils::fileType(const QString &fileName) return (attr & FILE_ATTRIBUTE_DIRECTORY) ? FileIsDir : FileIsRegular; #else struct ::stat st; - if (::stat(fileName.toLatin1().constData(), &st)) // latin1 symmetric to the file reader + if (::stat(fileName.toLocal8Bit().constData(), &st)) return FileNotFound; return S_ISDIR(st.st_mode) ? FileIsDir : FileIsRegular; #endif diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp index c9ce082b41bbdc9dae3ad89b6dc167143c2244e4..f54fd06ea6fedd9bdbf08e7018bc6fe1c5f4855a 100644 --- a/src/shared/proparser/profileevaluator.cpp +++ b/src/shared/proparser/profileevaluator.cpp @@ -148,7 +148,7 @@ ProFileOption::ProFileOption() dirlist_sep = QLatin1Char(':'); dir_sep = QLatin1Char('/'); #endif - qmakespec = QString::fromLatin1(qgetenv("QMAKESPEC").data()); + qmakespec = QString::fromLocal8Bit(qgetenv("QMAKESPEC").data()); #if defined(Q_OS_WIN32) target_mode = TARG_WIN_MODE; @@ -557,7 +557,7 @@ bool ProFileEvaluator::Private::read(ProFile *pro) return false; } - QString content(QString::fromLatin1(file.readAll())); // yes, really latin1 + QString content(QString::fromLocal8Bit(file.readAll())); file.close(); m_lineNo = 1; m_profileStack.push(pro); @@ -1377,10 +1377,10 @@ ProItem::ProItemReturn ProFileEvaluator::Private::visitProFile(ProFile *pro) if (m_option->qmakespec_name == QLatin1String("default")) { #ifdef Q_OS_UNIX char buffer[1024]; - int l = ::readlink(m_option->qmakespec.toLatin1().constData(), buffer, 1024); + int l = ::readlink(m_option->qmakespec.toLocal8Bit().constData(), buffer, 1024); if (l != -1) m_option->qmakespec_name = - IoUtils::fileName(QString::fromLatin1(buffer, l)).toString(); + IoUtils::fileName(QString::fromLocal8Bit(buffer, l)).toString(); #else // We can't resolve symlinks as they do on Unix, so configure.exe puts // the source of the qmake.conf at the end of the default/qmake.conf in @@ -1815,7 +1815,7 @@ QStringList ProFileEvaluator::Private::expandVariableReferences( QStringList replacement; if (var_type == ENVIRON) { - replacement = split_value_list(QString::fromLocal8Bit(qgetenv(var.toLatin1().constData()))); + replacement = split_value_list(QString::fromLocal8Bit(qgetenv(var.toLocal8Bit().constData()))); } else if (var_type == PROPERTY) { replacement << propertyValue(var); } else if (var_type == FUNCTION) { @@ -2199,9 +2199,9 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun logMessage(format("system(execute) requires one or two arguments.")); } else { char buff[256]; - FILE *proc = QT_POPEN((QLatin1String("cd ") + FILE *proc = QT_POPEN(QString(QLatin1String("cd ") + IoUtils::shellQuote(currentDirectory()) - + QLatin1String(" && ") + args[0]).toLatin1(), "r"); + + QLatin1String(" && ") + args[0]).toLocal8Bit(), "r"); bool singleLine = true; if (args.count() > 1) singleLine = (!args[1].compare(QLatin1String("true"), Qt::CaseInsensitive)); @@ -2215,7 +2215,7 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun buff[i] = ' '; } buff[read_in] = '\0'; - output += QLatin1String(buff); + output += QString::fromLocal8Bit(buff); } ret += split_value_list(output); if (proc) @@ -2843,7 +2843,7 @@ ProItem::ProItemReturn ProFileEvaluator::Private::evaluateConditionalFunction( } return returnBool(system((QLatin1String("cd ") + IoUtils::shellQuote(currentDirectory()) - + QLatin1String(" && ") + args.first()).toLatin1().constData()) == 0); + + QLatin1String(" && ") + args.first()).toLocal8Bit().constData()) == 0); } #endif case T_ISEMPTY: { @@ -3040,7 +3040,7 @@ QStringList ProFileEvaluator::Private::values(const QString &variableName) const case V_QMAKE_HOST_version_string: what = name.version; break; case V_QMAKE_HOST_arch: what = name.machine; break; } - ret = QString::fromLatin1(what); + ret = QString::fromLocal8Bit(what); } } #endif