Commit ced6fc41 authored by Friedemann Kleint's avatar Friedemann Kleint

ProjectExplorer: Compile with QT_NO_CAST_FROM_ASCII.

- Add missing translations
- Remove some unneeded conversions.

Change-Id: Ia30e5c838099e52a9f38ca4854395c10c0391075
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent ed2f41bb
......@@ -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())
......
......@@ -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";
......
......@@ -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);
......
......@@ -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()),
......
......@@ -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));
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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();
}
......
......@@ -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;
}
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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
......@@ -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());
......
......@@ -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;
}
......
......@@ -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);
}
......@@ -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;
}
......
......@@ -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
......
This diff is collapsed.
......@@ -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
......
......@@ -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);
}
......
......@@ -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,