diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2019-11-04 14:23:21 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2019-11-04 12:28:12 +0000 |
commit | 5b2feffb392d66f4f3e86e0bdb74b301d2c8b448 (patch) | |
tree | a8dc579d3b3f43ab6b2ca38e33c0d0365ef8f081 | |
parent | 4828aa724414295ea59ef0a319ec634324c633c5 (diff) | |
download | qt-creator-5b2feffb392d66f4f3e86e0bdb74b301d2c8b448.tar.gz |
BareMetal: Remove QLatin1Char and QLatin1String macros
... where it is possible, because it is unnecessary to use
in QtC code. Besides, it simplifies a code bit.
Change-Id: I8f547c952f3e2bfe046462957f175da7fc780171
Reviewed-by: hjk <hjk@qt.io>
10 files changed, 226 insertions, 229 deletions
diff --git a/src/plugins/baremetal/baremetaldevice.cpp b/src/plugins/baremetal/baremetaldevice.cpp index 846c6519f0..e8fab2ea6b 100644 --- a/src/plugins/baremetal/baremetaldevice.cpp +++ b/src/plugins/baremetal/baremetaldevice.cpp @@ -112,7 +112,7 @@ void BareMetalDevice::setChannelByServerProvider(IDebugServerProvider *provider) const auto gdbProvider = static_cast<GdbServerProvider *>(provider); const QString channel = gdbProvider->channelString(); - const int colon = channel.indexOf(QLatin1Char(':')); + const int colon = channel.indexOf(':'); if (colon < 0) return; QSsh::SshConnectionParameters sshParams = sshParameters(); @@ -124,7 +124,7 @@ void BareMetalDevice::setChannelByServerProvider(IDebugServerProvider *provider) void BareMetalDevice::fromMap(const QVariantMap &map) { IDevice::fromMap(map); - QString providerId = map.value(QLatin1String(debugServerProviderIdKeyC)).toString(); + QString providerId = map.value(debugServerProviderIdKeyC).toString(); if (providerId.isEmpty()) { const QString name = displayName(); if (IDebugServerProvider *provider = @@ -147,7 +147,7 @@ void BareMetalDevice::fromMap(const QVariantMap &map) QVariantMap BareMetalDevice::toMap() const { QVariantMap map = IDevice::toMap(); - map.insert(QLatin1String(debugServerProviderIdKeyC), debugServerProviderId()); + map.insert(debugServerProviderIdKeyC, debugServerProviderId()); return map; } diff --git a/src/plugins/baremetal/debugserverprovidermanager.cpp b/src/plugins/baremetal/debugserverprovidermanager.cpp index 19b0704e1c..e3d132ad64 100644 --- a/src/plugins/baremetal/debugserverprovidermanager.cpp +++ b/src/plugins/baremetal/debugserverprovidermanager.cpp @@ -61,7 +61,7 @@ DebugServerProviderManager::DebugServerProviderManager() { m_instance = this; m_writer = new Utils::PersistentSettingsWriter( - m_configFile, QLatin1String("QtCreatorDebugServerProviders")); + m_configFile, "QtCreatorDebugServerProviders"); connect(Core::ICore::instance(), &Core::ICore::saveSettingsRequested, this, &DebugServerProviderManager::saveProviders); @@ -95,11 +95,11 @@ void DebugServerProviderManager::restoreProviders() return; const QVariantMap data = reader.restoreValues(); - const int version = data.value(QLatin1String(fileVersionKeyC), 0).toInt(); + const int version = data.value(fileVersionKeyC, 0).toInt(); if (version < 1) return; - const int count = data.value(QLatin1String(countKeyC), 0).toInt(); + const int count = data.value(countKeyC, 0).toInt(); for (int i = 0; i < count; ++i) { const QString key = QString::fromLatin1(dataKeyC) + QString::number(i); if (!data.contains(key)) @@ -128,7 +128,7 @@ void DebugServerProviderManager::restoreProviders() void DebugServerProviderManager::saveProviders() { QVariantMap data; - data.insert(QLatin1String(fileVersionKeyC), 1); + data.insert(fileVersionKeyC, 1); int count = 0; for (const IDebugServerProvider *p : qAsConst(m_providers)) { @@ -141,7 +141,7 @@ void DebugServerProviderManager::saveProviders() ++count; } } - data.insert(QLatin1String(countKeyC), count); + data.insert(countKeyC, count); m_writer->save(data, Core::ICore::mainWindow()); } diff --git a/src/plugins/baremetal/debugserverproviderssettingspage.cpp b/src/plugins/baremetal/debugserverproviderssettingspage.cpp index a1d2980f8c..6f05bfa6b8 100644 --- a/src/plugins/baremetal/debugserverproviderssettingspage.cpp +++ b/src/plugins/baremetal/debugserverproviderssettingspage.cpp @@ -157,7 +157,7 @@ void DebugServerProviderModel::apply() tr("The following providers were already configured:<br>" " %1<br>" "They were not configured again.") - .arg(skippedProviders.join(QLatin1String(",<br> ")))); + .arg(skippedProviders.join(",<br> "))); } } diff --git a/src/plugins/baremetal/debugservers/gdb/defaultgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/defaultgdbserverprovider.cpp index 9605ae166b..b626da90b0 100644 --- a/src/plugins/baremetal/debugservers/gdb/defaultgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/defaultgdbserverprovider.cpp @@ -42,7 +42,7 @@ namespace Internal { // DefaultGdbServerProvider DefaultGdbServerProvider::DefaultGdbServerProvider() - : GdbServerProvider(QLatin1String(Constants::DEFAULT_PROVIDER_ID)) + : GdbServerProvider(Constants::DEFAULT_PROVIDER_ID) { setDefaultChannel("localhost", 3333); setSettingsKeyBase("BareMetal.DefaultGdbServerProvider"); @@ -63,7 +63,7 @@ GdbServerProviderConfigWidget *DefaultGdbServerProvider::configurationWidget() DefaultGdbServerProviderFactory::DefaultGdbServerProviderFactory() { - setId(QLatin1String(Constants::DEFAULT_PROVIDER_ID)); + setId(Constants::DEFAULT_PROVIDER_ID); setDisplayName(tr("Default")); } @@ -75,8 +75,7 @@ GdbServerProvider *DefaultGdbServerProviderFactory::create() bool DefaultGdbServerProviderFactory::canRestore(const QVariantMap &data) const { const auto id = idFromMap(data); - return id.startsWith(QLatin1String(Constants::DEFAULT_PROVIDER_ID) - + QLatin1Char(':')); + return id.startsWith(Constants::DEFAULT_PROVIDER_ID + QLatin1Char(':')); } GdbServerProvider *DefaultGdbServerProviderFactory::restore(const QVariantMap &data) diff --git a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp index 0374c46d5d..c1d76e5c05 100644 --- a/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/openocdgdbserverprovider.cpp @@ -53,7 +53,7 @@ const char additionalArgumentsKeyC[] = "BareMetal.OpenOcdGdbServerProvider.Addit // OpenOcdGdbServerProvider OpenOcdGdbServerProvider::OpenOcdGdbServerProvider() - : GdbServerProvider(QLatin1String(Constants::OPENOCD_PROVIDER_ID)) + : GdbServerProvider(Constants::OPENOCD_PROVIDER_ID) { setInitCommands(defaultInitCommands()); setResetCommands(defaultResetCommands()); @@ -64,16 +64,16 @@ OpenOcdGdbServerProvider::OpenOcdGdbServerProvider() QString OpenOcdGdbServerProvider::defaultInitCommands() { - return QLatin1String("set remote hardware-breakpoint-limit 6\n" + return "set remote hardware-breakpoint-limit 6\n" "set remote hardware-watchpoint-limit 4\n" "monitor reset halt\n" "load\n" - "monitor reset halt\n"); + "monitor reset halt\n"; } QString OpenOcdGdbServerProvider::defaultResetCommands() { - return QLatin1String("monitor reset halt\n"); + return "monitor reset halt\n"; } QString OpenOcdGdbServerProvider::channelString() const @@ -197,7 +197,7 @@ GdbServerProviderConfigWidget *OpenOcdGdbServerProvider::configurationWidget() OpenOcdGdbServerProviderFactory::OpenOcdGdbServerProviderFactory() { - setId(QLatin1String(Constants::OPENOCD_PROVIDER_ID)); + setId(Constants::OPENOCD_PROVIDER_ID); setDisplayName(tr("OpenOCD")); } @@ -209,8 +209,7 @@ GdbServerProvider *OpenOcdGdbServerProviderFactory::create() bool OpenOcdGdbServerProviderFactory::canRestore(const QVariantMap &data) const { const QString id = idFromMap(data); - return id.startsWith(QLatin1String(Constants::OPENOCD_PROVIDER_ID) - + QLatin1Char(':')); + return id.startsWith(Constants::OPENOCD_PROVIDER_ID + QLatin1Char(':')); } GdbServerProvider *OpenOcdGdbServerProviderFactory::restore(const QVariantMap &data) @@ -236,7 +235,7 @@ OpenOcdGdbServerProviderConfigWidget::OpenOcdGdbServerProviderConfigWidget( m_executableFileChooser = new Utils::PathChooser; m_executableFileChooser->setExpectedKind(Utils::PathChooser::ExistingCommand); - m_executableFileChooser->setCommandVersionArguments(QStringList(QLatin1String("--version"))); + m_executableFileChooser->setCommandVersionArguments({"--version"}); m_mainLayout->addRow(tr("Executable file:"), m_executableFileChooser); m_rootScriptsDirChooser = new Utils::PathChooser; @@ -245,7 +244,7 @@ OpenOcdGdbServerProviderConfigWidget::OpenOcdGdbServerProviderConfigWidget( m_configurationFileChooser = new Utils::PathChooser; m_configurationFileChooser->setExpectedKind(Utils::PathChooser::File); - m_configurationFileChooser->setPromptDialogFilter(QLatin1String("*.cfg")); + m_configurationFileChooser->setPromptDialogFilter("*.cfg"); m_mainLayout->addRow(tr("Configuration file:"), m_configurationFileChooser); m_additionalArgumentsLineEdit = new QLineEdit(this); diff --git a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp index 3591ddb2fd..ca993a3eeb 100644 --- a/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/stlinkutilgdbserverprovider.cpp @@ -54,7 +54,7 @@ const char transportLayerKeyC[] = "BareMetal.StLinkUtilGdbServerProvider.Transpo // StLinkUtilGdbServerProvider StLinkUtilGdbServerProvider::StLinkUtilGdbServerProvider() - : GdbServerProvider(QLatin1String(Constants::STLINK_UTIL_PROVIDER_ID)) + : GdbServerProvider(Constants::STLINK_UTIL_PROVIDER_ID) { setInitCommands(defaultInitCommands()); setResetCommands(defaultResetCommands()); @@ -76,7 +76,7 @@ StLinkUtilGdbServerProvider::StLinkUtilGdbServerProvider( QString StLinkUtilGdbServerProvider::defaultInitCommands() { - return QLatin1String("load\n"); + return "load\n"; } QString StLinkUtilGdbServerProvider::defaultResetCommands() @@ -194,7 +194,7 @@ GdbServerProviderConfigWidget *StLinkUtilGdbServerProvider::configurationWidget( StLinkUtilGdbServerProviderFactory::StLinkUtilGdbServerProviderFactory() { - setId(QLatin1String(Constants::STLINK_UTIL_PROVIDER_ID)); + setId(Constants::STLINK_UTIL_PROVIDER_ID); setDisplayName(tr("ST-LINK Utility")); } @@ -206,8 +206,7 @@ GdbServerProvider *StLinkUtilGdbServerProviderFactory::create() bool StLinkUtilGdbServerProviderFactory::canRestore(const QVariantMap &data) const { const QString id = idFromMap(data); - return id.startsWith(QLatin1String(Constants::STLINK_UTIL_PROVIDER_ID) - + QLatin1Char(':')); + return id.startsWith(Constants::STLINK_UTIL_PROVIDER_ID + QLatin1Char(':')); } GdbServerProvider *StLinkUtilGdbServerProviderFactory::restore(const QVariantMap &data) diff --git a/src/plugins/baremetal/iarewparser.cpp b/src/plugins/baremetal/iarewparser.cpp index 039e32aa8d..52f94304e9 100644 --- a/src/plugins/baremetal/iarewparser.cpp +++ b/src/plugins/baremetal/iarewparser.cpp @@ -76,7 +76,7 @@ void IarParser::amendDescription() while (!m_snippets.isEmpty()) { const QString snippet = m_snippets.takeFirst(); const int start = m_lastTask.description.count() + 1; - m_lastTask.description.append(QLatin1Char('\n')); + m_lastTask.description.append('\n'); m_lastTask.description.append(snippet); QTextLayout::FormatRange fr; @@ -210,10 +210,10 @@ void IarParser::stdError(const QString &line) if (lne.isEmpty()) { // - } else if (!lne.startsWith(QLatin1Char(' '))) { + } else if (!lne.startsWith(' ')) { return; } else if (m_expectFilePath) { - if (lne.endsWith(QLatin1Char(']'))) { + if (lne.endsWith(']')) { const QString lastPart = lne.left(lne.size() - 1); m_filePathParts.push_back(lastPart); } else { @@ -310,10 +310,10 @@ void BareMetalPlugin::testIarOutputParsers_data() << QString::fromLatin1("Error in command line: Some error\n") << QString() << (Tasks() << Task(Task::Error, - QLatin1String("Error in command line: Some error"), - Utils::FilePath(), - -1, - categoryCompile)) + "Error in command line: Some error", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); QTest::newRow("Linker error") @@ -322,10 +322,10 @@ void BareMetalPlugin::testIarOutputParsers_data() << QString::fromLatin1("Error[e46]: Some error\n") << QString() << (Tasks() << Task(Task::Error, - QLatin1String("[e46]: Some error"), - Utils::FilePath(), - -1, - categoryCompile)) + "[e46]: Some error", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); // For std error. @@ -337,10 +337,10 @@ void BareMetalPlugin::testIarOutputParsers_data() << QString::fromLatin1("\"c:\\foo\\main.c\",63 Warning[Pe223]:\n" " Some warning \"foo\" bar\n") << (Tasks() << Task(Task::Warning, - QLatin1String("[Pe223]: Some warning \"foo\" bar"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "[Pe223]: Some warning \"foo\" bar", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("Details warning") @@ -355,12 +355,12 @@ void BareMetalPlugin::testIarOutputParsers_data() "\"c:\\foo\\main.c\",63 Warning[Pe223]:\n" " Some warning\n") << (Tasks() << Task(Task::Warning, - QLatin1String("[Pe223]: Some warning\n" - " some_detail;\n" - " ^"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "[Pe223]: Some warning\n" + " some_detail;\n" + " ^", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("No details split-description warning") @@ -373,10 +373,10 @@ void BareMetalPlugin::testIarOutputParsers_data() " Some warning\n" " , split\n") << (Tasks() << Task(Task::Warning, - QLatin1String("[Pe223]: Some warning, split"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "[Pe223]: Some warning, split", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("No details error") @@ -387,10 +387,10 @@ void BareMetalPlugin::testIarOutputParsers_data() << QString::fromLatin1("\"c:\\foo\\main.c\",63 Error[Pe223]:\n" " Some error\n") << (Tasks() << Task(Task::Error, - QLatin1String("[Pe223]: Some error"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "[Pe223]: Some error", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("Details error") @@ -405,12 +405,12 @@ void BareMetalPlugin::testIarOutputParsers_data() "\"c:\\foo\\main.c\",63 Error[Pe223]:\n" " Some error\n") << (Tasks() << Task(Task::Error, - QLatin1String("[Pe223]: Some error\n" - " some_detail;\n" - " ^"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "[Pe223]: Some error\n" + " some_detail;\n" + " ^", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("No details split-description error") @@ -423,10 +423,10 @@ void BareMetalPlugin::testIarOutputParsers_data() " Some error\n" " , split\n") << (Tasks() << Task(Task::Error, - QLatin1String("[Pe223]: Some error, split"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "[Pe223]: Some error, split", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("No definition for") @@ -441,10 +441,10 @@ void BareMetalPlugin::testIarOutputParsers_data() " n.c.o\n" "]\n") << (Tasks() << Task(Task::Error, - QLatin1String("[Li005]: Some error \"foo\""), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\bar\\main.c.o")), - -1, - categoryCompile)) + "[Li005]: Some error \"foo\"", + Utils::FilePath::fromUserInput("c:\\foo\\bar\\main.c.o"), + -1, + categoryCompile)) << QString(); QTest::newRow("More than one source file specified") @@ -459,12 +459,12 @@ void BareMetalPlugin::testIarOutputParsers_data() " c:\\bar.c\n" "Fatal error detected, aborting.\n") << (Tasks() << Task(Task::Error, - QLatin1String("[Su011]: Some error:\n" - " c:\\foo.c\n" - " c:\\bar.c"), - Utils::FilePath(), - -1, - categoryCompile)) + "[Su011]: Some error:\n" + " c:\\foo.c\n" + " c:\\bar.c", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); QTest::newRow("At end of source") @@ -473,10 +473,10 @@ void BareMetalPlugin::testIarOutputParsers_data() << QString() << QString::fromLatin1("At end of source Error[Pe040]: Some error \";\"\n") << (Tasks() << Task(Task::Error, - QLatin1String("[Pe040]: Some error \";\""), - Utils::FilePath(), - -1, - categoryCompile)) + "[Pe040]: Some error \";\"", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); } diff --git a/src/plugins/baremetal/idebugserverprovider.cpp b/src/plugins/baremetal/idebugserverprovider.cpp index ba9140a47f..8d687c2a26 100644 --- a/src/plugins/baremetal/idebugserverprovider.cpp +++ b/src/plugins/baremetal/idebugserverprovider.cpp @@ -44,8 +44,8 @@ const char displayNameKeyC[] = "BareMetal.IDebugServerProvider.DisplayName"; static QString createId(const QString &id) { - QString newId = id.left(id.indexOf(QLatin1Char(':'))); - newId.append(QLatin1Char(':') + QUuid::createUuid().toString()); + QString newId = id.left(id.indexOf(':')); + newId.append(':' + QUuid::createUuid().toString()); return newId; } @@ -102,8 +102,8 @@ bool IDebugServerProvider::operator==(const IDebugServerProvider &other) const if (this == &other) return true; - const QString thisId = id().left(id().indexOf(QLatin1Char(':'))); - const QString otherId = other.id().left(other.id().indexOf(QLatin1Char(':'))); + const QString thisId = id().left(id().indexOf(':')); + const QString otherId = other.id().left(other.id().indexOf(':')); // We ignore displayname return thisId == otherId; @@ -112,8 +112,8 @@ bool IDebugServerProvider::operator==(const IDebugServerProvider &other) const QVariantMap IDebugServerProvider::toMap() const { return { - {QLatin1String(idKeyC), m_id}, - {QLatin1String(displayNameKeyC), m_displayName}, + {idKeyC, m_id}, + {displayNameKeyC, m_displayName}, }; } @@ -136,8 +136,8 @@ void IDebugServerProvider::providerUpdated() bool IDebugServerProvider::fromMap(const QVariantMap &data) { - m_id = data.value(QLatin1String(idKeyC)).toString(); - m_displayName = data.value(QLatin1String(displayNameKeyC)).toString(); + m_id = data.value(idKeyC).toString(); + m_displayName = data.value(displayNameKeyC).toString(); return true; } @@ -170,12 +170,12 @@ void IDebugServerProviderFactory::setDisplayName(const QString &name) QString IDebugServerProviderFactory::idFromMap(const QVariantMap &data) { - return data.value(QLatin1String(idKeyC)).toString(); + return data.value(idKeyC).toString(); } void IDebugServerProviderFactory::idToMap(QVariantMap &data, const QString &id) { - data.insert(QLatin1String(idKeyC), id); + data.insert(idKeyC, id); } // IDebugServerProviderConfigWidget @@ -225,7 +225,7 @@ void IDebugServerProviderConfigWidget::setErrorMessage(const QString &m) clearErrorMessage(); } else { m_errorLabel->setText(m); - m_errorLabel->setStyleSheet(QLatin1String("background-color: \"red\"")); + m_errorLabel->setStyleSheet("background-color: \"red\""); m_errorLabel->setVisible(true); } } diff --git a/src/plugins/baremetal/keilparser.cpp b/src/plugins/baremetal/keilparser.cpp index ed74d690c0..61f66c38fd 100644 --- a/src/plugins/baremetal/keilparser.cpp +++ b/src/plugins/baremetal/keilparser.cpp @@ -186,9 +186,9 @@ bool KeilParser::parseMcs51FatalErrorMessage2(const QString &lne) return false; const QString key = match.captured(1); QString descr; - if (key == QLatin1Char('A')) + if (key == 'A') descr = "Assembler fatal error"; - else if (key == QLatin1Char('C')) + else if (key == 'C') descr = "Compiler fatal error"; const Task task(Task::TaskType::Error, descr, {}, -1, Constants::TASK_CATEGORY_COMPILE); @@ -208,7 +208,7 @@ void KeilParser::stdError(const QString &line) if (parseArmErrorOrFatalErorrMessage(lne)) return; - if (lne.startsWith(QLatin1Char(' '))) { + if (lne.startsWith(' ')) { m_snippets.push_back(lne); return; } @@ -330,10 +330,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << QString::fromLatin1("\"c:\\foo\\main.c\", line 63: Warning: #1234: Some warning\n") << (Tasks() << Task(Task::Warning, - QLatin1String("#1234: Some warning"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "#1234: Some warning", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("ARM: Details warning") @@ -346,12 +346,12 @@ void BareMetalPlugin::testKeilOutputParsers_data() " int f;\n" " ^\n") << (Tasks() << Task(Task::Warning, - QLatin1String("#1234: Some warning\n" - " int f;\n" - " ^"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "#1234: Some warning\n" + " int f;\n" + " ^", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("ARM: No details error") @@ -360,10 +360,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << QString::fromLatin1("\"c:\\foo\\main.c\", line 63: Error: #1234: Some error\n") << (Tasks() << Task(Task::Error, - QLatin1String("#1234: Some error"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "#1234: Some error", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("ARM: No details error with column") @@ -372,10 +372,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << QString::fromLatin1("\"flash.sct\", line 51 (column 20): Error: L1234: Some error\n") << (Tasks() << Task(Task::Error, - QLatin1String("L1234: Some error"), - Utils::FilePath::fromUserInput(QLatin1String("flash.sct")), - 51, - categoryCompile)) + "L1234: Some error", + Utils::FilePath::fromUserInput("flash.sct"), + 51, + categoryCompile)) << QString(); QTest::newRow("ARM: Details error") @@ -388,12 +388,12 @@ void BareMetalPlugin::testKeilOutputParsers_data() " int f;\n" " ^\n") << (Tasks() << Task(Task::Error, - QLatin1String("#1234: Some error\n" - " int f;\n" - " ^"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "#1234: Some error\n" + " int f;\n" + " ^", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("ARM: At end of source") @@ -402,10 +402,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << QString::fromLatin1("\"c:\\foo\\main.c\", line 71: Error: At end of source: #40: Some error\n") << (Tasks() << Task(Task::Error, - QLatin1String("#40: Some error"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 71, - categoryCompile)) + "#40: Some error", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 71, + categoryCompile)) << QString(); QTest::newRow("ARM: Starts with error") @@ -414,10 +414,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << QString::fromLatin1("Error: L6226E: Some error.\n") << (Tasks() << Task(Task::Error, - QLatin1String("L6226E: Some error."), - Utils::FilePath(), - -1, - categoryCompile)) + "L6226E: Some error.", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); // MCS51 compiler specific patterns. @@ -429,10 +429,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("*** WARNING #A9 IN 15 (c:\\foo\\dscr.a51, LINE 15): Some warning\n") << QString() << (Tasks() << Task(Task::Warning, - QLatin1String("#A9: Some warning"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\dscr.a51")), - 15, - categoryCompile)) + "#A9: Some warning", + Utils::FilePath::fromUserInput("c:\\foo\\dscr.a51"), + 15, + categoryCompile)) << QString(); QTest::newRow("MCS51: Assembler simple error") @@ -441,10 +441,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("*** ERROR #A9 IN 15 (c:\\foo\\dscr.a51, LINE 15): Some error\n") << QString() << (Tasks() << Task(Task::Error, - QLatin1String("#A9: Some error"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\dscr.a51")), - 15, - categoryCompile)) + "#A9: Some error", + Utils::FilePath::fromUserInput("c:\\foo\\dscr.a51"), + 15, + categoryCompile)) << QString(); QTest::newRow("MCS51: Assembler fatal error") @@ -457,12 +457,12 @@ void BareMetalPlugin::testKeilOutputParsers_data() " Some detail N\n") << QString() << (Tasks() << Task(Task::Error, - QLatin1String("Assembler fatal error\n" - " Some detail 1\n" - " Some detail N"), - Utils::FilePath(), - -1, - categoryCompile)) + "Assembler fatal error\n" + " Some detail 1\n" + " Some detail N", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); QTest::newRow("MCS51: Assembler details error") @@ -475,12 +475,12 @@ void BareMetalPlugin::testKeilOutputParsers_data() "*** ERROR #A45 IN 28 (d:\\foo.a51, LINE 28): Some error\n") << QString() << (Tasks() << Task(Task::Error, - QLatin1String("#A45: Some error\n" - " Some detail\n" - " ___^"), - Utils::FilePath::fromUserInput(QLatin1String("d:\\foo.a51")), - 28, - categoryCompile)) + "#A45: Some error\n" + " Some detail\n" + " ___^", + Utils::FilePath::fromUserInput("d:\\foo.a51"), + 28, + categoryCompile)) << QString(); // Compiler messages. @@ -490,10 +490,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("*** WARNING C123 IN LINE 13 OF c:\\foo.c: Some warning\n") << QString() << (Tasks() << Task(Task::Warning, - QLatin1String("C123: Some warning"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), - 13, - categoryCompile)) + "C123: Some warning", + Utils::FilePath::fromUserInput("c:\\foo.c"), + 13, + categoryCompile)) << QString(); QTest::newRow("MCS51: Compiler extended warning") @@ -502,10 +502,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("*** WARNING C123 IN LINE 13 OF c:\\foo.c: Some warning : 'extended text'\n") << QString() << (Tasks() << Task(Task::Warning, - QLatin1String("C123: Some warning : 'extended text'"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), - 13, - categoryCompile)) + "C123: Some warning : 'extended text'", + Utils::FilePath::fromUserInput("c:\\foo.c"), + 13, + categoryCompile)) << QString(); QTest::newRow("MCS51: Compiler simple error") @@ -514,10 +514,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("*** ERROR C123 IN LINE 13 OF c:\\foo.c: Some error\n") << QString() << (Tasks() << Task(Task::Error, - QLatin1String("C123: Some error"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), - 13, - categoryCompile)) + "C123: Some error", + Utils::FilePath::fromUserInput("c:\\foo.c"), + 13, + categoryCompile)) << QString(); QTest::newRow("MCS51: Compiler extended error") @@ -526,10 +526,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("*** ERROR C123 IN LINE 13 OF c:\\foo.c: Some error : 'extended text'\n") << QString() << (Tasks() << Task(Task::Error, - QLatin1String("C123: Some error : 'extended text'"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), - 13, - categoryCompile)) + "C123: Some error : 'extended text'", + Utils::FilePath::fromUserInput("c:\\foo.c"), + 13, + categoryCompile)) << QString(); QTest::newRow("MCS51: Compiler fatal error") @@ -542,12 +542,12 @@ void BareMetalPlugin::testKeilOutputParsers_data() " Some detail N\n") << QString() << (Tasks() << Task(Task::Error, - QLatin1String("Compiler fatal error\n" - " Some detail 1\n" - " Some detail N"), - Utils::FilePath(), - -1, - categoryCompile)) + "Compiler fatal error\n" + " Some detail 1\n" + " Some detail N", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); // Linker messages. @@ -559,8 +559,8 @@ void BareMetalPlugin::testKeilOutputParsers_data() " Some detail 1\n") << QString() << (Tasks() << Task(Task::Warning, - QLatin1String("L16: Some warning\n" - " Some detail 1"), + "L16: Some warning\n" + " Some detail 1", Utils::FilePath(), -1, categoryCompile)) @@ -572,10 +572,10 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("*** FATAL ERROR L456: Some error\n") << QString() << (Tasks() << Task(Task::Error, - QLatin1String("L456: Some error"), - Utils::FilePath(), - -1, - categoryCompile)) + "L456: Some error", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); QTest::newRow("MCS51: Linker extended fatal error") @@ -588,12 +588,12 @@ void BareMetalPlugin::testKeilOutputParsers_data() " Some detail N\n") << QString() << (Tasks() << Task(Task::Error, - QLatin1String("L456: Some error\n" - " Some detail 1\n" - " Some detail N"), - Utils::FilePath(), - -1, - categoryCompile)) + "L456: Some error\n" + " Some detail 1\n" + " Some detail N", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); } diff --git a/src/plugins/baremetal/sdccparser.cpp b/src/plugins/baremetal/sdccparser.cpp index 57a8606d5c..2b2a34454b 100644 --- a/src/plugins/baremetal/sdccparser.cpp +++ b/src/plugins/baremetal/sdccparser.cpp @@ -73,7 +73,7 @@ void SdccParser::newTask(const Task &task) void SdccParser::amendDescription(const QString &desc) { const int start = m_lastTask.description.count() + 1; - m_lastTask.description.append(QLatin1Char('\n')); + m_lastTask.description.append('\n'); m_lastTask.description.append(desc); QTextLayout::FormatRange fr; @@ -214,10 +214,10 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString() << QString::fromLatin1("c:\\foo\\main.c:63: Error: Some error\n") << (Tasks() << Task(Task::Error, - QLatin1String("Some error"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "Some error", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("Compiler single line warning") @@ -226,10 +226,10 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString() << QString::fromLatin1("c:\\foo\\main.c:63: warning 123: Some warning\n") << (Tasks() << Task(Task::Warning, - QLatin1String("Some warning"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "Some warning", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("Compiler multi line warning") @@ -242,12 +242,12 @@ void BareMetalPlugin::testSdccOutputParsers_data() "details #1\n" " details #2\n") << (Tasks() << Task(Task::Warning, - QLatin1String("Some warning\n" - "details #1\n" - " details #2"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "Some warning\n" + "details #1\n" + " details #2", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("Compiler simple single line error") @@ -256,10 +256,10 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString() << QString::fromLatin1("c:\\foo\\main.c:63: error: Some error\n") << (Tasks() << Task(Task::Error, - QLatin1String("Some error"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "Some error", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("Compiler single line error") @@ -268,10 +268,10 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString() << QString::fromLatin1("c:\\foo\\main.c:63: error 123: Some error\n") << (Tasks() << Task(Task::Error, - QLatin1String("Some error"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "Some error", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("Compiler multi line error") @@ -284,12 +284,12 @@ void BareMetalPlugin::testSdccOutputParsers_data() "details #1\n" " details #2\n") << (Tasks() << Task(Task::Error, - QLatin1String("Some error\n" - "details #1\n" - " details #2"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "Some error\n" + "details #1\n" + " details #2", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("Compiler syntax error") @@ -298,10 +298,10 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString() << QString::fromLatin1("c:\\foo\\main.c:63: syntax error: Some error\n") << (Tasks() << Task(Task::Error, - QLatin1String("Some error"), - Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), - 63, - categoryCompile)) + "Some error", + Utils::FilePath::fromUserInput("c:\\foo\\main.c"), + 63, + categoryCompile)) << QString(); QTest::newRow("Compiler bad option error") @@ -310,10 +310,10 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString() << QString::fromLatin1("at 1: error 123: Some error\n") << (Tasks() << Task(Task::Error, - QLatin1String("Some error"), - Utils::FilePath(), - -1, - categoryCompile)) + "Some error", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); QTest::newRow("Compiler bad option warning") @@ -322,10 +322,10 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString() << QString::fromLatin1("at 1: warning 123: Some warning\n") << (Tasks() << Task(Task::Warning, - QLatin1String("Some warning"), - Utils::FilePath(), - -1, - categoryCompile)) + "Some warning", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); QTest::newRow("Linker warning") @@ -334,10 +334,10 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString() << QString::fromLatin1("?ASlink-Warning-Couldn't find library 'foo.lib'\n") << (Tasks() << Task(Task::Warning, - QLatin1String("Couldn't find library 'foo.lib'"), - Utils::FilePath(), - -1, - categoryCompile)) + "Couldn't find library 'foo.lib'", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); QTest::newRow("Linker error") @@ -346,10 +346,10 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString() << QString::fromLatin1("?ASlink-Error-<cannot open> : \"foo.rel\"\n") << (Tasks() << Task(Task::Error, - QLatin1String("<cannot open> : \"foo.rel\""), - Utils::FilePath(), - -1, - categoryCompile)) + "<cannot open> : \"foo.rel\"", + Utils::FilePath(), + -1, + categoryCompile)) << QString(); } |