diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 838f52c03d4..b29e49334d8 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -203,15 +203,15 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer: MakeStep *cleanMakeStep = new MakeStep(cleanSteps); cleanSteps->insertStep(0, cleanMakeStep); - cleanMakeStep->setAdditionalArguments("clean"); + cleanMakeStep->setAdditionalArguments(QLatin1String("clean")); cleanMakeStep->setClean(true); bc->setBuildDirectory(copw.buildDirectory()); bc->setUseNinja(copw.useNinja()); // Default to all - if (project->hasBuildTarget("all")) - makeStep->setBuildTarget("all", true); + if (project->hasBuildTarget(QLatin1String("all"))) + makeStep->setBuildTarget(QLatin1String("all"), true); return bc; } @@ -255,13 +255,13 @@ bool CMakeBuildConfigurationFactory::canHandle(const ProjectExplorer::Target *t) ProjectExplorer::BuildConfiguration::BuildType CMakeBuildConfiguration::buildType() const { QString cmakeBuildType; - QFile cmakeCache(buildDirectory() + "/CMakeCache.txt"); + QFile cmakeCache(buildDirectory() + QLatin1String("/CMakeCache.txt")); if (cmakeCache.open(QIODevice::ReadOnly)) { while (!cmakeCache.atEnd()) { - QString line = cmakeCache.readLine(); + QByteArray line = cmakeCache.readLine(); if (line.startsWith("CMAKE_BUILD_TYPE")) { if (int pos = line.indexOf('=')) { - cmakeBuildType = line.mid(pos + 1).trimmed(); + cmakeBuildType = QString::fromLocal8Bit(line.mid(pos + 1).trimmed()); } break; } @@ -270,13 +270,13 @@ ProjectExplorer::BuildConfiguration::BuildType CMakeBuildConfiguration::buildTyp } // Cover all common CMake build types - if (cmakeBuildType.compare("Release", Qt::CaseInsensitive) == 0 - || cmakeBuildType.compare("MinSizeRel", Qt::CaseInsensitive) == 0) + if (cmakeBuildType.compare(QLatin1String("Release"), Qt::CaseInsensitive) == 0 + || cmakeBuildType.compare(QLatin1String("MinSizeRel"), Qt::CaseInsensitive) == 0) { return Release; - } else if (cmakeBuildType.compare("Debug", Qt::CaseInsensitive) == 0 - || cmakeBuildType.compare("debugfull", Qt::CaseInsensitive) == 0 - || cmakeBuildType.compare("RelWithDebInfo", Qt::CaseInsensitive) == 0) + } else if (cmakeBuildType.compare(QLatin1String("Debug"), Qt::CaseInsensitive) == 0 + || cmakeBuildType.compare(QLatin1String("DebugFull"), Qt::CaseInsensitive) == 0 + || cmakeBuildType.compare(QLatin1String("RelWithDebInfo"), Qt::CaseInsensitive) == 0) { return Debug; } diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index ffd2f212c6d..0149f08dc48 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -223,7 +223,7 @@ CMakeEditorWidget::Link CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, if (fi.exists()) { if (fi.isDir()) { QDir subDir(fi.absoluteFilePath()); - QString subProject = subDir.filePath("CMakeLists.txt"); + QString subProject = subDir.filePath(QLatin1String("CMakeLists.txt")); if (QFileInfo(subProject).exists()) fileName = subProject; else diff --git a/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp b/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp index 0c162f60a86..f577d4a28a6 100644 --- a/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp @@ -37,7 +37,7 @@ using namespace CMakeProjectManager::Internal; -static bool isVariable(const QString &word) +static bool isVariable(const QByteArray &word) { if (word.length() < 4) // must be at least "${.}" return false; @@ -53,14 +53,14 @@ CMakeHighlighter::CMakeHighlighter(QTextDocument *document) : void CMakeHighlighter::highlightBlock(const QString &text) { - QString buf; + QByteArray buf; bool inCommentMode = false; bool inStringMode = (previousBlockState() == 1); QTextCharFormat emptyFormat; int i=0; for (i=0; i < text.length(); i++) { - const QChar c = text.at(i); + char c = text.at(i).toLatin1(); if (inCommentMode) { setFormat(i, 1, m_formats[CMakeCommentFormat]); } else { @@ -80,7 +80,7 @@ void CMakeHighlighter::highlightBlock(const QString &text) } else { buf += c; } - } else if (c.isSpace()) { + } else if (text.at(i).isSpace()) { if (!inStringMode) buf.clear(); else diff --git a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp index 7ff68eca929..b4798ed35b0 100644 --- a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp @@ -81,8 +81,8 @@ namespace Internal { bool isNinja() const; QString displayName() const; - QString generatorArgument() const; - QString generator() const; + QByteArray generatorArgument() const; + QByteArray generator() const; private: ProjectExplorer::Kit *m_kit; @@ -111,36 +111,36 @@ bool GeneratorInfo::isNinja() const { return m_isNinja; } -QString GeneratorInfo::generator() const +QByteArray GeneratorInfo::generator() const { if (!m_kit) - return QString(); + return QByteArray(); ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(m_kit); ProjectExplorer::Abi targetAbi = tc->targetAbi(); if (m_isNinja) { - return QLatin1String("Ninja"); + return "Ninja"; } else if (targetAbi.os() == ProjectExplorer::Abi::WindowsOS) { if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2005Flavor || targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2008Flavor || targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2010Flavor || targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2012Flavor) { - return QLatin1String("NMake Makefiles"); + return "NMake Makefiles"; } else if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) { if (Utils::HostOsInfo::isWindowsHost()) - return QLatin1String("MinGW Makefiles"); + return "MinGW Makefiles"; else - return QLatin1String("Unix Makefiles"); + return "Unix Makefiles"; } } - return QLatin1String("Unix Makefiles"); + return "Unix Makefiles"; } -QString GeneratorInfo::generatorArgument() const +QByteArray GeneratorInfo::generatorArgument() const { - QString tmp = generator(); + QByteArray tmp = generator(); if (tmp.isEmpty()) return tmp; - return QLatin1String("-GCodeBlocks - ") + tmp; + return QByteArray("-GCodeBlocks - ") + tmp; } QString GeneratorInfo::displayName() const @@ -267,7 +267,7 @@ CMakeManager *CMakeOpenProjectWizard::cmakeManager() const bool CMakeOpenProjectWizard::hasInSourceBuild() const { - QFileInfo fi(m_sourceDirectory + "/CMakeCache.txt"); + QFileInfo fi(m_sourceDirectory + QLatin1String("/CMakeCache.txt")); if (fi.exists()) return true; return false; @@ -279,7 +279,7 @@ bool CMakeOpenProjectWizard::existsUpToDateXmlFile() const if (!cbpFile.isEmpty()) { // We already have a cbp file QFileInfo cbpFileInfo(cbpFile); - QFileInfo cmakeListsFileInfo(sourceDirectory() + "/CMakeLists.txt"); + QFileInfo cmakeListsFileInfo(sourceDirectory() + QLatin1String("/CMakeLists.txt")); if (cbpFileInfo.lastModified() > cmakeListsFileInfo.lastModified()) return true; @@ -394,7 +394,7 @@ ChooseCMakePage::ChooseCMakePage(CMakeOpenProjectWizard *cmakeWizard) // Show a field for the user to enter m_cmakeExecutable = new Utils::PathChooser(this); m_cmakeExecutable->setExpectedKind(Utils::PathChooser::ExistingCommand); - fl->addRow("cmake Executable:", m_cmakeExecutable); + fl->addRow(tr("cmake Executable:"), m_cmakeExecutable); connect(m_cmakeExecutable, SIGNAL(editingFinished()), this, SLOT(cmakeExecutableChanged())); @@ -499,18 +499,18 @@ void CMakeRunPage::initWidgets() setMinimumSize(600, 400); } -QString CMakeRunPage::cachedGeneratorFromFile(const QString &cache) +QByteArray CMakeRunPage::cachedGeneratorFromFile(const QString &cache) { QFile fi(cache); if (fi.exists()) { // Cache exists, then read it... if (fi.open(QIODevice::ReadOnly | QIODevice::Text)) { while (!fi.atEnd()) { - QString line = fi.readLine(); + QByteArray line = fi.readLine(); if (line.startsWith("CMAKE_GENERATOR:INTERNAL=")) { int splitpos = line.indexOf('='); if (splitpos != -1) { - QString cachedGenerator = line.mid(splitpos + 1).trimmed(); + QByteArray cachedGenerator = line.mid(splitpos + 1).trimmed(); if (!cachedGenerator.isEmpty()) return cachedGenerator; } @@ -518,7 +518,7 @@ QString CMakeRunPage::cachedGeneratorFromFile(const QString &cache) } } } - return QString(); + return QByteArray(); } void CMakeRunPage::initializePage() @@ -569,7 +569,7 @@ void CMakeRunPage::initializePage() if (m_mode == Initial) { // Try figuring out generator and toolchain from CMakeCache.txt - QString cachedGenerator = cachedGeneratorFromFile(m_buildDirectory + "/CMakeCache.txt"); + QByteArray cachedGenerator = cachedGeneratorFromFile(m_buildDirectory + QLatin1String("/CMakeCache.txt")); m_generatorComboBox->show(); QList kitList = @@ -652,7 +652,7 @@ void CMakeRunPage::runCMake() connect(m_cmakeProcess, SIGNAL(readyReadStandardError()), this, SLOT(cmakeReadyReadStandardError())); connect(m_cmakeProcess, SIGNAL(finished(int)), this, SLOT(cmakeFinished())); cmakeManager->createXmlFile(m_cmakeProcess, m_argumentsLineEdit->text(), m_cmakeWizard->sourceDirectory(), - m_buildDirectory, env, generatorInfo.generatorArgument()); + m_buildDirectory, env, QString::fromLatin1(generatorInfo.generatorArgument())); } else { m_runCMake->setEnabled(true); m_argumentsLineEdit->setEnabled(true); @@ -677,7 +677,7 @@ void CMakeRunPage::cmakeReadyReadStandardOutput() tf.setFont(font); tf.setForeground(m_output->palette().color(QPalette::Text)); - cursor.insertText(m_cmakeProcess->readAllStandardOutput(), tf); + cursor.insertText(QString::fromLocal8Bit(m_cmakeProcess->readAllStandardOutput()), tf); } void CMakeRunPage::cmakeReadyReadStandardError() @@ -691,7 +691,7 @@ void CMakeRunPage::cmakeReadyReadStandardError() tf.setFont(boldFont); tf.setForeground(mix_colors(m_output->palette().color(QPalette::Text), QColor(Qt::red))); - cursor.insertText(m_cmakeProcess->readAllStandardError(), tf); + cursor.insertText(QString::fromLocal8Bit(m_cmakeProcess->readAllStandardError()), tf); } void CMakeRunPage::cmakeFinished() diff --git a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h index 5a3c0cf84de..c034230ae3f 100644 --- a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h +++ b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h @@ -179,7 +179,7 @@ private slots: void cmakeReadyReadStandardError(); private: void initWidgets(); - QString cachedGeneratorFromFile(const QString &cache); + QByteArray cachedGeneratorFromFile(const QString &cache); CMakeOpenProjectWizard *m_cmakeWizard; QPlainTextEdit *m_output; QPushButton *m_runCMake; diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 9e5c8743139..7ab70ebeaab 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -251,7 +251,7 @@ bool CMakeProject::parseCMakeLists() projectFiles.insert(node->path()); } else { // Manually add the CMakeLists.txt file - QString cmakeListTxt = projectDirectory() + "/CMakeLists.txt"; + QString cmakeListTxt = projectDirectory() + QLatin1String("/CMakeLists.txt"); bool generated = false; fileList.append(new ProjectExplorer::FileNode(cmakeListTxt, ProjectExplorer::ProjectFileType, generated)); projectFiles.insert(cmakeListTxt); @@ -279,13 +279,13 @@ bool CMakeProject::parseCMakeLists() // TOOD this code ain't very pretty ... m_uicCommand.clear(); - QFile cmakeCache(activeBC->buildDirectory() + "/CMakeCache.txt"); + QFile cmakeCache(activeBC->buildDirectory() + QLatin1String("/CMakeCache.txt")); cmakeCache.open(QIODevice::ReadOnly); while (!cmakeCache.atEnd()) { - QString line = cmakeCache.readLine(); + QByteArray line = cmakeCache.readLine(); if (line.startsWith("QT_UIC_EXECUTABLE")) { if (int pos = line.indexOf('=')) { - m_uicCommand = line.mid(pos + 1).trimmed(); + m_uicCommand = QString::fromLocal8Bit(line.mid(pos + 1).trimmed()); } break; } @@ -542,7 +542,7 @@ bool CMakeProject::fromMap(const QVariantMap &map) Kit *k = copw.kit(); Target *t = new Target(this, k); CMakeBuildConfiguration *bc(new CMakeBuildConfiguration(t)); - bc->setDefaultDisplayName("all"); + bc->setDefaultDisplayName(QLatin1String("all")); bc->setUseNinja(copw.useNinja()); bc->setBuildDirectory(copw.buildDirectory()); ProjectExplorer::BuildStepList *buildSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD); @@ -553,7 +553,7 @@ bool CMakeProject::fromMap(const QVariantMap &map) MakeStep *cleanMakeStep = new MakeStep(cleanSteps); cleanSteps->insertStep(0, cleanMakeStep); - cleanMakeStep->setAdditionalArguments("clean"); + cleanMakeStep->setAdditionalArguments(QLatin1String("clean")); cleanMakeStep->setClean(true); t->addBuildConfiguration(bc); @@ -594,11 +594,11 @@ bool CMakeProject::fromMap(const QVariantMap &map) parseCMakeLists(); - if (!hasUserFile && hasBuildTarget("all")) { + if (!hasUserFile && hasBuildTarget(QLatin1String("all"))) { MakeStep *makeStep = qobject_cast( activeTarget()->activeBuildConfiguration()->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD)->at(0)); Q_ASSERT(makeStep); - makeStep->setBuildTarget("all", true); + makeStep->setBuildTarget(QLatin1String("all"), true); } connect(Core::EditorManager::instance(), SIGNAL(editorAboutToClose(Core::IEditor*)), @@ -691,7 +691,7 @@ void CMakeProject::updateRunConfigurations(Target *t) continue; if (ct.executable.isEmpty()) continue; - if (ct.title.endsWith("/fast")) + if (ct.title.endsWith(QLatin1String("/fast"))) continue; QList list = existingRunConfigurations.values(ct.title); if (!list.isEmpty()) { @@ -743,7 +743,7 @@ void CMakeProject::createUiCodeModelSupport() // Find all ui files foreach (const QString &uiFile, m_files) { - if (uiFile.endsWith(".ui")) { + if (uiFile.endsWith(QLatin1String(".ui"))) { // UI file, not convert to QString uiHeaderFilePath = uiHeaderFile(uiFile); QMap::iterator it @@ -872,7 +872,7 @@ QString CMakeFile::suggestedFileName() const QString CMakeFile::mimeType() const { - return Constants::CMAKEMIMETYPE; + return QLatin1String(Constants::CMAKEMIMETYPE); } @@ -1042,12 +1042,12 @@ void CMakeCbpParser::parseBuildTarget() m_buildTargetType = false; m_buildTarget.clear(); - if (attributes().hasAttribute("title")) - m_buildTarget.title = attributes().value("title").toString(); + if (attributes().hasAttribute(QLatin1String("title"))) + m_buildTarget.title = attributes().value(QLatin1String("title")).toString(); while (!atEnd()) { readNext(); if (isEndElement()) { - if (m_buildTargetType || m_buildTarget.title == "all" || m_buildTarget.title == "install") { + if (m_buildTargetType || m_buildTarget.title == QLatin1String("all") || m_buildTarget.title == QLatin1String("install")) { m_buildTargets.append(m_buildTarget); } return; @@ -1063,15 +1063,19 @@ void CMakeCbpParser::parseBuildTarget() void CMakeCbpParser::parseBuildTargetOption() { - if (attributes().hasAttribute("output")) { - m_buildTarget.executable = attributes().value("output").toString(); - } else if (attributes().hasAttribute("type") && (attributes().value("type") == "1" || attributes().value("type") == "0")) { + if (attributes().hasAttribute(QLatin1String("output"))) { + m_buildTarget.executable = attributes().value(QLatin1String("output")).toString(); + } else if (attributes().hasAttribute(QLatin1String("type")) + && (attributes().value(QLatin1String("type")) == QLatin1String("1") + || attributes().value(QLatin1String("type")) == QLatin1String("0"))) { m_buildTargetType = true; - } else if (attributes().hasAttribute("type") && (attributes().value("type") == "3" || attributes().value("type") == "2")) { + } else if (attributes().hasAttribute(QLatin1String("type")) + && (attributes().value(QLatin1String("type")) == QLatin1String("3") + || attributes().value(QLatin1String("type")) == QLatin1String("2"))) { m_buildTargetType = true; m_buildTarget.library = true; - } else if (attributes().hasAttribute("working_dir")) { - m_buildTarget.workingDirectory = attributes().value("working_dir").toString(); + } else if (attributes().hasAttribute(QLatin1String("working_dir"))) { + m_buildTarget.workingDirectory = attributes().value(QLatin1String("working_dir")).toString(); } while (!atEnd()) { readNext(); @@ -1092,11 +1096,11 @@ QString CMakeCbpParser::projectName() const void CMakeCbpParser::parseOption() { - if (attributes().hasAttribute("title")) - m_projectName = attributes().value("title").toString(); + if (attributes().hasAttribute(QLatin1String("title"))) + m_projectName = attributes().value(QLatin1String("title")).toString(); - if (attributes().hasAttribute("compiler")) - m_compiler = attributes().value("compiler").toString(); + if (attributes().hasAttribute(QLatin1String("compiler"))) + m_compiler = attributes().value(QLatin1String("compiler")).toString(); while (!atEnd()) { readNext(); @@ -1126,8 +1130,8 @@ void CMakeCbpParser::parseMakeCommand() void CMakeCbpParser::parseBuildTargetBuild() { - if (attributes().hasAttribute("command")) - m_buildTarget.makeCommand = attributes().value("command").toString(); + if (attributes().hasAttribute(QLatin1String("command"))) + m_buildTarget.makeCommand = attributes().value(QLatin1String("command")).toString(); while (!atEnd()) { readNext(); if (isEndElement()) { @@ -1140,8 +1144,8 @@ void CMakeCbpParser::parseBuildTargetBuild() void CMakeCbpParser::parseBuildTargetClean() { - if (attributes().hasAttribute("command")) - m_buildTarget.makeCleanCommand = attributes().value("command").toString(); + if (attributes().hasAttribute(QLatin1String("command"))) + m_buildTarget.makeCleanCommand = attributes().value(QLatin1String("command")).toString(); while (!atEnd()) { readNext(); if (isEndElement()) { @@ -1171,19 +1175,19 @@ void CMakeCbpParser::parseAdd() // CMake only supports and const QXmlStreamAttributes addAttributes = attributes(); - const QString includeDirectory = addAttributes.value("directory").toString(); + const QString includeDirectory = addAttributes.value(QLatin1String("directory")).toString(); // allow adding multiple times because order happens if (!includeDirectory.isEmpty()) { m_includeFiles.append(includeDirectory); } - QString compilerOption = addAttributes.value("option").toString(); + QString compilerOption = addAttributes.value(QLatin1String("option")).toString(); // defining multiple times a macro to the same value makes no sense if (!compilerOption.isEmpty() && !m_compilerOptions.contains(compilerOption)) { m_compilerOptions.append(compilerOption); - int macroNameIndex = compilerOption.indexOf("-D") + 2; + int macroNameIndex = compilerOption.indexOf(QLatin1String("-D")) + 2; if (macroNameIndex != 1) { - int assignIndex = compilerOption.indexOf('=', macroNameIndex); + int assignIndex = compilerOption.indexOf(QLatin1Char('='), macroNameIndex); if (assignIndex != -1) { compilerOption[assignIndex] = ' '; } @@ -1206,7 +1210,7 @@ void CMakeCbpParser::parseAdd() void CMakeCbpParser::parseUnit() { //qDebug()<readAll(); + QByteArray response = m_process->readAll(); QRegExp versionRegexp(QLatin1String("^cmake version ([\\d\\.]*)")); - versionRegexp.indexIn(response); + versionRegexp.indexIn(QString::fromLocal8Bit(response)); //m_supportsQtCreator = response.contains(QLatin1String("QtCreator")); - m_hasCodeBlocksMsvcGenerator = response.contains(QLatin1String("CodeBlocks - NMake Makefiles")); - m_hasCodeBlocksNinjaGenerator = response.contains(QLatin1String("CodeBlocks - Ninja")); + m_hasCodeBlocksMsvcGenerator = response.contains("CodeBlocks - NMake Makefiles"); + m_hasCodeBlocksNinjaGenerator = response.contains("CodeBlocks - Ninja"); m_version = versionRegexp.cap(1); if (!(versionRegexp.capturedTexts().size() > 3)) m_version += QLatin1Char('.') + versionRegexp.cap(3); @@ -169,7 +169,7 @@ static void extractKeywords(const QByteArray &input, QStringList *destination) QString keyword; int ignoreZone = 0; for (int i = 0; i < input.count(); ++i) { - const QChar chr = input.at(i); + const QChar chr = QLatin1Char(input.at(i)); if (chr == QLatin1Char('{')) ++ignoreZone; if (chr == QLatin1Char('}')) @@ -200,16 +200,14 @@ void CMakeValidator::parseFunctionOutput(const QByteArray &output) if (!cmakeFunctionsList.isEmpty()) { cmakeFunctionsList.removeFirst(); //remove version string foreach (const QByteArray &function, cmakeFunctionsList) - m_functions << QString(function).trimmed(); + m_functions << QString::fromLocal8Bit(function.trimmed()); } } -QString CMakeValidator::formatFunctionDetails(const QString &command, const QByteArray &args) +QString CMakeValidator::formatFunctionDetails(const QString &command, const QString &args) { - return QLatin1String(""); + return QString::fromLatin1("
") + Qt::escape(command) - + QLatin1String("") - + Qt::escape(args) - + QLatin1String("
") + .arg(Qt::escape(command)).arg(Qt::escape(args)); } void CMakeValidator::parseFunctionDetailsOutput(const QByteArray &output) @@ -229,25 +227,26 @@ void CMakeValidator::parseFunctionDetailsOutput(const QByteArray &output) if (cmakeFunctionsList.first().toLatin1() == lineTrimmed) { //start of next function in output if (!currentCommandSyntax.isEmpty()) - commandSyntaxes << currentCommandSyntax.append("
%1%2
"); + commandSyntaxes << currentCommandSyntax.append(QLatin1String("")); --i; break; } if (lineTrimmed.startsWith(currentCommand.toLatin1() + "(")) { if (!currentCommandSyntax.isEmpty()) - commandSyntaxes << currentCommandSyntax.append(""); + commandSyntaxes << currentCommandSyntax.append(QLatin1String("")); QByteArray argLine = lineTrimmed.mid(currentCommand.length()); extractKeywords(argLine, &m_variables); - currentCommandSyntax = formatFunctionDetails(currentCommand, argLine); + currentCommandSyntax = formatFunctionDetails(currentCommand, QString::fromUtf8(argLine)); } else { if (!currentCommandSyntax.isEmpty()) { if (lineTrimmed.isEmpty()) { - commandSyntaxes << currentCommandSyntax.append(""); + commandSyntaxes << currentCommandSyntax.append(QLatin1String("")); currentCommandSyntax.clear(); } else { extractKeywords(lineTrimmed, &m_variables); - currentCommandSyntax += " " + Qt::escape(lineTrimmed) + ""; + currentCommandSyntax += QString::fromLatin1(" %1") + .arg(Qt::escape(QString::fromLocal8Bit(lineTrimmed))); } } } @@ -259,4 +258,3 @@ void CMakeValidator::parseFunctionDetailsOutput(const QByteArray &output) m_variables.sort(); m_variables.removeDuplicates(); } - diff --git a/src/plugins/cmakeprojectmanager/cmakevalidator.h b/src/plugins/cmakeprojectmanager/cmakevalidator.h index 38c413b79e0..e325c8d8ff7 100644 --- a/src/plugins/cmakeprojectmanager/cmakevalidator.h +++ b/src/plugins/cmakeprojectmanager/cmakevalidator.h @@ -65,7 +65,7 @@ private: bool startProcess(const QStringList &args); void parseFunctionOutput(const QByteArray &output); void parseFunctionDetailsOutput(const QByteArray &output); - QString formatFunctionDetails(const QString &command, const QByteArray &args); + QString formatFunctionDetails(const QString &command, const QString &args); State m_state; QProcess *m_process; diff --git a/src/plugins/cmakeprojectmanager/makestep.cpp b/src/plugins/cmakeprojectmanager/makestep.cpp index 535ab338fc2..18dc5d213c4 100644 --- a/src/plugins/cmakeprojectmanager/makestep.cpp +++ b/src/plugins/cmakeprojectmanager/makestep.cpp @@ -91,8 +91,8 @@ MakeStep::MakeStep(BuildStepList *bsl, MakeStep *bs) : void MakeStep::ctor() { - m_percentProgress = QRegExp("^\\[\\s*(\\d*)%\\]"); - m_ninjaProgress = QRegExp ("^\\[\\s*(\\d*)/\\s*(\\d*)"); + m_percentProgress = QRegExp(QLatin1String("^\\[\\s*(\\d*)%\\]")); + m_ninjaProgress = QRegExp(QLatin1String("^\\[\\s*(\\d*)/\\s*(\\d*)")); m_ninjaProgressString = QLatin1String("[%s/%t "); // ninja: [33/100 //: Default display name for the cmake make step. setDefaultDisplayName(tr("Make")); @@ -455,7 +455,7 @@ BuildStep *MakeStepFactory::create(BuildStepList *parent, const Core::Id id) MakeStep *step = new MakeStep(parent); if (parent->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) { step->setClean(true); - step->setAdditionalArguments("clean"); + step->setAdditionalArguments(QLatin1String("clean")); } return step; }