diff options
Diffstat (limited to 'src')
40 files changed, 352 insertions, 327 deletions
diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index b39f669943..c61b47977a 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -754,10 +754,10 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data() << (QStringList()); // Set up prefix for test data now that we can be sure to have some tests to run: - QString prefix = qgetenv("QTC_TEST_EXTRADATALOCATION"); + QString prefix = QString::fromLocal8Bit(qgetenv("QTC_TEST_EXTRADATALOCATION")); if (prefix.isEmpty()) return; - prefix += "/projectexplorer/abi"; + prefix += QLatin1String("/projectexplorer/abi"); QFileInfo fi(prefix); if (!fi.exists() || !fi.isDir()) diff --git a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp index fd062fd001..264af9cb03 100644 --- a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp +++ b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp @@ -100,7 +100,7 @@ QList<HeaderPath> AbstractMsvcToolChain::systemHeaderPaths() const if (m_headerPaths.isEmpty()) { Utils::Environment env(m_lastEnvironment); addToEnvironment(env); - foreach (const QString &path, env.value("INCLUDE").split(QLatin1Char(';'))) + foreach (const QString &path, env.value(QLatin1String("INCLUDE")).split(QLatin1Char(';'))) m_headerPaths.append(HeaderPath(path, HeaderPath::GlobalHeaderPath)); } return m_headerPaths; @@ -178,7 +178,7 @@ bool AbstractMsvcToolChain::generateEnvironmentSettings(Utils::Environment &env, // Note, can't just use a QTemporaryFile all the way through as it remains open // internally so it can't be streamed to later. QString tempOutFile; - QTemporaryFile* pVarsTempFile = new QTemporaryFile(QDir::tempPath() + "/XXXXXX.txt"); + QTemporaryFile* pVarsTempFile = new QTemporaryFile(QDir::tempPath() + QLatin1String("/XXXXXX.txt")); pVarsTempFile->setAutoRemove(false); pVarsTempFile->open(); pVarsTempFile->close(); @@ -186,7 +186,7 @@ bool AbstractMsvcToolChain::generateEnvironmentSettings(Utils::Environment &env, delete pVarsTempFile; // Create a batch file to create and save the env settings - Utils::TempFileSaver saver(QDir::tempPath() + "/XXXXXX.bat"); + Utils::TempFileSaver saver(QDir::tempPath() + QLatin1String("/XXXXXX.bat")); QByteArray call = "call "; call += Utils::QtcProcess::quoteArg(batchFile).toLocal8Bit() + "\r\n"; diff --git a/src/plugins/projectexplorer/allprojectsfilter.h b/src/plugins/projectexplorer/allprojectsfilter.h index ec584f02ca..65412551e2 100644 --- a/src/plugins/projectexplorer/allprojectsfilter.h +++ b/src/plugins/projectexplorer/allprojectsfilter.h @@ -51,7 +51,7 @@ class AllProjectsFilter : public Locator::BaseFileFilter public: explicit AllProjectsFilter(ProjectExplorerPlugin *pe); QString displayName() const { return tr("Files in Any Project"); } - QString id() const { return "Files in any project"; } + QString id() const { return QLatin1String("Files in any project"); } Locator::ILocatorFilter::Priority priority() const { return Locator::ILocatorFilter::Low; } void refresh(QFutureInterface<void> &future); diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 33f9e6ccc6..7d7fac9371 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -68,7 +68,7 @@ using namespace ProjectExplorer::Internal; static QObject *debuggerCore() { - return ExtensionSystem::PluginManager::instance()->getObjectByName("DebuggerCore"); + return ExtensionSystem::PluginManager::instance()->getObjectByName(QLatin1String("DebuggerCore")); } static QString msgAttachDebuggerTooltip(const QString &handleDescription = QString()) @@ -125,7 +125,7 @@ AppOutputPane::AppOutputPane() : m_attachButton(new QToolButton) { // Rerun - m_reRunButton->setIcon(QIcon(ProjectExplorer::Constants::ICON_RUN_SMALL)); + m_reRunButton->setIcon(QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL))); m_reRunButton->setToolTip(tr("Re-run this run-configuration")); m_reRunButton->setAutoRaise(true); m_reRunButton->setEnabled(false); @@ -153,7 +153,7 @@ AppOutputPane::AppOutputPane() : // Attach m_attachButton->setToolTip(msgAttachDebuggerTooltip()); m_attachButton->setEnabled(false); - m_attachButton->setIcon(QIcon(ProjectExplorer::Constants::ICON_DEBUG_SMALL)); + m_attachButton->setIcon(QIcon(QLatin1String(ProjectExplorer::Constants::ICON_DEBUG_SMALL))); m_attachButton->setAutoRaise(true); connect(m_attachButton, SIGNAL(clicked()), diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 29e24c1e30..c84d48cc67 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -160,9 +160,9 @@ BuildManager::BuildManager(ProjectExplorerPlugin *parent) void BuildManager::extensionsInitialized() { - d->m_taskHub->addCategory(Constants::TASK_CATEGORY_COMPILE, + d->m_taskHub->addCategory(QLatin1String(Constants::TASK_CATEGORY_COMPILE), tr("Compile", "Category for compiler issues listed under 'Issues'")); - d->m_taskHub->addCategory(Constants::TASK_CATEGORY_BUILDSYSTEM, + d->m_taskHub->addCategory(QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM), tr("Build System", "Category for build system issues listed under 'Issues'")); } @@ -201,8 +201,8 @@ bool BuildManager::isBuilding() const int BuildManager::getErrorTaskCount() const { const int errors = - d->m_taskWindow->errorTaskCount(Constants::TASK_CATEGORY_BUILDSYSTEM) - + d->m_taskWindow->errorTaskCount(Constants::TASK_CATEGORY_COMPILE); + d->m_taskWindow->errorTaskCount(QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM)) + + d->m_taskWindow->errorTaskCount(QLatin1String(Constants::TASK_CATEGORY_COMPILE)); return errors; } @@ -306,8 +306,8 @@ void BuildManager::toggleTaskWindow() bool BuildManager::tasksAvailable() const { const int count = - d->m_taskWindow->taskCount(Constants::TASK_CATEGORY_BUILDSYSTEM) - + d->m_taskWindow->taskCount(Constants::TASK_CATEGORY_COMPILE); + d->m_taskWindow->taskCount(QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM)) + + d->m_taskWindow->taskCount(QLatin1String(Constants::TASK_CATEGORY_COMPILE)); return count > 0; } @@ -323,12 +323,12 @@ void BuildManager::startBuildQueue() d->m_progressFutureInterface = new QFutureInterface<void>; d->m_progressWatcher.setFuture(d->m_progressFutureInterface->future()); d->m_outputWindow->clearContents(); - d->m_taskHub->clearTasks(Constants::TASK_CATEGORY_COMPILE); - d->m_taskHub->clearTasks(Constants::TASK_CATEGORY_BUILDSYSTEM); + d->m_taskHub->clearTasks(QLatin1String(Constants::TASK_CATEGORY_COMPILE)); + d->m_taskHub->clearTasks(QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM)); progressManager->setApplicationLabel(QString()); d->m_futureProgress = QWeakPointer<Core::FutureProgress>(progressManager->addTask(d->m_progressFutureInterface->future(), - "", - Constants::TASK_BUILD, + QString(), + QLatin1String(Constants::TASK_BUILD), Core::ProgressManager::KeepOnFinish | Core::ProgressManager::ShowInApplicationIcon)); connect(d->m_futureProgress.data(), SIGNAL(clicked()), this, SLOT(showBuildResults())); d->m_futureProgress.data()->setWidget(new Internal::BuildProgress(d->m_taskWindow)); diff --git a/src/plugins/projectexplorer/buildprogress.cpp b/src/plugins/projectexplorer/buildprogress.cpp index 380d17be3d..d9141bfc93 100644 --- a/src/plugins/projectexplorer/buildprogress.cpp +++ b/src/plugins/projectexplorer/buildprogress.cpp @@ -77,8 +77,8 @@ BuildProgress::BuildProgress(TaskWindow *taskWindow) m_errorIcon->setAlignment(Qt::AlignRight); m_warningIcon->setAlignment(Qt::AlignRight); - m_errorIcon->setPixmap(QPixmap(":/projectexplorer/images/compile_error.png")); - m_warningIcon->setPixmap(QPixmap(":/projectexplorer/images/compile_warning.png")); + m_errorIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_error.png"))); + m_warningIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png"))); hide(); @@ -89,17 +89,17 @@ void BuildProgress::updateState() { if (!m_taskWindow) return; - int errors = m_taskWindow->errorTaskCount(Constants::TASK_CATEGORY_BUILDSYSTEM) - + m_taskWindow->errorTaskCount(Constants::TASK_CATEGORY_COMPILE); + int errors = m_taskWindow->errorTaskCount(QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM)) + + m_taskWindow->errorTaskCount(QLatin1String(Constants::TASK_CATEGORY_COMPILE)); bool haveErrors = (errors > 0); m_errorIcon->setEnabled(haveErrors); m_errorLabel->setEnabled(haveErrors); - m_errorLabel->setText(QString("%1").arg(errors)); + m_errorLabel->setText(QString::number(errors)); int warnings = m_taskWindow->warningTaskCount(); bool haveWarnings = (warnings > 0); m_warningIcon->setEnabled(haveWarnings); m_warningLabel->setEnabled(haveWarnings); - m_warningLabel->setText(QString("%1").arg(warnings)); + m_warningLabel->setText(QString::number(warnings)); // Hide warnings and errors unless you need them m_warningIcon->setVisible(haveWarnings); diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp index 799352c7ed..844878f3a0 100644 --- a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp @@ -88,7 +88,7 @@ PropertiesPanel *BuildSettingsPanelFactory::createPanel(Target *target) l->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); l->setContentsMargins(QMargins()); panel->setWidget(w); - panel->setIcon(QIcon(":/projectexplorer/images/BuildSettings.png")); + panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/BuildSettings.png"))); panel->setDisplayName(QCoreApplication::translate("BuildSettingsPanel", "Build Settings")); return panel; } diff --git a/src/plugins/projectexplorer/clangparser.cpp b/src/plugins/projectexplorer/clangparser.cpp index 90a72dfe76..d7e253fa24 100644 --- a/src/plugins/projectexplorer/clangparser.cpp +++ b/src/plugins/projectexplorer/clangparser.cpp @@ -74,7 +74,7 @@ void ClangParser::stdError(const QString &line) m_commandRegExp.cap(4), QString(), /* filename */ -1, /* line */ - Constants::TASK_CATEGORY_COMPILE); + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); if (m_commandRegExp.cap(3) == QLatin1String("warning")) m_currentTask.type = Task::Warning; else if (m_commandRegExp.cap(3) == QLatin1String("note")) @@ -88,7 +88,7 @@ void ClangParser::stdError(const QString &line) lne.trimmed(), m_inLineRegExp.cap(2), /* filename */ m_inLineRegExp.cap(3).toInt(), /* line */ - Constants::TASK_CATEGORY_COMPILE); + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); return; } @@ -102,10 +102,10 @@ void ClangParser::stdError(const QString &line) m_messageRegExp.cap(8), m_messageRegExp.cap(1), /* filename */ lineNo, - Constants::TASK_CATEGORY_COMPILE); - if (m_messageRegExp.cap(7) == "warning") + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); + if (m_messageRegExp.cap(7) == QLatin1String("warning")) m_currentTask.type = Task::Warning; - else if (m_messageRegExp.cap(7) == "note") + else if (m_messageRegExp.cap(7) == QLatin1String("note")) m_currentTask.type = Task::Unknown; return; } @@ -114,7 +114,7 @@ void ClangParser::stdError(const QString &line) QTextLayout::FormatRange fr; fr.start = m_currentTask.description.count() + 1; fr.length = lne.count() + 1; - fr.format.setFontFamily("Monospaced"); + fr.format.setFontFamily(QLatin1String("Monospaced")); fr.format.setFontStyleHint(QFont::TypeWriter); m_currentTask.description.append(QLatin1Char('\n')); m_currentTask.description.append(lne); @@ -157,6 +157,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); QTest::addColumn<QString>("outputLines"); + const QString categoryCompile = QLatin1String(Constants::TASK_CATEGORY_COMPILE); QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT @@ -177,7 +178,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << Task(Task::Warning, QLatin1String("argument unused during compilation: '-mthreads'"), QString(), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("clang++ error") << QString::fromLatin1("clang++: error: no input files [err_drv_no_input_files]") @@ -187,7 +188,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << Task(Task::Error, QLatin1String("no input files [err_drv_no_input_files]"), QString(), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("complex warning") << QString::fromLatin1("In file included from ..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qnamespace.h:45:\n" @@ -200,13 +201,13 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << Task(Task::Unknown, QLatin1String("In file included from ..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qnamespace.h:45:"), QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qnamespace.h"), 45, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("unknown attribute 'dllimport' ignored [-Wunknown-attributes]\n" "class Q_CORE_EXPORT QSysInfo {\n" " ^"), QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h"), 1425, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("note") << QString::fromLatin1("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h:1289:27: note: instantiated from:\n" @@ -220,7 +221,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() "# define Q_CORE_EXPORT Q_DECL_IMPORT\n" " ^"), QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h"), 1289, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("fatal error") << QString::fromLatin1("/usr/include/c++/4.6/utility:68:10: fatal error: 'bits/c++config.h' file not found\n" @@ -234,7 +235,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() "#include <bits/c++config.h>\n" " ^"), QLatin1String("/usr/include/c++/4.6/utility"), 68, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("line confusion") @@ -249,7 +250,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() " int x = option->rect.x() + horizontal ? 2 : 6;\n" " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^"), QLatin1String("/home/code/src/creator/src/plugins/coreplugin/manhattanstyle.cpp"), 567, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); } diff --git a/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp b/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp index e2a6dc744f..c989e5d07f 100644 --- a/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp @@ -63,7 +63,7 @@ PropertiesPanel *CodeStyleSettingsPanelFactory::createPanel(Project *project) { PropertiesPanel *panel = new PropertiesPanel; panel->setWidget(new CodeStyleSettingsWidget(project)); - panel->setIcon(QIcon(":/projectexplorer/images/CodeStyleSettings.png")); + panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/CodeStyleSettings.png"))); panel->setDisplayName(QCoreApplication::translate("CodeStyleSettingsPanel", "Code Style Settings")); return panel; } diff --git a/src/plugins/projectexplorer/copytaskhandler.cpp b/src/plugins/projectexplorer/copytaskhandler.cpp index 1d14a73f38..24d5213f76 100644 --- a/src/plugins/projectexplorer/copytaskhandler.cpp +++ b/src/plugins/projectexplorer/copytaskhandler.cpp @@ -63,8 +63,8 @@ void CopyTaskHandler::handle(const ProjectExplorer::Task &task) break; } - QApplication::clipboard()->setText(QDir::toNativeSeparators(task.file) + ':' + - QString::number(task.line) + ": " + QApplication::clipboard()->setText(QDir::toNativeSeparators(task.file) + QLatin1Char(':') + + QString::number(task.line) + QLatin1String(": ") + type + task.description); } diff --git a/src/plugins/projectexplorer/currentprojectfilter.h b/src/plugins/projectexplorer/currentprojectfilter.h index 1f8826e5ca..d3487bbdfd 100644 --- a/src/plugins/projectexplorer/currentprojectfilter.h +++ b/src/plugins/projectexplorer/currentprojectfilter.h @@ -51,7 +51,7 @@ class CurrentProjectFilter : public Locator::BaseFileFilter public: CurrentProjectFilter(ProjectExplorerPlugin *pe); QString displayName() const { return tr("Files in Current Project"); } - QString id() const { return "Files in current project"; } + QString id() const { return QLatin1String("Files in current project"); } Locator::ILocatorFilter::Priority priority() const { return Locator::ILocatorFilter::Low; } void refresh(QFutureInterface<void> &future); diff --git a/src/plugins/projectexplorer/customwizard/customwizard.cpp b/src/plugins/projectexplorer/customwizard/customwizard.cpp index 375b6a5a71..d93a7c986f 100644 --- a/src/plugins/projectexplorer/customwizard/customwizard.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizard.cpp @@ -483,7 +483,7 @@ QList<CustomWizard*> CustomWizard::createWizards() } else { if (CustomWizardPrivate::verbose) if (CustomWizardPrivate::verbose) - verboseLog += QString::fromLatin1("CustomWizard: '%1' not found\n").arg(qPrintable(configFile)); + verboseLog += QString::fromLatin1("CustomWizard: '%1' not found\n").arg(configFile); } } if (CustomWizardPrivate::verbose) { // Print to output pane for Windows. @@ -605,7 +605,7 @@ void CustomProjectWizard::projectParametersChanged(const QString &project, const // Make '%ProjectName%' available in base replacements. context()->baseReplacements.insert(QLatin1String("ProjectName"), project); - emit projectLocationChanged(path + QChar('/') + project); + emit projectLocationChanged(path + QLatin1Char('/') + project); } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp index bfc1760ce3..951815a711 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp @@ -252,7 +252,7 @@ static inline bool assignLanguageElementText(QXmlStreamReader &reader, const QString &desiredLanguage, QString *target) { - const QStringRef elementLanguage = reader.attributes().value(langAttributeC); + const QStringRef elementLanguage = reader.attributes().value(QLatin1String(langAttributeC)); if (elementLanguage.isEmpty()) { // Try to find a translation for our built-in Wizards *target = QCoreApplication::translate("ProjectExplorer::CustomWizard", reader.readElementText().toLatin1().constData()); @@ -275,7 +275,7 @@ static inline bool assignLanguageElementText(QXmlStreamReader &reader, Core::BaseFileWizardParameters *bp, void (Core::BaseFileWizardParameters::*setter)(const QString &)) { - const QStringRef elementLanguage = reader.attributes().value(langAttributeC); + const QStringRef elementLanguage = reader.attributes().value(QLatin1String(langAttributeC)); if (elementLanguage.isEmpty()) { // Try to find a translation for our built-in Wizards const QString translated = QCoreApplication::translate("ProjectExplorer::CustomWizard", reader.readElementText().toLatin1().constData()); diff --git a/src/plugins/projectexplorer/dependenciespanel.cpp b/src/plugins/projectexplorer/dependenciespanel.cpp index 9e5c383131..b5bac76e69 100644 --- a/src/plugins/projectexplorer/dependenciespanel.cpp +++ b/src/plugins/projectexplorer/dependenciespanel.cpp @@ -285,7 +285,7 @@ PropertiesPanel *DependenciesPanelFactory::createPanel(Project *project) { PropertiesPanel *panel = new PropertiesPanel; panel->setWidget(new DependenciesWidget(m_session, project)); - panel->setIcon(QIcon(":/projectexplorer/images/ProjectDependencies.png")); + panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/ProjectDependencies.png"))); panel->setDisplayName(QCoreApplication::translate("DependenciesPanel", "Dependencies")); return panel; } diff --git a/src/plugins/projectexplorer/doubletabwidget.cpp b/src/plugins/projectexplorer/doubletabwidget.cpp index 870b72f765..66250174f6 100644 --- a/src/plugins/projectexplorer/doubletabwidget.cpp +++ b/src/plugins/projectexplorer/doubletabwidget.cpp @@ -532,7 +532,7 @@ bool DoubleTabWidget::event(QEvent *event) if (hit.first == HITTAB && m_tabs.at(m_currentTabIndices.at(hit.second)).nameIsUnique) QToolTip::showText(helpevent->globalPos(), m_tabs.at(m_currentTabIndices.at(hit.second)).fullName, this); else - QToolTip::showText(helpevent->globalPos(), "", this); + QToolTip::showText(helpevent->globalPos(), QString(), this); } return QWidget::event(event); } diff --git a/src/plugins/projectexplorer/editorsettingspropertiespage.cpp b/src/plugins/projectexplorer/editorsettingspropertiespage.cpp index fbe8eb0cf9..7716ce5e02 100644 --- a/src/plugins/projectexplorer/editorsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/editorsettingspropertiespage.cpp @@ -60,7 +60,7 @@ PropertiesPanel *EditorSettingsPanelFactory::createPanel(Project *project) PropertiesPanel *panel = new PropertiesPanel; panel->setDisplayName(QCoreApplication::translate("EditorSettingsPanel", "Editor Settings")); panel->setWidget(new EditorSettingsWidget(project)), - panel->setIcon(QIcon(":/projectexplorer/images/EditorSettings.png")); + panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/EditorSettings.png"))); return panel; } diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index 353e07b1f3..b5ecafe0b8 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -204,7 +204,7 @@ void EnvironmentWidget::updateSummaryText() QString text; foreach (const Utils::EnvironmentItem &item, list) { if (item.name != Utils::EnvironmentModel::tr("<VARIABLE>")) { - text.append("<br>"); + text.append(QLatin1String("<br>")); if (item.unset) text.append(tr("Unset <a href=\"%1\"><b>%1</b></a>").arg(Qt::escape(item.name))); else diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp index 76a793aec4..f6094984fe 100644 --- a/src/plugins/projectexplorer/gccparser.cpp +++ b/src/plugins/projectexplorer/gccparser.cpp @@ -44,10 +44,12 @@ static const char COMMAND_PATTERN[] = "^(.*[\\\\/])?([a-z0-9]+-[a-z0-9]+-[a-z0-9 GccParser::GccParser() { setObjectName(QLatin1String("GCCParser")); - m_regExp.setPattern(QString(QChar('^')) + QString::fromLatin1(FILE_PATTERN) + QLatin1String("(\\d+):(\\d+:)?\\s+((fatal |#)?(warning|error|note):?\\s)?([^\\s].+)$")); + m_regExp.setPattern(QLatin1Char('^') + QLatin1String(FILE_PATTERN) + + QLatin1String("(\\d+):(\\d+:)?\\s+((fatal |#)?(warning|error|note):?\\s)?([^\\s].+)$")); m_regExp.setMinimal(true); - m_regExpIncluded.setPattern(QString::fromLatin1("\\bfrom\\s") + QString::fromLatin1(FILE_PATTERN) + QLatin1String("(\\d+)(:\\d+)?[,:]?$")); + m_regExpIncluded.setPattern(QString::fromLatin1("\\bfrom\\s") + QLatin1String(FILE_PATTERN) + + QLatin1String("(\\d+)(:\\d+)?[,:]?$")); m_regExpIncluded.setMinimal(true); // optional path with trailing slash @@ -55,7 +57,7 @@ GccParser::GccParser() // name of executable // optional trailing version number // optional .exe postfix - m_regExpGccNames.setPattern(COMMAND_PATTERN); + m_regExpGccNames.setPattern(QLatin1String(COMMAND_PATTERN)); m_regExpGccNames.setMinimal(true); appendOutputParser(new LdParser); @@ -79,7 +81,7 @@ void GccParser::stdError(const QString &line) lne /* description */, QString() /* filename */, -1 /* linenumber */, - Constants::TASK_CATEGORY_COMPILE)); + QLatin1String(Constants::TASK_CATEGORY_COMPILE))); return; } else if (m_regExpGccNames.indexIn(lne) > -1) { QString description = lne.mid(m_regExpGccNames.matchedLength()); @@ -87,7 +89,7 @@ void GccParser::stdError(const QString &line) description, QString(), /* filename */ -1, /* line */ - Constants::TASK_CATEGORY_COMPILE); + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); if (description.startsWith(QLatin1String("warning: "))) { task.type = Task::Warning; task.description = description.mid(9); @@ -102,7 +104,7 @@ void GccParser::stdError(const QString &line) Task task(Task::Unknown, m_regExp.cap(8) /* description */, filename, lineno, - Constants::TASK_CATEGORY_COMPILE); + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); if (m_regExp.cap(7) == QLatin1String("warning")) task.type = Task::Warning; else if (m_regExp.cap(7) == QLatin1String("error") || @@ -111,7 +113,7 @@ void GccParser::stdError(const QString &line) // Prepend "#warning" or "#error" if that triggered the match on (warning|error) // We want those to show how the warning was triggered - if (m_regExp.cap(5).startsWith(QChar('#'))) + if (m_regExp.cap(5).startsWith(QLatin1Char('#'))) task.description = m_regExp.cap(5) + task.description; emit addTask(task); @@ -121,7 +123,7 @@ void GccParser::stdError(const QString &line) lne /* description */, m_regExpIncluded.cap(1) /* filename */, m_regExpIncluded.cap(3).toInt() /* linenumber */, - Constants::TASK_CATEGORY_COMPILE)); + QLatin1String(Constants::TASK_CATEGORY_COMPILE))); return; } IOutputParser::stdError(line); @@ -145,6 +147,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); QTest::addColumn<QString>("outputLines"); + const QString categoryCompile = QLatin1String(Constants::TASK_CATEGORY_COMPILE); QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT @@ -167,15 +170,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In function `int main(int, char**)':"), QLatin1String("/temp/test/untitled8/main.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Error, QLatin1String("`sfasdf' undeclared (first use this function)"), QLatin1String("/temp/test/untitled8/main.cpp"), 9, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Error, QLatin1String("(Each undeclared identifier is reported only once for each function it appears in.)"), QLatin1String("/temp/test/untitled8/main.cpp"), 9, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) ) << QString(); QTest::newRow("GCCE warning") @@ -186,7 +189,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Warning, QLatin1String("inline function `QDebug qDebug()' used but never defined"), QLatin1String("/src/corelib/global/qglobal.h"), 1635, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("warning") << QString::fromLatin1("main.cpp:7:2: warning: Some warning") @@ -195,7 +198,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (QList<ProjectExplorer::Task>() << Task(Task::Warning, QLatin1String("Some warning"), QLatin1String("main.cpp"), 7, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("GCCE #error") << QString::fromLatin1("C:\\temp\\test\\untitled8\\main.cpp:7: #error Symbian error") @@ -204,7 +207,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (QList<ProjectExplorer::Task>() << Task(Task::Error, QLatin1String("#error Symbian error"), QLatin1String("C:\\temp\\test\\untitled8\\main.cpp"), 7, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); // Symbian reports #warning(s) twice (using different syntax). QTest::newRow("GCCE #warning1") @@ -214,7 +217,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (QList<ProjectExplorer::Task>() << Task(Task::Warning, QLatin1String("#warning Symbian warning"), QLatin1String("C:\\temp\\test\\untitled8\\main.cpp"), 8, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("GCCE #warning2") << QString::fromLatin1("/temp/test/untitled8/main.cpp:8:2: warning: #warning Symbian warning") @@ -223,7 +226,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (QList<ProjectExplorer::Task>() << Task(Task::Warning, QLatin1String("#warning Symbian warning"), QLatin1String("/temp/test/untitled8/main.cpp"), 8, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("Undefined reference (debug)") << QString::fromLatin1("main.o: In function `main':\n" @@ -235,15 +238,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In function `main':"), QLatin1String("main.o"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Error, QLatin1String("undefined reference to `MainWindow::doSomething()'"), QLatin1String("C:\\temp\\test\\untitled8/main.cpp"), 8, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Error, QLatin1String("collect2: ld returned 1 exit status"), QString(), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) ) << QString(); QTest::newRow("Undefined reference (release)") @@ -256,15 +259,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In function `main':"), QLatin1String("main.o"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Error, QLatin1String("undefined reference to `MainWindow::doSomething()'"), QLatin1String("C:\\temp\\test\\untitled8/main.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Error, QLatin1String("collect2: ld returned 1 exit status"), QString(), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) ) << QString(); QTest::newRow("linker: dll format not recognized") @@ -275,7 +278,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Error, QLatin1String("file not recognized: File format not recognized"), QLatin1String("c:\\Qt\\4.6\\lib/QtGuid4.dll"), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("Invalid rpath") << QString::fromLatin1("g++: /usr/local/lib: No such file or directory") @@ -285,7 +288,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Error, QLatin1String("/usr/local/lib: No such file or directory"), QString(), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("Invalid rpath") @@ -298,15 +301,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In member function 'void Debugger::Internal::GdbEngine::handleBreakInsert2(const Debugger::Internal::GdbResponse&)':"), QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("unused variable 'index'"), QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp"), 2114, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("unused variable 'handler'"), QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp"), 2115, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("gnumakeparser.cpp errors") << QString::fromLatin1("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp: In member function 'void ProjectExplorer::ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data()':\n" @@ -318,15 +321,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In member function 'void ProjectExplorer::ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data()':"), QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Error, QLatin1String("expected primary-expression before ':' token"), QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp"), 264, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Error, QLatin1String("expected ';' before ':' token"), QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp"), 264, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("distcc error(QTCREATORBUG-904)") << QString::fromLatin1("distcc[73168] (dcc_get_hostlist) Warning: no hostlist is set; can't distribute work\n" @@ -344,7 +347,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Warning, QLatin1String("Core::IEditor* QVariant::value<Core::IEditor*>() const has different visibility (hidden) in .obj/debug-shared/openeditorsview.o and (default) in .obj/debug-shared/editormanager.o"), QString(), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("ld fatal") << QString::fromLatin1("ld: fatal: Symbol referencing errors. No output written to testproject") @@ -354,7 +357,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Error, QLatin1String("Symbol referencing errors. No output written to testproject"), QString(), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("Teambuilder issues") << QString::fromLatin1("TeamBuilder Client:: error: could not find Scheduler, running Job locally...") @@ -370,7 +373,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("initialized from here"), QString::fromLatin1("/home/dev/creator/share/qtcreator/dumper/dumper.cpp"), 1079, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("static member function") << QString::fromLatin1("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c: In static member function 'static std::_Rb_tree_node_base* std::_Rb_global<_Dummy>::_Rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&)':\n" @@ -381,22 +384,22 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In static member function 'static std::_Rb_tree_node_base* std::_Rb_global<_Dummy>::_Rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&)':"), QString::fromLatin1("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("suggest explicit braces to avoid ambiguous 'else'"), QString::fromLatin1("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c"), 194, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("rm false positive") << QString::fromLatin1("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory") << OutputParserTester::STDERR - << QString() << QString("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory\n") + << QString() << QString(QLatin1String("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory\n")) << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("ranlib false positive") << QString::fromLatin1("ranlib: file: libSupport.a(HashTable.o) has no symbols") << OutputParserTester::STDERR - << QString() << QString("ranlib: file: libSupport.a(HashTable.o) has no symbols\n") + << QString() << QString(QLatin1String("ranlib: file: libSupport.a(HashTable.o) has no symbols\n")) << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("ld: missing library") @@ -407,7 +410,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Error, QLatin1String("cannot find -ldoesnotexist"), QString(), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("In function") << QString::fromLatin1("../../scriptbug/main.cpp: In function void foo(i) [with i = double]:\n" @@ -419,15 +422,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In function void foo(i) [with i = double]:"), QLatin1String("../../scriptbug/main.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Unknown, QLatin1String("instantiated from here"), QLatin1String("../../scriptbug/main.cpp"), 22, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("unused variable c"), QLatin1String("../../scriptbug/main.cpp"), 8, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("instanciated from here") << QString::fromLatin1("main.cpp:10: instantiated from here ") @@ -437,7 +440,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("instantiated from here"), QLatin1String("main.cpp"), 10, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("In constructor") << QString::fromLatin1("/dev/creator/src/plugins/find/basetextfind.h: In constructor 'Find::BaseTextFind::BaseTextFind(QTextEdit*)':") @@ -447,7 +450,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In constructor 'Find::BaseTextFind::BaseTextFind(QTextEdit*)':"), QLatin1String("/dev/creator/src/plugins/find/basetextfind.h"), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("At global scope") @@ -462,23 +465,23 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("At global scope:"), QLatin1String("../../scriptbug/main.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Unknown, QLatin1String("In instantiation of void bar(i) [with i = double]:"), QLatin1String("../../scriptbug/main.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Unknown, QLatin1String("instantiated from void foo(i) [with i = double]"), QLatin1String("../../scriptbug/main.cpp"), 8, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Unknown, QLatin1String("instantiated from here"), QLatin1String("../../scriptbug/main.cpp"), 22, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("unused parameter v"), QLatin1String("../../scriptbug/main.cpp"), 5, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("gcc 4.5 fatal error") @@ -489,7 +492,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Error, QLatin1String("test.moc: No such file or directory"), QLatin1String("/home/code/test.cpp"), 54, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("QTCREATORBUG-597") @@ -503,19 +506,19 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In function `QPlotAxis':"), QLatin1String("debug/qplotaxis.o"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Error, QLatin1String("undefined reference to `vtable for QPlotAxis'"), QLatin1String("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), 26, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Error, QLatin1String("undefined reference to `vtable for QPlotAxis'"), QLatin1String("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), 26, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Error, QLatin1String("collect2: ld returned 1 exit status"), QString(), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("instantiated from here should not be an error") @@ -530,23 +533,23 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In member function typename _Vector_base<_Tp, _Alloc>::_Tp_alloc_type::const_reference Vector<_Tp, _Alloc>::at(int) [with _Tp = Point, _Alloc = Allocator<Point>]:"), QLatin1String("../stl/main.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Unknown, QLatin1String("instantiated from here"), QLatin1String("../stl/main.cpp"), 38, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("returning reference to temporary"), QLatin1String("../stl/main.cpp"), 31, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Unknown, QLatin1String("At global scope:"), QLatin1String("../stl/main.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("unused parameter index"), QLatin1String("../stl/main.cpp"), 31, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("GCCE from lines") @@ -560,19 +563,19 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In file included from C:/Symbian_SDK/epoc32/include/e32cmn.h:6792,"), QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.h"), 6792, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Unknown, QLatin1String("from C:/Symbian_SDK/epoc32/include/e32std.h:25,"), QLatin1String("C:/Symbian_SDK/epoc32/include/e32std.h"), 25, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Unknown, QLatin1String("In member function 'SSecureId::operator const TSecureId&() const':"), QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.inl"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("returning reference to temporary"), QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.inl"), 7094, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("QTCREATORBUG-2206") @@ -583,7 +586,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("At top level:"), QLatin1String("../../../src/XmlUg/targetdelete.c"), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("GCCE 4: commandline, includes") @@ -596,15 +599,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In file included from /Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h:15,"), QLatin1String("/Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h"), 15, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Unknown, QLatin1String("from <command line>:26:"), QLatin1String("<command line>"), 26, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("no newline at end of file"), QLatin1String("/Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh"), 1134, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("Linker fail (release build)") @@ -615,7 +618,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Error, QLatin1String("undefined reference to `MainWindow::doSomething()'"), QLatin1String("main.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("enumeration warning") @@ -627,11 +630,11 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In member function 'ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateConditionalFunction(const ProString&, const ProStringList&)':"), QLatin1String("../../../src/shared/proparser/profileevaluator.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("case value '0' not in enumerated type 'ProFileEvaluator::Private::TestFunc'"), QLatin1String("../../../src/shared/proparser/profileevaluator.cpp"), 2817, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("include with line:column info") @@ -643,11 +646,11 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In file included from <command-line>:0:0:"), QLatin1String("<command-line>"), 0, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("\"STUPID_DEFINE\" redefined"), QLatin1String("./mw.h"), 4, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("instanciation with line:column info") << QString::fromLatin1("file.h: In function 'void UnitTest::CheckEqual(UnitTest::TestResults&, const Expected&, const Actual&, const UnitTest::TestDetails&) [with Expected = unsigned int, Actual = int]':\n" @@ -659,15 +662,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Unknown, QLatin1String("In function 'void UnitTest::CheckEqual(UnitTest::TestResults&, const Expected&, const Actual&, const UnitTest::TestDetails&) [with Expected = unsigned int, Actual = int]':"), QLatin1String("file.h"), -1, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Unknown, QLatin1String("instantiated from here"), QLatin1String("file.cpp"), 87, - Constants::TASK_CATEGORY_COMPILE) + categoryCompile) << Task(Task::Warning, QLatin1String("comparison between signed and unsigned integer expressions [-Wsign-compare]"), QLatin1String("file.h"), 21, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("linker error") // QTCREATORBUG-3107 << QString::fromLatin1("cns5k_ins_parser_tests.cpp:(.text._ZN20CNS5kINSParserEngine21DropBytesUntilStartedEP14CircularBufferIhE[CNS5kINSParserEngine::DropBytesUntilStarted(CircularBuffer<unsigned char>*)]+0x6d): undefined reference to `CNS5kINSPacket::SOH_BYTE'") @@ -677,7 +680,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << Task(Task::Error, QLatin1String("undefined reference to `CNS5kINSPacket::SOH_BYTE'"), QLatin1String("cns5k_ins_parser_tests.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); } diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 1a6787add1..102f8e7b16 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -145,7 +145,7 @@ static QList<HeaderPath> gccHeaderPathes(const QString &gcc, const QStringList & line = cpp.readLine(); if (line.startsWith("#include")) { kind = HeaderPath::GlobalHeaderPath; - } else if (! line.isEmpty() && QChar(line.at(0)).isSpace()) { + } else if (! line.isEmpty() && QChar(QLatin1Char(line.at(0))).isSpace()) { HeaderPath::Kind thisHeaderKind = kind; line = line.trimmed(); @@ -160,7 +160,7 @@ static QList<HeaderPath> gccHeaderPathes(const QString &gcc, const QStringList & } else if (line.startsWith("End of search list.")) { break; } else { - qWarning() << "ignore line:" << line; + qWarning("%s: Ignoring line: %s", __FUNCTION__, line.constData()); } } } @@ -175,7 +175,7 @@ static QList<ProjectExplorer::Abi> guessGccAbi(const QString &m) if (machine.isEmpty()) return abiList; - QStringList parts = machine.split(QRegExp("[ /-]")); + QStringList parts = machine.split(QRegExp(QLatin1String("[ /-]"))); ProjectExplorer::Abi::Architecture arch = ProjectExplorer::Abi::UnknownArchitecture; ProjectExplorer::Abi::OS os = ProjectExplorer::Abi::UnknownOS; @@ -211,7 +211,7 @@ static QList<ProjectExplorer::Abi> guessGccAbi(const QString &m) if (flavor == Abi::UnknownFlavor) flavor = ProjectExplorer::Abi::GenericLinuxFlavor; format = ProjectExplorer::Abi::ElfFormat; - } else if (p.startsWith("freebsd")) { + } else if (p.startsWith(QLatin1String("freebsd"))) { os = ProjectExplorer::Abi::BsdOS; if (flavor == Abi::UnknownFlavor) flavor = ProjectExplorer::Abi::FreeBsdFlavor; @@ -426,11 +426,11 @@ Utils::FileName GccToolChain::mkspec() const if (abi.osFlavor() != Abi::GenericLinuxFlavor) return Utils::FileName(); // most likely not a desktop, so leave the mkspec alone. if (abi.wordWidth() == gccAbi.wordWidth()) - return Utils::FileName::fromString("linux-g++"); // no need to explicitly set the word width - return Utils::FileName::fromString("linux-g++-" + QString::number(m_targetAbi.wordWidth())); + return Utils::FileName::fromString(QLatin1String("linux-g++")); // no need to explicitly set the word width + return Utils::FileName::fromString(QLatin1String("linux-g++-") + QString::number(m_targetAbi.wordWidth())); } if (abi.os() == Abi::BsdOS && abi.osFlavor() == Abi::FreeBsdFlavor) - return Utils::FileName::fromString("freebsd-g++"); + return Utils::FileName::fromString(QLatin1String("freebsd-g++")); return Utils::FileName(); } @@ -785,9 +785,9 @@ Utils::FileName ClangToolChain::mkspec() const { Abi abi = targetAbi(); if (abi.os() == Abi::MacOS) - return Utils::FileName::fromString("unsupported/macx-clang"); + return Utils::FileName::fromString(QLatin1String("unsupported/macx-clang")); else if (abi.os() == Abi::LinuxOS) - return Utils::FileName::fromString("unsupported/linux-clang"); + return Utils::FileName::fromString(QLatin1String("unsupported/linux-clang")); return Utils::FileName(); // Note: Not supported by Qt yet, so default to the mkspec the Qt was build with } @@ -866,7 +866,7 @@ QString MingwToolChain::typeName() const Utils::FileName MingwToolChain::mkspec() const { - return Utils::FileName::fromString("win32-g++"); + return Utils::FileName::fromString(QLatin1String("win32-g++")); } QString MingwToolChain::makeCommand() const @@ -977,7 +977,7 @@ IOutputParser *LinuxIccToolChain::outputParser() const Utils::FileName LinuxIccToolChain::mkspec() const { - return Utils::FileName::fromString("linux-icc-" + QString::number(targetAbi().wordWidth())); + return Utils::FileName::fromString(QLatin1String("linux-icc-") + QString::number(targetAbi().wordWidth())); } ToolChain *LinuxIccToolChain::clone() const diff --git a/src/plugins/projectexplorer/gnumakeparser.cpp b/src/plugins/projectexplorer/gnumakeparser.cpp index 8ad83418cf..43ddba6fc5 100644 --- a/src/plugins/projectexplorer/gnumakeparser.cpp +++ b/src/plugins/projectexplorer/gnumakeparser.cpp @@ -75,7 +75,7 @@ void GnuMakeParser::stdOutput(const QString &line) QString lne = line.trimmed(); if (m_makeDir.indexIn(lne) > -1) { - if (m_makeDir.cap(7) == "Leaving") + if (m_makeDir.cap(7) == QLatin1String("Leaving")) removeDirectory(m_makeDir.cap(8)); else addDirectory(m_makeDir.cap(8)); @@ -97,7 +97,7 @@ void GnuMakeParser::stdError(const QString &line) m_makefileError.cap(3), m_makefileError.cap(1), m_makefileError.cap(2).toInt(), - Constants::TASK_CATEGORY_BUILDSYSTEM)); + QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))); } return; } @@ -110,7 +110,7 @@ void GnuMakeParser::stdError(const QString &line) m_makeLine.cap(8), QString() /* filename */, -1, /* line */ - Constants::TASK_CATEGORY_BUILDSYSTEM)); + QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))); } return; } @@ -262,7 +262,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << Task(Task::Error, QString::fromLatin1("No rule to make target `hello.c', needed by `hello.o'. Stop."), QString(), -1, - Constants::TASK_CATEGORY_BUILDSYSTEM)) + QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); QTest::newRow("multiple fatals") @@ -276,7 +276,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << Task(Task::Error, QString::fromLatin1("[.obj/debug-shared/gnumakeparser.o] Error 1"), QString(), -1, - Constants::TASK_CATEGORY_BUILDSYSTEM)) + QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); QTest::newRow("Makefile error") @@ -288,7 +288,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << Task(Task::Error, QString::fromLatin1("missing separator (did you mean TAB instead of 8 spaces?). Stop."), QString::fromLatin1("Makefile"), 360, - Constants::TASK_CATEGORY_BUILDSYSTEM)) + QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); QTest::newRow("mingw32-make error") @@ -301,7 +301,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << Task(Task::Error, QString::fromLatin1("[debug/qplotaxis.o] Error 1"), QString(), -1, - Constants::TASK_CATEGORY_BUILDSYSTEM)) + QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); QTest::newRow("mingw64-make error") @@ -313,7 +313,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << Task(Task::Error, QString::fromLatin1("[dynlib.inst] Error -1073741819"), QString(), -1, - Constants::TASK_CATEGORY_BUILDSYSTEM)) + QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); QTest::newRow("pass-trough note") @@ -333,7 +333,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << Task(Task::Error, QString::fromLatin1("[sis] Error 2"), QString(), -1, - Constants::TASK_CATEGORY_BUILDSYSTEM)) + QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); QTest::newRow("missing g++") @@ -345,7 +345,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << Task(Task::Error, QString::fromLatin1("g++: Command not found"), QString(), -1, - Constants::TASK_CATEGORY_BUILDSYSTEM)) + QLatin1String(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); } @@ -409,12 +409,12 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data() QLatin1String("no filename, no mangling"), QString(), -1, - Constants::TASK_CATEGORY_COMPILE) + QLatin1String(Constants::TASK_CATEGORY_COMPILE)) << Task(Task::Error, QLatin1String("no filename, no mangling"), QString(), -1, - Constants::TASK_CATEGORY_COMPILE); + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); QTest::newRow("no mangling") << QStringList() << QStringList() @@ -422,25 +422,25 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data() QLatin1String("unknown filename, no mangling"), QString::fromLatin1("some/path/unknown.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE) + QLatin1String(Constants::TASK_CATEGORY_COMPILE)) << Task(Task::Error, QLatin1String("unknown filename, no mangling"), QString::fromLatin1("some/path/unknown.cpp"), -1, - Constants::TASK_CATEGORY_COMPILE); + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); QTest::newRow("find file") - << (QStringList() << "test/file.cpp") - << (QStringList() << "test") + << (QStringList(QLatin1String("test/file.cpp"))) + << (QStringList(QLatin1String("test"))) << Task(Task::Error, QLatin1String("mangling"), QString::fromLatin1("file.cpp"), 10, - Constants::TASK_CATEGORY_COMPILE) + QLatin1String(Constants::TASK_CATEGORY_COMPILE)) << Task(Task::Error, QLatin1String("mangling"), QString::fromLatin1("$TMPDIR/test/file.cpp"), 10, - Constants::TASK_CATEGORY_COMPILE); + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); } void ProjectExplorerPlugin::testGnuMakeParserTaskMangling() @@ -456,16 +456,17 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling() // setup files: QString tempdir = QDir::tempPath(); - tempdir.append(QChar('/')); + const QChar slash = QLatin1Char('/'); + tempdir.append(slash); tempdir.append(QUuid::createUuid().toString()); - tempdir.append(QChar('/')); + tempdir.append(slash); QDir filedir(tempdir); foreach (const QString &file, files) { - Q_ASSERT(!file.startsWith(QChar('/'))); + Q_ASSERT(!file.startsWith(slash)); Q_ASSERT(!file.contains(QLatin1String("../"))); - filedir.mkpath(file.left(file.lastIndexOf(QChar('/')))); + filedir.mkpath(file.left(file.lastIndexOf(slash))); QFile tempfile(tempdir + file); if (!tempfile.open(QIODevice::WriteOnly)) @@ -476,7 +477,7 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling() // setup search dirs: foreach (const QString &dir, searchDirectories) { - Q_ASSERT(!dir.startsWith(QChar('/'))); + Q_ASSERT(!dir.startsWith(QLatin1Char('/'))); Q_ASSERT(!dir.contains(QLatin1String("../"))); childParser->addDirectory(tempdir + dir); } diff --git a/src/plugins/projectexplorer/ldparser.cpp b/src/plugins/projectexplorer/ldparser.cpp index 39f95a766d..6cfccc58c9 100644 --- a/src/plugins/projectexplorer/ldparser.cpp +++ b/src/plugins/projectexplorer/ldparser.cpp @@ -48,13 +48,13 @@ namespace { LdParser::LdParser() { setObjectName(QLatin1String("LdParser")); - m_regExpLinker.setPattern(QString('^') + - QString::fromLatin1(FILE_PATTERN) + '(' + - QString::fromLatin1(FILE_PATTERN) + ")?(" + - QLatin1String(POSITION_PATTERN) + ")?\\s(.+)$"); + m_regExpLinker.setPattern(QLatin1Char('^') + + QString::fromLatin1(FILE_PATTERN) + QLatin1Char('(') + + QString::fromLatin1(FILE_PATTERN) + QLatin1String(")?(") + + QLatin1String(POSITION_PATTERN) + QLatin1String(")?\\s(.+)$")); m_regExpLinker.setMinimal(true); - m_regExpGccNames.setPattern(COMMAND_PATTERN); + m_regExpGccNames.setPattern(QLatin1String(COMMAND_PATTERN)); m_regExpGccNames.setMinimal(true); } @@ -72,7 +72,7 @@ void LdParser::stdError(const QString &line) lne /* description */, QString() /* filename */, -1 /* linenumber */, - Constants::TASK_CATEGORY_COMPILE)); + QLatin1String(Constants::TASK_CATEGORY_COMPILE))); return; } else if (m_regExpGccNames.indexIn(lne) > -1) { QString description = lne.mid(m_regExpGccNames.matchedLength()); @@ -80,7 +80,7 @@ void LdParser::stdError(const QString &line) description, QString(), /* filename */ -1, /* line */ - Constants::TASK_CATEGORY_COMPILE); + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); if (description.startsWith(QLatin1String("warning: "))) { task.type = Task::Warning; task.description = description.mid(9); @@ -100,7 +100,7 @@ void LdParser::stdError(const QString &line) filename = m_regExpLinker.cap(4); QString description = m_regExpLinker.cap(8).trimmed(); Task task(Task::Error, description, filename, lineno, - Constants::TASK_CATEGORY_COMPILE); + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); if (description.startsWith(QLatin1String("At global scope")) || description.startsWith(QLatin1String("At top level")) || description.startsWith(QLatin1String("instantiated from ")) || diff --git a/src/plugins/projectexplorer/linuxiccparser.cpp b/src/plugins/projectexplorer/linuxiccparser.cpp index 438aaa05e8..f9d3ca20bc 100644 --- a/src/plugins/projectexplorer/linuxiccparser.cpp +++ b/src/plugins/projectexplorer/linuxiccparser.cpp @@ -43,20 +43,20 @@ LinuxIccParser::LinuxIccParser() setObjectName(QLatin1String("LinuxIccParser")); // main.cpp(53): error #308: function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible - m_firstLine.setPattern("^([^\\(\\)]+)" // filename (cap 1) - "\\((\\d+)\\):" // line number including : (cap 2) - " ((error|warning)( #\\d+)?: )?" // optional type (cap 4) and optional error number // TODO really optional ? - "(.*)$"); // description (cap 6) + m_firstLine.setPattern(QLatin1String("^([^\\(\\)]+)" // filename (cap 1) + "\\((\\d+)\\):" // line number including : (cap 2) + " ((error|warning)( #\\d+)?: )?" // optional type (cap 4) and optional error number // TODO really optional ? + "(.*)$")); // description (cap 6) //m_firstLine.setMinimal(true); // Note pattern also matches caret lines - m_continuationLines.setPattern("^\\s+" // At least one whitespace - "(.*)$");// description + m_continuationLines.setPattern(QLatin1String("^\\s+" // At least one whitespace + "(.*)$"));// description m_continuationLines.setMinimal(true); - m_caretLine.setPattern("^\\s*" // Whitespaces - "\\^" // a caret - "\\s*$"); // and again whitespaces + m_caretLine.setPattern(QLatin1String("^\\s*" // Whitespaces + "\\^" // a caret + "\\s*$")); // and again whitespaces m_caretLine.setMinimal(true); appendOutputParser(new LdParser); @@ -86,13 +86,13 @@ void LinuxIccParser::stdError(const QString &line) } else if (!m_expectFirstLine && m_caretLine.indexIn(line) != -1) { // Format the last line as code QTextLayout::FormatRange fr; - fr.start = m_temporary.description.lastIndexOf('\n') + 1; + fr.start = m_temporary.description.lastIndexOf(QLatin1Char('\n')) + 1; fr.length = m_temporary.description.length() - fr.start; fr.format.setFontItalic(true); m_temporary.formats.append(fr); QTextLayout::FormatRange fr2; - fr2.start = fr.start + line.indexOf('^') - m_indent; + fr2.start = fr.start + line.indexOf(QLatin1Char('^')) - m_indent; fr2.length = 1; fr2.format.setFontWeight(QFont::Bold); m_temporary.formats.append(fr2); @@ -101,7 +101,7 @@ void LinuxIccParser::stdError(const QString &line) emit addTask(m_temporary); m_temporary = Task(); } else if (!m_expectFirstLine && m_continuationLines.indexIn(line) != -1) { - m_temporary.description.append("\n"); + m_temporary.description.append(QLatin1Char('\n')); m_indent = 0; while (m_indent < line.length() && line.at(m_indent).isSpace()) m_indent++; @@ -126,6 +126,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); QTest::addColumn<QString>("outputLines"); + const QString categoryCompile = QLatin1String(Constants::TASK_CATEGORY_COMPILE); QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT @@ -149,7 +150,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << Task(Task::Error, QLatin1String("identifier \"f\" is undefined\nf(0);"), QLatin1String("main.cpp"), 13, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("private function") @@ -163,7 +164,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << Task(Task::Error, QLatin1String("function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible\nb.privatefunc();"), QLatin1String("main.cpp"), 53, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); QTest::newRow("simple warning") @@ -177,7 +178,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << Task(Task::Warning, QLatin1String("use of \"=\" where \"==\" may have been intended\nwhile (a = true)"), QLatin1String("main.cpp"), 41, - Constants::TASK_CATEGORY_COMPILE)) + categoryCompile)) << QString(); } diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp index 2ab3cfbd0f..731a5194e0 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp +++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp @@ -55,7 +55,7 @@ LocalApplicationRunControlFactory::~LocalApplicationRunControlFactory() bool LocalApplicationRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode) const { - return (mode == ProjectExplorer::Constants::RUNMODE) + return (mode == QLatin1String(ProjectExplorer::Constants::RUNMODE)) && (qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration) != 0); } @@ -135,7 +135,7 @@ bool LocalApplicationRunControl::isRunning() const QIcon LocalApplicationRunControl::icon() const { - return QIcon(ProjectExplorer::Constants::ICON_RUN_SMALL); + return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL)); } void LocalApplicationRunControl::slotAppendMessage(const QString &err, diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index efd84c1d6e..f371136345 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -134,7 +134,7 @@ void TargetSelectorDelegate::paint(QPainter *painter, if (elidedText != text) const_cast<QAbstractItemModel *>(index.model())->setData(index, text, Qt::ToolTipRole); else - const_cast<QAbstractItemModel *>(index.model())->setData(index, "", Qt::ToolTipRole); + const_cast<QAbstractItemModel *>(index.model())->setData(index, QString(), Qt::ToolTipRole); painter->drawText(option.rect.left() + 6, option.rect.top() + (option.rect.height() - fm.height()) / 2 + fm.ascent(), elidedText); painter->restore(); @@ -165,7 +165,7 @@ QSize ListWidget::sizeHint() const // We try to keep the height of the popup equal to the actionbar QSize size(width, height); static QStatusBar *statusBar = Core::ICore::instance()->statusBar(); - static QWidget *actionBar = Core::ICore::instance()->mainWindow()->findChild<QWidget*>("actionbar"); + static QWidget *actionBar = Core::ICore::instance()->mainWindow()->findChild<QWidget*>(QLatin1String("actionbar")); Q_ASSERT(actionBar); QMargins popupMargins = window()->contentsMargins(); @@ -991,7 +991,7 @@ void MiniProjectTargetSelector::keyReleaseEvent(QKeyEvent *ke) QSize MiniProjectTargetSelector::sizeHint() const { static QStatusBar *statusBar = Core::ICore::instance()->statusBar(); - static QWidget *actionBar = Core::ICore::instance()->mainWindow()->findChild<QWidget*>("actionbar"); + static QWidget *actionBar = Core::ICore::instance()->mainWindow()->findChild<QWidget*>(QLatin1String("actionbar")); Q_ASSERT(actionBar); int alignedWithActionHeight diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp index 7b2357a7db..e5a6c1cfbc 100644 --- a/src/plugins/projectexplorer/msvcparser.cpp +++ b/src/plugins/projectexplorer/msvcparser.cpp @@ -84,7 +84,7 @@ void MsvcParser::stdOutput(const QString &line) if (m_lastTask.isNull()) return; - m_lastTask.description.append(QChar('\n')); + m_lastTask.description.append(QLatin1Char('\n')); m_lastTask.description.append(line.mid(8)); // trim trailing spaces: int i = 0; @@ -96,7 +96,7 @@ void MsvcParser::stdOutput(const QString &line) if (m_lastTask.formats.isEmpty()) { QTextLayout::FormatRange fr; - fr.start = m_lastTask.description.indexOf('\n') + 1; + fr.start = m_lastTask.description.indexOf(QLatin1Char('\n')) + 1; fr.length = m_lastTask.description.length() - fr.start; fr.format.setFontItalic(true); m_lastTask.formats.append(fr); @@ -113,7 +113,7 @@ void MsvcParser::stdOutput(const QString &line) m_additionalInfoRegExp.cap(3).trimmed(), /* description */ m_additionalInfoRegExp.cap(1), /* fileName */ m_additionalInfoRegExp.cap(2).toInt(), /* linenumber */ - Constants::TASK_CATEGORY_COMPILE); + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); return; } IOutputParser::stdOutput(line); @@ -135,7 +135,7 @@ bool MsvcParser::processCompileLine(const QString &line) m_lastTask = Task(Task::Unknown, m_compileRegExp.cap(4).trimmed() /* description */, position.first, position.second, - Constants::TASK_CATEGORY_COMPILE); + QLatin1String(Constants::TASK_CATEGORY_COMPILE)); if (m_compileRegExp.cap(3) == QLatin1String("warning")) m_lastTask.type = Task::Warning; else if (m_compileRegExp.cap(3) == QLatin1String("error")) diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 234b54b5ea..033f7bcb8b 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -170,7 +170,7 @@ QByteArray MsvcToolChain::msvcPredefinedMacros(const Utils::Environment &env) co { QByteArray predefinedMacros = AbstractMsvcToolChain::msvcPredefinedMacros(env); - Utils::TempFileSaver saver(QDir::tempPath()+"/envtestXXXXXX.cpp"); + Utils::TempFileSaver saver(QDir::tempPath() + QLatin1String("/envtestXXXXXX.cpp")); saver.write(msvcCompilationFile()); if (!saver.finalize()) { qWarning("%s: %s", Q_FUNC_INFO, qPrintable(saver.errorString())); @@ -502,7 +502,7 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect() QList<ToolChain *> results; // 1) Installed SDKs preferred over standalone Visual studio - const QSettings sdkRegistry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows", + const QSettings sdkRegistry(QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows"), QSettings::NativeFormat); const QString defaultSdkPath = sdkRegistry.value(QLatin1String("CurrentInstallFolder")).toString(); if (!defaultSdkPath.isEmpty()) { diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp index 516b767a04..5e6ae0deb3 100644 --- a/src/plugins/projectexplorer/outputparser_test.cpp +++ b/src/plugins/projectexplorer/outputparser_test.cpp @@ -61,7 +61,7 @@ void OutputParserTester::testParsing(const QString &lines, reset(); Q_ASSERT(childParser()); - QStringList inputLines = lines.split(QChar('\n')); + QStringList inputLines = lines.split(QLatin1Char('\n')); foreach (const QString &input, inputLines) { if (inputChannel == STDOUT) childParser()->stdOutput(input + QLatin1Char('\n')); @@ -158,7 +158,7 @@ void OutputParserTester::outputAdded(const QString &line, ProjectExplorer::Build { Q_UNUSED(format); if (!m_receivedOutput.isEmpty()) - m_receivedOutput.append(QChar('\n')); + m_receivedOutput.append(QLatin1Char('\n')); m_receivedOutput.append(line); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 57304c0306..b10bfc1d7b 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -492,10 +492,10 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er Core::ActionContainer *runMenu = Core::ICore::instance()->actionManager()->createMenu(Constants::RUNMENUCONTEXTMENU); runMenu->setOnAllDisabledBehavior(Core::ActionContainer::Hide); - QIcon runIcon(Constants::ICON_RUN); - runIcon.addFile(Constants::ICON_RUN_SMALL); + QIcon runIcon(QLatin1String(Constants::ICON_RUN)); + runIcon.addFile(QLatin1String(Constants::ICON_RUN_SMALL)); runMenu->menu()->setIcon(runIcon); - runMenu->menu()->setTitle("Run"); + runMenu->menu()->setTitle(tr("Run")); msubProjectContextMenu->addMenu(runMenu, ProjectExplorer::Constants::G_PROJECT_RUN); mfolderContextMenu->appendGroup(Constants::G_FOLDER_FILES); @@ -649,8 +649,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES); // build session action - QIcon buildIcon(Constants::ICON_BUILD); - buildIcon.addFile(Constants::ICON_BUILD_SMALL); + QIcon buildIcon(QLatin1String(Constants::ICON_BUILD)); + buildIcon.addFile(QLatin1String(Constants::ICON_BUILD_SMALL)); d->m_buildSessionAction = new QAction(buildIcon, tr("Build All"), this); cmd = am->registerAction(d->m_buildSessionAction, Constants::BUILDSESSION, globalcontext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B"))); @@ -658,8 +658,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD); // rebuild session action - QIcon rebuildIcon(Constants::ICON_REBUILD); - rebuildIcon.addFile(Constants::ICON_REBUILD_SMALL); + QIcon rebuildIcon(QLatin1String(Constants::ICON_REBUILD)); + rebuildIcon.addFile(QLatin1String(Constants::ICON_REBUILD_SMALL)); d->m_rebuildSessionAction = new QAction(rebuildIcon, tr("Rebuild All"), this); cmd = am->registerAction(d->m_rebuildSessionAction, Constants::REBUILDSESSION, globalcontext); mbuild->addAction(cmd, Constants::G_BUILD_SESSION); @@ -672,8 +672,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD); // clean session - QIcon cleanIcon(Constants::ICON_CLEAN); - cleanIcon.addFile(Constants::ICON_CLEAN_SMALL); + QIcon cleanIcon(QLatin1String(Constants::ICON_CLEAN)); + cleanIcon.addFile(QLatin1String(Constants::ICON_CLEAN_SMALL)); d->m_cleanSessionAction = new QAction(cleanIcon, tr("Clean All"), this); cmd = am->registerAction(d->m_cleanSessionAction, Constants::CLEANSESSION, globalcontext); mbuild->addAction(cmd, Constants::G_BUILD_SESSION); @@ -911,8 +911,10 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er addAutoReleasedObject(new DeployConfigurationFactory); if (QSettings *s = core->settings()) { - const QStringList fileNames = s->value("ProjectExplorer/RecentProjects/FileNames").toStringList(); - const QStringList displayNames = s->value("ProjectExplorer/RecentProjects/DisplayNames").toStringList(); + const QStringList fileNames = + s->value(QLatin1String("ProjectExplorer/RecentProjects/FileNames")).toStringList(); + const QStringList displayNames = + s->value(QLatin1String("ProjectExplorer/RecentProjects/DisplayNames")).toStringList(); if (fileNames.size() == displayNames.size()) { for (int i = 0; i < fileNames.size(); ++i) { if (QFileInfo(fileNames.at(i)).isFile()) @@ -922,19 +924,32 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er } if (QSettings *s = core->settings()) { - d->m_projectExplorerSettings.buildBeforeDeploy = s->value("ProjectExplorer/Settings/BuildBeforeDeploy", true).toBool(); - d->m_projectExplorerSettings.deployBeforeRun = s->value("ProjectExplorer/Settings/DeployBeforeRun", true).toBool(); - d->m_projectExplorerSettings.saveBeforeBuild = s->value("ProjectExplorer/Settings/SaveBeforeBuild", false).toBool(); - d->m_projectExplorerSettings.showCompilerOutput = s->value("ProjectExplorer/Settings/ShowCompilerOutput", false).toBool(); - d->m_projectExplorerSettings.showRunOutput = s->value("ProjectExplorer/Settings/ShowRunOutput", true).toBool(); - d->m_projectExplorerSettings.cleanOldAppOutput = s->value("ProjectExplorer/Settings/CleanOldAppOutput", false).toBool(); - d->m_projectExplorerSettings.mergeStdErrAndStdOut = s->value("ProjectExplorer/Settings/MergeStdErrAndStdOut", false).toBool(); - d->m_projectExplorerSettings.wrapAppOutput = s->value("ProjectExplorer/Settings/WrapAppOutput", true).toBool(); - d->m_projectExplorerSettings.useJom = s->value("ProjectExplorer/Settings/UseJom", true).toBool(); - d->m_projectExplorerSettings.autorestoreLastSession = s->value("ProjectExplorer/Settings/AutoRestoreLastSession", false).toBool(); - d->m_projectExplorerSettings.prompToStopRunControl = s->value("ProjectExplorer/Settings/PromptToStopRunControl", false).toBool(); - d->m_projectExplorerSettings.maxAppOutputLines = s->value("ProjectExplorer/Settings/MaxAppOutputLines", 100000).toInt(); - d->m_projectExplorerSettings.environmentId = QUuid(s->value("ProjectExplorer/Settings/EnvironmentId").toString()); + d->m_projectExplorerSettings.buildBeforeDeploy = + s->value(QLatin1String("ProjectExplorer/Settings/BuildBeforeDeploy"), true).toBool(); + d->m_projectExplorerSettings.deployBeforeRun = + s->value(QLatin1String("ProjectExplorer/Settings/DeployBeforeRun"), true).toBool(); + d->m_projectExplorerSettings.saveBeforeBuild = + s->value(QLatin1String("ProjectExplorer/Settings/SaveBeforeBuild"), false).toBool(); + d->m_projectExplorerSettings.showCompilerOutput = + s->value(QLatin1String("ProjectExplorer/Settings/ShowCompilerOutput"), false).toBool(); + d->m_projectExplorerSettings.showRunOutput = + s->value(QLatin1String("ProjectExplorer/Settings/ShowRunOutput"), true).toBool(); + d->m_projectExplorerSettings.cleanOldAppOutput = + s->value(QLatin1String("ProjectExplorer/Settings/CleanOldAppOutput"), false).toBool(); + d->m_projectExplorerSettings.mergeStdErrAndStdOut = + s->value(QLatin1String("ProjectExplorer/Settings/MergeStdErrAndStdOut"), false).toBool(); + d->m_projectExplorerSettings.wrapAppOutput = + s->value(QLatin1String("ProjectExplorer/Settings/WrapAppOutput"), true).toBool(); + d->m_projectExplorerSettings.useJom = + s->value(QLatin1String("ProjectExplorer/Settings/UseJom"), true).toBool(); + d->m_projectExplorerSettings.autorestoreLastSession = + s->value(QLatin1String("ProjectExplorer/Settings/AutoRestoreLastSession"), false).toBool(); + d->m_projectExplorerSettings.prompToStopRunControl = + s->value(QLatin1String("ProjectExplorer/Settings/PromptToStopRunControl"), false).toBool(); + d->m_projectExplorerSettings.maxAppOutputLines = + s->value(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), 100000).toInt(); + d->m_projectExplorerSettings.environmentId = + QUuid(s->value(QLatin1String("ProjectExplorer/Settings/EnvironmentId")).toString()); if (d->m_projectExplorerSettings.environmentId.isNull()) d->m_projectExplorerSettings.environmentId = QUuid::createUuid(); } @@ -1181,7 +1196,7 @@ void ProjectExplorerPlugin::showSessionManager() updateActions(); Core::ModeManager *modeManager = Core::ModeManager::instance(); - Core::IMode *welcomeMode = modeManager->mode(Core::Constants::MODE_WELCOME); + Core::IMode *welcomeMode = modeManager->mode(QLatin1String(Core::Constants::MODE_WELCOME)); if (modeManager->currentMode() == welcomeMode) updateWelcomePage(); } @@ -1226,8 +1241,8 @@ void ProjectExplorerPlugin::savePersistentSettings() QSettings *s = Core::ICore::instance()->settings(); if (s) { - s->setValue("ProjectExplorer/StartupSession", d->m_session->currentSession()); - s->remove("ProjectExplorer/RecentProjects/Files"); + s->setValue(QLatin1String("ProjectExplorer/StartupSession"), d->m_session->currentSession()); + s->remove(QLatin1String("ProjectExplorer/RecentProjects/Files")); QStringList fileNames; QStringList displayNames; @@ -1238,22 +1253,22 @@ void ProjectExplorerPlugin::savePersistentSettings() displayNames << (*it).second; } - s->setValue("ProjectExplorer/RecentProjects/FileNames", fileNames); - s->setValue("ProjectExplorer/RecentProjects/DisplayNames", displayNames); + s->setValue(QLatin1String("ProjectExplorer/RecentProjects/FileNames"), fileNames); + s->setValue(QLatin1String("ProjectExplorer/RecentProjects/DisplayNames"), displayNames); - s->setValue("ProjectExplorer/Settings/BuildBeforeDeploy", d->m_projectExplorerSettings.buildBeforeDeploy); - s->setValue("ProjectExplorer/Settings/DeployBeforeRun", d->m_projectExplorerSettings.deployBeforeRun); - s->setValue("ProjectExplorer/Settings/SaveBeforeBuild", d->m_projectExplorerSettings.saveBeforeBuild); - s->setValue("ProjectExplorer/Settings/ShowCompilerOutput", d->m_projectExplorerSettings.showCompilerOutput); - s->setValue("ProjectExplorer/Settings/ShowRunOutput", d->m_projectExplorerSettings.showRunOutput); - s->setValue("ProjectExplorer/Settings/CleanOldAppOutput", d->m_projectExplorerSettings.cleanOldAppOutput); - s->setValue("ProjectExplorer/Settings/MergeStdErrAndStdOut", d->m_projectExplorerSettings.mergeStdErrAndStdOut); - s->setValue("ProjectExplorer/Settings/WrapAppOutput", d->m_projectExplorerSettings.wrapAppOutput); - s->setValue("ProjectExplorer/Settings/UseJom", d->m_projectExplorerSettings.useJom); - s->setValue("ProjectExplorer/Settings/AutoRestoreLastSession", d->m_projectExplorerSettings.autorestoreLastSession); - s->setValue("ProjectExplorer/Settings/PromptToStopRunControl", d->m_projectExplorerSettings.prompToStopRunControl); - s->setValue("ProjectExplorer/Settings/MaxAppOutputLines", d->m_projectExplorerSettings.maxAppOutputLines); - s->setValue("ProjectExplorer/Settings/EnvironmentId", d->m_projectExplorerSettings.environmentId.toString()); + s->setValue(QLatin1String("ProjectExplorer/Settings/BuildBeforeDeploy"), d->m_projectExplorerSettings.buildBeforeDeploy); + s->setValue(QLatin1String("ProjectExplorer/Settings/DeployBeforeRun"), d->m_projectExplorerSettings.deployBeforeRun); + s->setValue(QLatin1String("ProjectExplorer/Settings/SaveBeforeBuild"), d->m_projectExplorerSettings.saveBeforeBuild); + s->setValue(QLatin1String("ProjectExplorer/Settings/ShowCompilerOutput"), d->m_projectExplorerSettings.showCompilerOutput); + s->setValue(QLatin1String("ProjectExplorer/Settings/ShowRunOutput"), d->m_projectExplorerSettings.showRunOutput); + s->setValue(QLatin1String("ProjectExplorer/Settings/CleanOldAppOutput"), d->m_projectExplorerSettings.cleanOldAppOutput); + s->setValue(QLatin1String("ProjectExplorer/Settings/MergeStdErrAndStdOut"), d->m_projectExplorerSettings.mergeStdErrAndStdOut); + s->setValue(QLatin1String("ProjectExplorer/Settings/WrapAppOutput"), d->m_projectExplorerSettings.wrapAppOutput); + s->setValue(QLatin1String("ProjectExplorer/Settings/UseJom"), d->m_projectExplorerSettings.useJom); + s->setValue(QLatin1String("ProjectExplorer/Settings/AutoRestoreLastSession"), d->m_projectExplorerSettings.autorestoreLastSession); + s->setValue(QLatin1String("ProjectExplorer/Settings/PromptToStopRunControl"), d->m_projectExplorerSettings.prompToStopRunControl); + s->setValue(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), d->m_projectExplorerSettings.maxAppOutputLines); + s->setValue(QLatin1String("ProjectExplorer/Settings/EnvironmentId"), d->m_projectExplorerSettings.environmentId.toString()); } } @@ -1312,7 +1327,7 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName } if (errorString) { if (!errorString->isEmpty() && !tmp.isEmpty()) - errorString->append('\n'); + errorString->append(QLatin1Char('\n')); errorString->append(tmp); } d->m_session->reportProjectLoadingProgress(); @@ -1324,7 +1339,7 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName updateActions(); if (!openedPro.isEmpty()) - Core::ModeManager::instance()->activateMode(Core::Constants::MODE_EDIT); + Core::ModeManager::instance()->activateMode(QLatin1String(Core::Constants::MODE_EDIT)); return openedPro; } @@ -1395,7 +1410,7 @@ void ProjectExplorerPlugin::currentModeChanged(Core::IMode *mode, Core::IMode *o void ProjectExplorerPlugin::determineSessionToRestoreAtStartup() { // Process command line arguments first: - if (pluginSpec()->arguments().contains("-lastsession")) + if (pluginSpec()->arguments().contains(QLatin1String("-lastsession"))) d->m_sessionToRestoreAtStartup = d->m_session->lastSession(); QStringList arguments = ExtensionSystem::PluginManager::instance()->arguments(); if (d->m_sessionToRestoreAtStartup.isNull()) { @@ -1416,7 +1431,7 @@ void ProjectExplorerPlugin::determineSessionToRestoreAtStartup() d->m_sessionToRestoreAtStartup = d->m_session->lastSession(); if (!d->m_sessionToRestoreAtStartup.isNull()) - Core::ModeManager::instance()->activateMode(Core::Constants::MODE_EDIT); + Core::ModeManager::instance()->activateMode(QLatin1String(Core::Constants::MODE_EDIT)); } /*! @@ -1548,7 +1563,7 @@ void ProjectExplorerPlugin::executeRunConfiguration(RunConfiguration *runConfigu void ProjectExplorerPlugin::startRunControl(RunControl *runControl, const QString &runMode) { d->m_outputPane->createNewOutputWindow(runControl); - if (runMode == ProjectExplorer::Constants::RUNMODE && d->m_projectExplorerSettings.showRunOutput) + if (runMode == QLatin1String(ProjectExplorer::Constants::RUNMODE) && d->m_projectExplorerSettings.showRunOutput) d->m_outputPane->popup(false); d->m_outputPane->showTabFor(runControl); connect(runControl, SIGNAL(finished()), this, SLOT(runControlFinished())); @@ -1592,7 +1607,7 @@ void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node { if (debug) qDebug() << "ProjectExplorer - setting path to " << (node ? node->path() : filePath) - << " and project to " << (project ? project->displayName() : "0"); + << " and project to " << (project ? project->displayName() : QLatin1String("0")); if (node) filePath = node->path(); @@ -1625,13 +1640,13 @@ void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node if (projectChanged || d->m_currentNode != node) { d->m_currentNode = node; if (debug) - qDebug() << "ProjectExplorer - currentNodeChanged(" << (node ? node->path() : "0") << ", " << (project ? project->displayName() : "0") << ")"; + qDebug() << "ProjectExplorer - currentNodeChanged(" << (node ? node->path() : QLatin1String("0")) << ", " << (project ? project->displayName() : QLatin1String("0")) << ')'; emit currentNodeChanged(d->m_currentNode, project); updateContextMenuActions(); } if (projectChanged) { if (debug) - qDebug() << "ProjectExplorer - currentProjectChanged(" << (project ? project->displayName() : "0") << ")"; + qDebug() << "ProjectExplorer - currentProjectChanged(" << (project ? project->displayName() : QLatin1String("0")) << ')'; emit currentProjectChanged(project); updateActions(); } @@ -1765,18 +1780,18 @@ void ProjectExplorerPlugin::deploy(QList<Project *> projects) { QStringList steps; if (d->m_projectExplorerSettings.buildBeforeDeploy) - steps << Constants::BUILDSTEPS_BUILD; - steps << Constants::BUILDSTEPS_DEPLOY; + steps << QLatin1String(Constants::BUILDSTEPS_BUILD); + steps << QLatin1String(Constants::BUILDSTEPS_DEPLOY); queue(projects, steps); } QString ProjectExplorerPlugin::displayNameForStepId(const QString &stepId) { - if (stepId == Constants::BUILDSTEPS_CLEAN) + if (stepId == QLatin1String(Constants::BUILDSTEPS_CLEAN)) return tr("Clean"); - else if (stepId == Constants::BUILDSTEPS_BUILD) + else if (stepId == QLatin1String(Constants::BUILDSTEPS_BUILD)) return tr("Build"); - else if (stepId == Constants::BUILDSTEPS_DEPLOY) + else if (stepId == QLatin1String(Constants::BUILDSTEPS_DEPLOY)) return tr("Deploy"); return tr("Build"); } @@ -1823,55 +1838,55 @@ int ProjectExplorerPlugin::queue(QList<Project *> projects, QStringList stepIds) void ProjectExplorerPlugin::buildProjectOnly() { - queue(QList<Project *>() << session()->startupProject(), QStringList() << Constants::BUILDSTEPS_BUILD); + queue(QList<Project *>() << session()->startupProject(), QStringList(QLatin1String(Constants::BUILDSTEPS_BUILD))); } void ProjectExplorerPlugin::buildProject(ProjectExplorer::Project *p) { queue(d->m_session->projectOrder(p), - QStringList() << Constants::BUILDSTEPS_BUILD); + QStringList(QLatin1String(Constants::BUILDSTEPS_BUILD))); } void ProjectExplorerPlugin::buildProject() { queue(d->m_session->projectOrder(session()->startupProject()), - QStringList() << Constants::BUILDSTEPS_BUILD); + QStringList(QLatin1String(Constants::BUILDSTEPS_BUILD))); } void ProjectExplorerPlugin::buildProjectContextMenu() { queue(QList<Project *>() << d->m_currentProject, - QStringList() << Constants::BUILDSTEPS_BUILD); + QStringList(QLatin1String(Constants::BUILDSTEPS_BUILD))); } void ProjectExplorerPlugin::buildSession() { queue(d->m_session->projectOrder(), - QStringList() << Constants::BUILDSTEPS_BUILD); + QStringList(QLatin1String(Constants::BUILDSTEPS_BUILD))); } void ProjectExplorerPlugin::rebuildProjectOnly() { queue(QList<Project *>() << session()->startupProject(), - QStringList() << Constants::BUILDSTEPS_CLEAN << Constants::BUILDSTEPS_BUILD); + QStringList() << QLatin1String(Constants::BUILDSTEPS_CLEAN) << QLatin1String(Constants::BUILDSTEPS_BUILD)); } void ProjectExplorerPlugin::rebuildProject() { queue(d->m_session->projectOrder(session()->startupProject()), - QStringList() << Constants::BUILDSTEPS_CLEAN << Constants::BUILDSTEPS_BUILD); + QStringList() << QLatin1String(Constants::BUILDSTEPS_CLEAN) << QLatin1String(Constants::BUILDSTEPS_BUILD)); } void ProjectExplorerPlugin::rebuildProjectContextMenu() { queue(QList<Project *>() << d->m_currentProject, - QStringList() << Constants::BUILDSTEPS_CLEAN << Constants::BUILDSTEPS_BUILD); + QStringList() << QLatin1String(Constants::BUILDSTEPS_CLEAN) << QLatin1String(Constants::BUILDSTEPS_BUILD)); } void ProjectExplorerPlugin::rebuildSession() { queue(d->m_session->projectOrder(), - QStringList() << Constants::BUILDSTEPS_CLEAN << Constants::BUILDSTEPS_BUILD); + QStringList() << QLatin1String(Constants::BUILDSTEPS_CLEAN) << QLatin1String(Constants::BUILDSTEPS_BUILD)); } void ProjectExplorerPlugin::deployProjectOnly() @@ -1897,42 +1912,42 @@ void ProjectExplorerPlugin::deploySession() void ProjectExplorerPlugin::cleanProjectOnly() { queue(QList<Project *>() << session()->startupProject(), - QStringList() << Constants::BUILDSTEPS_CLEAN); + QStringList(QLatin1String(Constants::BUILDSTEPS_CLEAN))); } void ProjectExplorerPlugin::cleanProject() { queue(d->m_session->projectOrder(session()->startupProject()), - QStringList() << Constants::BUILDSTEPS_CLEAN); + QStringList(QLatin1String(Constants::BUILDSTEPS_CLEAN))); } void ProjectExplorerPlugin::cleanProjectContextMenu() { queue(QList<Project *>() << d->m_currentProject, - QStringList() << Constants::BUILDSTEPS_CLEAN); + QStringList(QLatin1String(Constants::BUILDSTEPS_CLEAN))); } void ProjectExplorerPlugin::cleanSession() { queue(d->m_session->projectOrder(), - QStringList() << Constants::BUILDSTEPS_CLEAN); + QStringList(QLatin1String(Constants::BUILDSTEPS_CLEAN))); } void ProjectExplorerPlugin::runProject() { - runProject(startupProject(), ProjectExplorer::Constants::RUNMODE); + runProject(startupProject(), QLatin1String(ProjectExplorer::Constants::RUNMODE)); } void ProjectExplorerPlugin::runProjectWithoutDeploy() { - runProject(startupProject(), ProjectExplorer::Constants::RUNMODE, true); + runProject(startupProject(), QLatin1String(ProjectExplorer::Constants::RUNMODE), true); } void ProjectExplorerPlugin::runProjectContextMenu() { ProjectNode *projectNode = qobject_cast<ProjectNode*>(d->m_currentNode); if (projectNode == d->m_currentProject->rootProjectNode() || !projectNode) { - runProject(d->m_currentProject, ProjectExplorer::Constants::RUNMODE); + runProject(d->m_currentProject, QLatin1String(ProjectExplorer::Constants::RUNMODE)); } else { QAction *act = qobject_cast<QAction *>(sender()); if (!act) @@ -1940,7 +1955,7 @@ void ProjectExplorerPlugin::runProjectContextMenu() RunConfiguration *rc = act->data().value<RunConfiguration *>(); if (!rc) return; - runRunConfiguration(rc, ProjectExplorer::Constants::RUNMODE); + runRunConfiguration(rc, QLatin1String(ProjectExplorer::Constants::RUNMODE)); } } @@ -2062,8 +2077,8 @@ void ProjectExplorerPlugin::runRunConfiguration(ProjectExplorer::RunConfiguratio QStringList stepIds; if (!forceSkipDeploy && d->m_projectExplorerSettings.deployBeforeRun) { if (d->m_projectExplorerSettings.buildBeforeDeploy) - stepIds << Constants::BUILDSTEPS_BUILD; - stepIds << Constants::BUILDSTEPS_DEPLOY; + stepIds << QLatin1String(Constants::BUILDSTEPS_BUILD); + stepIds << QLatin1String(Constants::BUILDSTEPS_DEPLOY); } Project *pro = rc->target()->project(); @@ -2302,9 +2317,10 @@ QString ProjectExplorerPlugin::cannotRunReason(Project *project, const QString & void ProjectExplorerPlugin::slotUpdateRunActions() { Project *project = startupProject(); - const bool state = canRun(project, ProjectExplorer::Constants::RUNMODE); + const QString runMode = QLatin1String(ProjectExplorer::Constants::RUNMODE); + const bool state = canRun(project, runMode); d->m_runAction->setEnabled(state); - d->m_runAction->setToolTip(cannotRunReason(project, ProjectExplorer::Constants::RUNMODE)); + d->m_runAction->setToolTip(cannotRunReason(project, runMode)); d->m_runWithoutDeployAction->setEnabled(state); } @@ -2449,7 +2465,7 @@ void ProjectExplorerPlugin::updateContextMenuActions() foreach (RunConfiguration *rc, runConfigs) { QAction *act = new QAction(runMenu->menu()); act->setData(QVariant::fromValue(rc)); - act->setText(QString("Run %1").arg(rc->displayName())); + act->setText(tr("Run %1").arg(rc->displayName())); runMenu->menu()->addAction(act); connect(act, SIGNAL(triggered()), this, SLOT(runProjectContextMenu())); @@ -2487,11 +2503,12 @@ QString pathOrDirectoryFor(Node *node, bool dir) QString path = node->path(); QString location; FolderNode *folder = qobject_cast<FolderNode *>(node); - if (path.contains("#") && folder) { + const int hashPos = path.indexOf(QLatin1Char('#')); + if (hashPos >= 0 && folder) { // Virtual Folder case // If there are files directly below or no subfolders, take the folder path if (!folder->fileNodes().isEmpty() || folder->subFolderNodes().isEmpty()) { - location = path.left(path.indexOf('#'));; + location = path.left(hashPos); } else { // Otherwise we figure out a commonPath from the subfolders QStringList list; @@ -2579,7 +2596,7 @@ void ProjectExplorerPlugin::addExistingFiles(ProjectNode *projectNode, const QSt } if (!notAdded.isEmpty()) { QString message = tr("Could not add following files to project %1:\n").arg(projectNode->displayName()); - QString files = notAdded.join("\n"); + QString files = notAdded.join(QString(QLatin1Char('\n'))); QMessageBox::warning(core->mainWindow(), tr("Adding Files to Project Failed"), message + files); foreach (const QString &file, notAdded) diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.cpp b/src/plugins/projectexplorer/projectexplorersettingspage.cpp index 55d979a12f..efb457f398 100644 --- a/src/plugins/projectexplorer/projectexplorersettingspage.cpp +++ b/src/plugins/projectexplorer/projectexplorersettingspage.cpp @@ -176,7 +176,7 @@ QString ProjectExplorerSettingsPage::displayCategory() const QIcon ProjectExplorerSettingsPage::categoryIcon() const { - return QIcon(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON); + return QIcon(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON)); } QWidget *ProjectExplorerSettingsPage::createPage(QWidget *parent) diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 7f5e826ddf..59cbaa63e7 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -174,7 +174,7 @@ void ProjectTreeWidget::disableAutoExpand() void ProjectTreeWidget::loadExpandData() { m_autoExpand = true; - QStringList data = m_explorer->session()->value("ProjectTree.ExpandData").toStringList(); + QStringList data = m_explorer->session()->value(QLatin1String("ProjectTree.ExpandData")).toStringList(); recursiveLoadExpandData(m_view->rootIndex(), data.toSet()); } @@ -193,7 +193,7 @@ void ProjectTreeWidget::saveExpandData() QStringList data; recursiveSaveExpandData(m_view->rootIndex(), &data); // TODO if there are multiple ProjectTreeWidgets, the last one saves the data - m_explorer->session()->setValue("ProjectTree.ExpandData", data); + m_explorer->session()->setValue(QLatin1String("ProjectTree.ExpandData"), data); } void ProjectTreeWidget::recursiveSaveExpandData(const QModelIndex &index, QStringList *data) @@ -284,8 +284,8 @@ void ProjectTreeWidget::editCurrentItem() void ProjectTreeWidget::setCurrentItem(Node *node, Project *project) { if (debug) - qDebug() << "ProjectTreeWidget::setCurrentItem(" << (project ? project->displayName() : "0") - << ", " << (node ? node->path() : "0") << ")"; + qDebug() << "ProjectTreeWidget::setCurrentItem(" << (project ? project->displayName() : QLatin1String("0")) + << ", " << (node ? node->path() : QLatin1String("0")) << ")"; if (!project) { return; @@ -441,9 +441,10 @@ void ProjectTreeWidgetFactory::saveSettings(int position, QWidget *widget) ProjectTreeWidget *ptw = qobject_cast<ProjectTreeWidget *>(widget); Q_ASSERT(ptw); QSettings *settings = Core::ICore::instance()->settings(); - settings->setValue("ProjectTreeWidget."+QString::number(position)+".ProjectFilter", ptw->projectFilter()); - settings->setValue("ProjectTreeWidget."+QString::number(position)+".GeneratedFilter", ptw->generatedFilesFilter()); - settings->setValue("ProjectTreeWidget."+QString::number(position)+".SyncWithEditor", ptw->autoSynchronization()); + const QString baseKey = QLatin1String("ProjectTreeWidget.") + QString::number(position); + settings->setValue(baseKey + QLatin1String(".ProjectFilter"), ptw->projectFilter()); + settings->setValue(baseKey + QLatin1String(".GeneratedFilter"), ptw->generatedFilesFilter()); + settings->setValue(baseKey + QLatin1String(".SyncWithEditor"), ptw->autoSynchronization()); } void ProjectTreeWidgetFactory::restoreSettings(int position, QWidget *widget) @@ -451,7 +452,8 @@ void ProjectTreeWidgetFactory::restoreSettings(int position, QWidget *widget) ProjectTreeWidget *ptw = qobject_cast<ProjectTreeWidget *>(widget); Q_ASSERT(ptw); QSettings *settings = Core::ICore::instance()->settings(); - ptw->setProjectFilter(settings->value("ProjectTreeWidget."+QString::number(position)+".ProjectFilter", false).toBool()); - ptw->setGeneratedFilesFilter(settings->value("ProjectTreeWidget."+QString::number(position)+".GeneratedFilter", true).toBool()); - ptw->setAutoSynchronization(settings->value("ProjectTreeWidget."+QString::number(position)+".SyncWithEditor", true).toBool()); + const QString baseKey = QLatin1String("ProjectTreeWidget.") + QString::number(position); + ptw->setProjectFilter(settings->value(baseKey + QLatin1String(".ProjectFilter"), false).toBool()); + ptw->setGeneratedFilesFilter(settings->value(baseKey + QLatin1String(".GeneratedFilter"), true).toBool()); + ptw->setAutoSynchronization(settings->value(baseKey + QLatin1String(".SyncWithEditor"), true).toBool()); } diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp index ded8524f1d..c25df00963 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.cpp +++ b/src/plugins/projectexplorer/projectwelcomepage.cpp @@ -141,9 +141,9 @@ void ProjectWelcomePage::facilitateQml(QDeclarativeEngine *engine) m_projectModel = new ProjectModel(pePlugin, this); QDeclarativeContext *ctx = engine->rootContext(); - ctx->setContextProperty("sessionList", m_sessionModel); - ctx->setContextProperty("projectList", m_projectModel); - ctx->setContextProperty("projectWelcomePage", this); + ctx->setContextProperty(QLatin1String("sessionList"), m_sessionModel); + ctx->setContextProperty(QLatin1String("projectList"), m_projectModel); + ctx->setContextProperty(QLatin1String("projectWelcomePage"), this); } void ProjectWelcomePage::reloadWelcomeScreenData() diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index f2070bdd98..bac7381fb8 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -172,6 +172,6 @@ void ProjectWizardPage::slotProjectChanged(int index) void ProjectWizardPage::slotManageVcs() { Core::ICore *core = Core::ICore::instance(); - core->showOptionsDialog(VcsBase::Constants::VCS_SETTINGS_CATEGORY, - VcsBase::Constants::VCS_COMMON_SETTINGS_ID); + core->showOptionsDialog(QLatin1String(VcsBase::Constants::VCS_SETTINGS_CATEGORY), + QLatin1String(VcsBase::Constants::VCS_COMMON_SETTINGS_ID)); } diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 4e3b7f210e..6d4982926b 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -154,7 +154,7 @@ bool SessionFile::load(const QString &fileName) const QStringList &keys = reader.restoreValue(QLatin1String("valueKeys")).toStringList(); foreach (const QString &key, keys) { - QVariant value = reader.restoreValue("value-" + key); + QVariant value = reader.restoreValue(QLatin1String("value-") + key); m_values.insert(key, value); } @@ -276,14 +276,14 @@ bool SessionFile::save() end = m_values.constEnd(); QStringList keys; for (it = m_values.constBegin(); it != end; ++it) { - writer.saveValue("value-" + it.key(), it.value()); + writer.saveValue(QLatin1String("value-") + it.key(), it.value()); keys << it.key(); } - writer.saveValue("valueKeys", keys); + writer.saveValue(QLatin1String("valueKeys"), keys); - if (writer.save(m_fileName, "QtCreatorSession", Core::ICore::instance()->mainWindow())) + if (writer.save(m_fileName, QLatin1String("QtCreatorSession"), Core::ICore::instance()->mainWindow())) return true; return false; @@ -472,7 +472,7 @@ void SessionManager::removeDependency(Project *project, Project *depProject) void SessionManager::setStartupProject(Project *startupProject) { if (debug) - qDebug() << Q_FUNC_INFO << (startupProject ? startupProject->displayName() : "0"); + qDebug() << Q_FUNC_INFO << (startupProject ? startupProject->displayName() : QLatin1String("0")); if (startupProject) { Q_ASSERT(m_file->m_projects.contains(startupProject)); @@ -561,7 +561,7 @@ bool SessionManager::createImpl(const QString &fileName) setStartupProject(0); if (!isDefaultVirgin()) { - ModeManager::instance()->activateMode(Core::Constants::MODE_EDIT); + ModeManager::instance()->activateMode(QLatin1String(Core::Constants::MODE_EDIT)); ModeManager::instance()->setFocusToCurrentMode(); } @@ -635,7 +635,7 @@ bool SessionManager::loadImpl(const QString &fileName) // restore the active mode QString modeIdentifier = value(QLatin1String("ActiveMode")).toString(); if (modeIdentifier.isEmpty()) - modeIdentifier = Core::Constants::MODE_EDIT; + modeIdentifier = QLatin1String(Core::Constants::MODE_EDIT); ModeManager::instance()->activateMode(modeIdentifier); ModeManager::instance()->setFocusToCurrentMode(); @@ -860,7 +860,7 @@ void SessionManager::updateWindowTitle() if (Project *currentProject = ProjectExplorerPlugin::instance()->currentProject()) m_core->editorManager()->setWindowTitleAddition(currentProject->displayName()); else - m_core->editorManager()->setWindowTitleAddition(""); + m_core->editorManager()->setWindowTitleAddition(QString()); } else { QString sessionName = m_sessionName; if (sessionName.isEmpty()) @@ -969,23 +969,23 @@ QStringList SessionManager::sessions() const QDir sessionDir(Core::ICore::instance()->userResourcePath()); QList<QFileInfo> sessionFiles = sessionDir.entryInfoList(QStringList() << QLatin1String("*.qws"), QDir::NoFilter, QDir::Time); Q_FOREACH(const QFileInfo& fileInfo, sessionFiles) { - if (fileInfo.completeBaseName() != "default") + if (fileInfo.completeBaseName() != QLatin1String("default")) m_sessions << fileInfo.completeBaseName(); } - m_sessions.prepend("default"); + m_sessions.prepend(QLatin1String("default")); } return m_sessions; } QString SessionManager::sessionNameToFileName(const QString &session) const { - return m_core->userResourcePath() + '/' + session + ".qws"; + return m_core->userResourcePath() + QLatin1Char('/') + session + QLatin1String(".qws"); } QString SessionManager::sessionNameFromFileName(const QString &fileName) const { - const int slash = fileName.lastIndexOf('/'); - Q_ASSERT(slash != -1 && fileName.endsWith(".qws")); + const int slash = fileName.lastIndexOf(QLatin1Char('/')); + Q_ASSERT(slash != -1 && fileName.endsWith(QLatin1String(".qws"))); return fileName.mid(slash + 1, fileName.length() - slash - 5); // Exclude .qws } @@ -995,7 +995,7 @@ QString SessionManager::sessionNameFromFileName(const QString &fileName) const void SessionManager::createAndLoadNewDefaultSession() { - createImpl(sessionNameToFileName("default")); + createImpl(sessionNameToFileName(QLatin1String("default"))); } /*! @@ -1076,7 +1076,7 @@ bool SessionManager::loadSession(const QString &session) QString SessionManager::lastSession() const { QSettings *settings = m_core->settings(); - QString fileName = settings->value("ProjectExplorer/StartupSession").toString(); + QString fileName = settings->value(QLatin1String("ProjectExplorer/StartupSession")).toString(); return QFileInfo(fileName).completeBaseName(); } diff --git a/src/plugins/projectexplorer/sessiondialog.cpp b/src/plugins/projectexplorer/sessiondialog.cpp index 0c593463e4..33731fd1b0 100644 --- a/src/plugins/projectexplorer/sessiondialog.cpp +++ b/src/plugins/projectexplorer/sessiondialog.cpp @@ -61,11 +61,11 @@ QValidator::State SessionValidator::validate(QString &input, int &pos) const { Q_UNUSED(pos) - if (input.contains('/') - || input.contains(':') - || input.contains('\\') - || input.contains('?') - || input.contains('*')) + if (input.contains(QLatin1Char('/')) + || input.contains(QLatin1Char(':')) + || input.contains(QLatin1Char('\\')) + || input.contains(QLatin1Char('?')) + || input.contains(QLatin1Char('*'))) return QValidator::Invalid; if (m_sessions.contains(input)) @@ -79,7 +79,7 @@ void SessionValidator::fixup(QString &input) const int i = 2; QString copy; do { - copy = input + QString(" (%1)").arg(i); + copy = input + QLatin1String(" (") + QString::number(i) + QLatin1Char(')'); ++i; } while (m_sessions.contains(copy)); input = copy; diff --git a/src/plugins/projectexplorer/settingsaccessor.cpp b/src/plugins/projectexplorer/settingsaccessor.cpp index 2050c98dc2..8034ccbc57 100644 --- a/src/plugins/projectexplorer/settingsaccessor.cpp +++ b/src/plugins/projectexplorer/settingsaccessor.cpp @@ -478,7 +478,7 @@ void mergeSharedSettings(QVariantMap *userMap, const QVariantMap &sharedMap) return; QSet<QString> stickyKeys; - const QVariant &stickyList = userMap->take(USER_STICKY_KEYS_KEY).toList(); + const QVariant stickyList = userMap->take(QLatin1String(USER_STICKY_KEYS_KEY)).toList(); if (stickyList.isValid()) { if (stickyList.type() != QVariant::List) { // File is messed up... The user probably changed something. @@ -518,7 +518,7 @@ void trackUserStickySettings(QVariantMap *userMap, const QVariantMap &sharedMap) TrackUserStickySetting op; synchronizeSettings(userMap, sharedMap, &op); - userMap->insert(USER_STICKY_KEYS_KEY, QVariant(op.m_userSticky.toList())); + userMap->insert(QLatin1String(USER_STICKY_KEYS_KEY), QVariant(op.m_userSticky.toList())); } } // Anonymous @@ -577,7 +577,7 @@ QVariantMap SettingsAccessor::restoreSettings(Project *project) const // Do we need to generate a backup? if (settings.m_version < m_lastVersion + 1 && !settings.m_usingBackup) { const QString &backupFileName = settings.m_fileName - + '.' + + QLatin1Char('.') + m_handlers.value(settings.m_version)->displayUserFileVersion(); QFile::remove(backupFileName); // Remove because copy doesn't overwrite QFile::copy(settings.m_fileName, backupFileName); @@ -748,7 +748,7 @@ void SettingsAccessor::FileAccessor::assignSuffix(const QString &defaultSuffix, { if (!environmentSuffix.isEmpty()) { m_suffix = environmentSuffix; - m_suffix.replace(QRegExp("[^a-zA-Z0-9_.-]"), QChar('_')); // replace fishy characters: + m_suffix.replace(QRegExp(QLatin1String("[^a-zA-Z0-9_.-]")), QString(QLatin1Char('_'))); // replace fishy characters: m_suffix.prepend(QLatin1Char('.')); } else { m_suffix = defaultSuffix; @@ -874,7 +874,7 @@ bool SettingsAccessor::FileAccessor::writeFile(const Project *project, const QString &fileName = project->property(m_id).toString(); return writer.save(fileName.isEmpty() ? assembleFileName(project) : fileName, - "QtCreatorProject", + QLatin1String("QtCreatorProject"), Core::ICore::instance()->mainWindow()); } @@ -1275,7 +1275,7 @@ QVariantMap Version0Handler::update(Project *project, const QVariantMap &map) active = map.value(QLatin1String("activeRunConfiguration")).toString(); count = 0; forever { - QString prefix(QLatin1String("RunConfiguration") + QString::number(count) + '-'); + QString prefix(QLatin1String("RunConfiguration") + QString::number(count) + QLatin1Char('-')); QVariantMap rcMap; for (QVariantMap::const_iterator i = map.constBegin(); i != map.constEnd(); ++i) { if (!i.key().startsWith(prefix)) @@ -1303,7 +1303,7 @@ QVariantMap Version0Handler::update(Project *project, const QVariantMap &map) editorSettingsMap); } - QVariant toolchain(map.value("toolChain")); + QVariant toolchain(map.value(QLatin1String("toolChain"))); if (toolchain.isValid()) { bool ok; int type(toolchain.toInt(&ok)); diff --git a/src/plugins/projectexplorer/taskmodel.cpp b/src/plugins/projectexplorer/taskmodel.cpp index 1c09bd7356..0bc4a6d5b2 100644 --- a/src/plugins/projectexplorer/taskmodel.cpp +++ b/src/plugins/projectexplorer/taskmodel.cpp @@ -284,7 +284,7 @@ int TaskModel::sizeOfLineNumber(const QFont &font) if (m_sizeOfLineNumber == 0 || font != m_lineMeasurementFont) { QFontMetrics fm(font); m_lineMeasurementFont = font; - m_sizeOfLineNumber = fm.width("88888"); + m_sizeOfLineNumber = fm.width(QLatin1String("88888")); } return m_sizeOfLineNumber; } diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 2c706f1781..625dd46627 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -635,7 +635,7 @@ QSize TaskDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd // Layout the description int leading = fontLeading; int height = 0; - description.replace('\n', QChar::LineSeparator); + description.replace(QLatin1Char('\n'), QChar::LineSeparator); QTextLayout tl(description); tl.beginLayout(); while (true) { @@ -717,7 +717,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, // Paint TextArea: if (!selected) { // in small mode we lay out differently - QString bottom = index.data(TaskModel::Description).toString().split('\n').first(); + QString bottom = index.data(TaskModel::Description).toString().split(QLatin1Char('\n')).first(); painter->setClipRect(positions.textArea()); painter->drawText(positions.textAreaLeft(), positions.top() + fm.ascent(), bottom); if (fm.width(bottom) > positions.textAreaWidth()) { @@ -734,7 +734,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, // Layout the description int leading = fm.leading(); int height = 0; - description.replace('\n', QChar::LineSeparator); + description.replace(QLatin1Char('\n'), QChar::LineSeparator); QTextLayout tl(description); tl.setAdditionalFormats(index.data(TaskModel::Task_t).value<ProjectExplorer::Task>().formats); tl.beginLayout(); diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp index 3cf9b1f684..b5c0cde134 100644 --- a/src/plugins/projectexplorer/toolchainmanager.cpp +++ b/src/plugins/projectexplorer/toolchainmanager.cpp @@ -155,7 +155,7 @@ void ToolChainManager::saveToolChains() } } writer.saveValue(QLatin1String(TOOLCHAIN_COUNT_KEY), count); - writer.save(settingsFileName(), "QtCreatorToolChains", Core::ICore::instance()->mainWindow()); + writer.save(settingsFileName(), QLatin1String("QtCreatorToolChains"), Core::ICore::instance()->mainWindow()); // Do not save default debuggers! Those are set by the SDK! } diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index d872972899..367860f5fb 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -496,7 +496,7 @@ QString ToolChainOptionsPage::displayCategory() const QIcon ToolChainOptionsPage::categoryIcon() const { - return QIcon(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON); + return QIcon(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON)); } QWidget *ToolChainOptionsPage::createPage(QWidget *parent) diff --git a/src/plugins/projectexplorer/vcsannotatetaskhandler.cpp b/src/plugins/projectexplorer/vcsannotatetaskhandler.cpp index ebe86302e4..7a8c1780b9 100644 --- a/src/plugins/projectexplorer/vcsannotatetaskhandler.cpp +++ b/src/plugins/projectexplorer/vcsannotatetaskhandler.cpp @@ -72,6 +72,6 @@ void VcsAnnotateTaskHandler::handle(const ProjectExplorer::Task &task) QAction *VcsAnnotateTaskHandler::createAction(QObject *parent) { QAction *vcsannotateAction = new QAction(tr("&Annotate"), parent); - vcsannotateAction->setToolTip("Annotate using version control system"); + vcsannotateAction->setToolTip(tr("Annotate using version control system")); return vcsannotateAction; } |