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>
This commit is contained in:
Denis Shienkov
2019-11-04 14:23:21 +03:00
parent 4828aa7244
commit 5b2feffb39
10 changed files with 226 additions and 229 deletions

View File

@@ -112,7 +112,7 @@ void BareMetalDevice::setChannelByServerProvider(IDebugServerProvider *provider)
const auto gdbProvider = static_cast<GdbServerProvider *>(provider); const auto gdbProvider = static_cast<GdbServerProvider *>(provider);
const QString channel = gdbProvider->channelString(); const QString channel = gdbProvider->channelString();
const int colon = channel.indexOf(QLatin1Char(':')); const int colon = channel.indexOf(':');
if (colon < 0) if (colon < 0)
return; return;
QSsh::SshConnectionParameters sshParams = sshParameters(); QSsh::SshConnectionParameters sshParams = sshParameters();
@@ -124,7 +124,7 @@ void BareMetalDevice::setChannelByServerProvider(IDebugServerProvider *provider)
void BareMetalDevice::fromMap(const QVariantMap &map) void BareMetalDevice::fromMap(const QVariantMap &map)
{ {
IDevice::fromMap(map); IDevice::fromMap(map);
QString providerId = map.value(QLatin1String(debugServerProviderIdKeyC)).toString(); QString providerId = map.value(debugServerProviderIdKeyC).toString();
if (providerId.isEmpty()) { if (providerId.isEmpty()) {
const QString name = displayName(); const QString name = displayName();
if (IDebugServerProvider *provider = if (IDebugServerProvider *provider =
@@ -147,7 +147,7 @@ void BareMetalDevice::fromMap(const QVariantMap &map)
QVariantMap BareMetalDevice::toMap() const QVariantMap BareMetalDevice::toMap() const
{ {
QVariantMap map = IDevice::toMap(); QVariantMap map = IDevice::toMap();
map.insert(QLatin1String(debugServerProviderIdKeyC), debugServerProviderId()); map.insert(debugServerProviderIdKeyC, debugServerProviderId());
return map; return map;
} }

View File

@@ -61,7 +61,7 @@ DebugServerProviderManager::DebugServerProviderManager()
{ {
m_instance = this; m_instance = this;
m_writer = new Utils::PersistentSettingsWriter( m_writer = new Utils::PersistentSettingsWriter(
m_configFile, QLatin1String("QtCreatorDebugServerProviders")); m_configFile, "QtCreatorDebugServerProviders");
connect(Core::ICore::instance(), &Core::ICore::saveSettingsRequested, connect(Core::ICore::instance(), &Core::ICore::saveSettingsRequested,
this, &DebugServerProviderManager::saveProviders); this, &DebugServerProviderManager::saveProviders);
@@ -95,11 +95,11 @@ void DebugServerProviderManager::restoreProviders()
return; return;
const QVariantMap data = reader.restoreValues(); 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) if (version < 1)
return; 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) { for (int i = 0; i < count; ++i) {
const QString key = QString::fromLatin1(dataKeyC) + QString::number(i); const QString key = QString::fromLatin1(dataKeyC) + QString::number(i);
if (!data.contains(key)) if (!data.contains(key))
@@ -128,7 +128,7 @@ void DebugServerProviderManager::restoreProviders()
void DebugServerProviderManager::saveProviders() void DebugServerProviderManager::saveProviders()
{ {
QVariantMap data; QVariantMap data;
data.insert(QLatin1String(fileVersionKeyC), 1); data.insert(fileVersionKeyC, 1);
int count = 0; int count = 0;
for (const IDebugServerProvider *p : qAsConst(m_providers)) { for (const IDebugServerProvider *p : qAsConst(m_providers)) {
@@ -141,7 +141,7 @@ void DebugServerProviderManager::saveProviders()
++count; ++count;
} }
} }
data.insert(QLatin1String(countKeyC), count); data.insert(countKeyC, count);
m_writer->save(data, Core::ICore::mainWindow()); m_writer->save(data, Core::ICore::mainWindow());
} }

View File

@@ -157,7 +157,7 @@ void DebugServerProviderModel::apply()
tr("The following providers were already configured:<br>" tr("The following providers were already configured:<br>"
"&nbsp;%1<br>" "&nbsp;%1<br>"
"They were not configured again.") "They were not configured again.")
.arg(skippedProviders.join(QLatin1String(",<br>&nbsp;")))); .arg(skippedProviders.join(",<br>&nbsp;")));
} }
} }

View File

@@ -42,7 +42,7 @@ namespace Internal {
// DefaultGdbServerProvider // DefaultGdbServerProvider
DefaultGdbServerProvider::DefaultGdbServerProvider() DefaultGdbServerProvider::DefaultGdbServerProvider()
: GdbServerProvider(QLatin1String(Constants::DEFAULT_PROVIDER_ID)) : GdbServerProvider(Constants::DEFAULT_PROVIDER_ID)
{ {
setDefaultChannel("localhost", 3333); setDefaultChannel("localhost", 3333);
setSettingsKeyBase("BareMetal.DefaultGdbServerProvider"); setSettingsKeyBase("BareMetal.DefaultGdbServerProvider");
@@ -63,7 +63,7 @@ GdbServerProviderConfigWidget *DefaultGdbServerProvider::configurationWidget()
DefaultGdbServerProviderFactory::DefaultGdbServerProviderFactory() DefaultGdbServerProviderFactory::DefaultGdbServerProviderFactory()
{ {
setId(QLatin1String(Constants::DEFAULT_PROVIDER_ID)); setId(Constants::DEFAULT_PROVIDER_ID);
setDisplayName(tr("Default")); setDisplayName(tr("Default"));
} }
@@ -75,8 +75,7 @@ GdbServerProvider *DefaultGdbServerProviderFactory::create()
bool DefaultGdbServerProviderFactory::canRestore(const QVariantMap &data) const bool DefaultGdbServerProviderFactory::canRestore(const QVariantMap &data) const
{ {
const auto id = idFromMap(data); const auto id = idFromMap(data);
return id.startsWith(QLatin1String(Constants::DEFAULT_PROVIDER_ID) return id.startsWith(Constants::DEFAULT_PROVIDER_ID + QLatin1Char(':'));
+ QLatin1Char(':'));
} }
GdbServerProvider *DefaultGdbServerProviderFactory::restore(const QVariantMap &data) GdbServerProvider *DefaultGdbServerProviderFactory::restore(const QVariantMap &data)

View File

@@ -53,7 +53,7 @@ const char additionalArgumentsKeyC[] = "BareMetal.OpenOcdGdbServerProvider.Addit
// OpenOcdGdbServerProvider // OpenOcdGdbServerProvider
OpenOcdGdbServerProvider::OpenOcdGdbServerProvider() OpenOcdGdbServerProvider::OpenOcdGdbServerProvider()
: GdbServerProvider(QLatin1String(Constants::OPENOCD_PROVIDER_ID)) : GdbServerProvider(Constants::OPENOCD_PROVIDER_ID)
{ {
setInitCommands(defaultInitCommands()); setInitCommands(defaultInitCommands());
setResetCommands(defaultResetCommands()); setResetCommands(defaultResetCommands());
@@ -64,16 +64,16 @@ OpenOcdGdbServerProvider::OpenOcdGdbServerProvider()
QString OpenOcdGdbServerProvider::defaultInitCommands() 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" "set remote hardware-watchpoint-limit 4\n"
"monitor reset halt\n" "monitor reset halt\n"
"load\n" "load\n"
"monitor reset halt\n"); "monitor reset halt\n";
} }
QString OpenOcdGdbServerProvider::defaultResetCommands() QString OpenOcdGdbServerProvider::defaultResetCommands()
{ {
return QLatin1String("monitor reset halt\n"); return "monitor reset halt\n";
} }
QString OpenOcdGdbServerProvider::channelString() const QString OpenOcdGdbServerProvider::channelString() const
@@ -197,7 +197,7 @@ GdbServerProviderConfigWidget *OpenOcdGdbServerProvider::configurationWidget()
OpenOcdGdbServerProviderFactory::OpenOcdGdbServerProviderFactory() OpenOcdGdbServerProviderFactory::OpenOcdGdbServerProviderFactory()
{ {
setId(QLatin1String(Constants::OPENOCD_PROVIDER_ID)); setId(Constants::OPENOCD_PROVIDER_ID);
setDisplayName(tr("OpenOCD")); setDisplayName(tr("OpenOCD"));
} }
@@ -209,8 +209,7 @@ GdbServerProvider *OpenOcdGdbServerProviderFactory::create()
bool OpenOcdGdbServerProviderFactory::canRestore(const QVariantMap &data) const bool OpenOcdGdbServerProviderFactory::canRestore(const QVariantMap &data) const
{ {
const QString id = idFromMap(data); const QString id = idFromMap(data);
return id.startsWith(QLatin1String(Constants::OPENOCD_PROVIDER_ID) return id.startsWith(Constants::OPENOCD_PROVIDER_ID + QLatin1Char(':'));
+ QLatin1Char(':'));
} }
GdbServerProvider *OpenOcdGdbServerProviderFactory::restore(const QVariantMap &data) GdbServerProvider *OpenOcdGdbServerProviderFactory::restore(const QVariantMap &data)
@@ -236,7 +235,7 @@ OpenOcdGdbServerProviderConfigWidget::OpenOcdGdbServerProviderConfigWidget(
m_executableFileChooser = new Utils::PathChooser; m_executableFileChooser = new Utils::PathChooser;
m_executableFileChooser->setExpectedKind(Utils::PathChooser::ExistingCommand); 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_mainLayout->addRow(tr("Executable file:"), m_executableFileChooser);
m_rootScriptsDirChooser = new Utils::PathChooser; m_rootScriptsDirChooser = new Utils::PathChooser;
@@ -245,7 +244,7 @@ OpenOcdGdbServerProviderConfigWidget::OpenOcdGdbServerProviderConfigWidget(
m_configurationFileChooser = new Utils::PathChooser; m_configurationFileChooser = new Utils::PathChooser;
m_configurationFileChooser->setExpectedKind(Utils::PathChooser::File); m_configurationFileChooser->setExpectedKind(Utils::PathChooser::File);
m_configurationFileChooser->setPromptDialogFilter(QLatin1String("*.cfg")); m_configurationFileChooser->setPromptDialogFilter("*.cfg");
m_mainLayout->addRow(tr("Configuration file:"), m_configurationFileChooser); m_mainLayout->addRow(tr("Configuration file:"), m_configurationFileChooser);
m_additionalArgumentsLineEdit = new QLineEdit(this); m_additionalArgumentsLineEdit = new QLineEdit(this);

View File

@@ -54,7 +54,7 @@ const char transportLayerKeyC[] = "BareMetal.StLinkUtilGdbServerProvider.Transpo
// StLinkUtilGdbServerProvider // StLinkUtilGdbServerProvider
StLinkUtilGdbServerProvider::StLinkUtilGdbServerProvider() StLinkUtilGdbServerProvider::StLinkUtilGdbServerProvider()
: GdbServerProvider(QLatin1String(Constants::STLINK_UTIL_PROVIDER_ID)) : GdbServerProvider(Constants::STLINK_UTIL_PROVIDER_ID)
{ {
setInitCommands(defaultInitCommands()); setInitCommands(defaultInitCommands());
setResetCommands(defaultResetCommands()); setResetCommands(defaultResetCommands());
@@ -76,7 +76,7 @@ StLinkUtilGdbServerProvider::StLinkUtilGdbServerProvider(
QString StLinkUtilGdbServerProvider::defaultInitCommands() QString StLinkUtilGdbServerProvider::defaultInitCommands()
{ {
return QLatin1String("load\n"); return "load\n";
} }
QString StLinkUtilGdbServerProvider::defaultResetCommands() QString StLinkUtilGdbServerProvider::defaultResetCommands()
@@ -194,7 +194,7 @@ GdbServerProviderConfigWidget *StLinkUtilGdbServerProvider::configurationWidget(
StLinkUtilGdbServerProviderFactory::StLinkUtilGdbServerProviderFactory() StLinkUtilGdbServerProviderFactory::StLinkUtilGdbServerProviderFactory()
{ {
setId(QLatin1String(Constants::STLINK_UTIL_PROVIDER_ID)); setId(Constants::STLINK_UTIL_PROVIDER_ID);
setDisplayName(tr("ST-LINK Utility")); setDisplayName(tr("ST-LINK Utility"));
} }
@@ -206,8 +206,7 @@ GdbServerProvider *StLinkUtilGdbServerProviderFactory::create()
bool StLinkUtilGdbServerProviderFactory::canRestore(const QVariantMap &data) const bool StLinkUtilGdbServerProviderFactory::canRestore(const QVariantMap &data) const
{ {
const QString id = idFromMap(data); const QString id = idFromMap(data);
return id.startsWith(QLatin1String(Constants::STLINK_UTIL_PROVIDER_ID) return id.startsWith(Constants::STLINK_UTIL_PROVIDER_ID + QLatin1Char(':'));
+ QLatin1Char(':'));
} }
GdbServerProvider *StLinkUtilGdbServerProviderFactory::restore(const QVariantMap &data) GdbServerProvider *StLinkUtilGdbServerProviderFactory::restore(const QVariantMap &data)

View File

@@ -76,7 +76,7 @@ void IarParser::amendDescription()
while (!m_snippets.isEmpty()) { while (!m_snippets.isEmpty()) {
const QString snippet = m_snippets.takeFirst(); const QString snippet = m_snippets.takeFirst();
const int start = m_lastTask.description.count() + 1; const int start = m_lastTask.description.count() + 1;
m_lastTask.description.append(QLatin1Char('\n')); m_lastTask.description.append('\n');
m_lastTask.description.append(snippet); m_lastTask.description.append(snippet);
QTextLayout::FormatRange fr; QTextLayout::FormatRange fr;
@@ -210,10 +210,10 @@ void IarParser::stdError(const QString &line)
if (lne.isEmpty()) { if (lne.isEmpty()) {
// //
} else if (!lne.startsWith(QLatin1Char(' '))) { } else if (!lne.startsWith(' ')) {
return; return;
} else if (m_expectFilePath) { } else if (m_expectFilePath) {
if (lne.endsWith(QLatin1Char(']'))) { if (lne.endsWith(']')) {
const QString lastPart = lne.left(lne.size() - 1); const QString lastPart = lne.left(lne.size() - 1);
m_filePathParts.push_back(lastPart); m_filePathParts.push_back(lastPart);
} else { } else {
@@ -310,7 +310,7 @@ void BareMetalPlugin::testIarOutputParsers_data()
<< QString::fromLatin1("Error in command line: Some error\n") << QString::fromLatin1("Error in command line: Some error\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("Error in command line: Some error"), "Error in command line: Some error",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))
@@ -322,7 +322,7 @@ void BareMetalPlugin::testIarOutputParsers_data()
<< QString::fromLatin1("Error[e46]: Some error\n") << QString::fromLatin1("Error[e46]: Some error\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("[e46]: Some error"), "[e46]: Some error",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))
@@ -337,8 +337,8 @@ void BareMetalPlugin::testIarOutputParsers_data()
<< QString::fromLatin1("\"c:\\foo\\main.c\",63 Warning[Pe223]:\n" << QString::fromLatin1("\"c:\\foo\\main.c\",63 Warning[Pe223]:\n"
" Some warning \"foo\" bar\n") " Some warning \"foo\" bar\n")
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("[Pe223]: Some warning \"foo\" bar"), "[Pe223]: Some warning \"foo\" bar",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -355,10 +355,10 @@ void BareMetalPlugin::testIarOutputParsers_data()
"\"c:\\foo\\main.c\",63 Warning[Pe223]:\n" "\"c:\\foo\\main.c\",63 Warning[Pe223]:\n"
" Some warning\n") " Some warning\n")
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("[Pe223]: Some warning\n" "[Pe223]: Some warning\n"
" some_detail;\n" " some_detail;\n"
" ^"), " ^",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -373,8 +373,8 @@ void BareMetalPlugin::testIarOutputParsers_data()
" Some warning\n" " Some warning\n"
" , split\n") " , split\n")
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("[Pe223]: Some warning, split"), "[Pe223]: Some warning, split",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -387,8 +387,8 @@ void BareMetalPlugin::testIarOutputParsers_data()
<< QString::fromLatin1("\"c:\\foo\\main.c\",63 Error[Pe223]:\n" << QString::fromLatin1("\"c:\\foo\\main.c\",63 Error[Pe223]:\n"
" Some error\n") " Some error\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("[Pe223]: Some error"), "[Pe223]: Some error",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -405,10 +405,10 @@ void BareMetalPlugin::testIarOutputParsers_data()
"\"c:\\foo\\main.c\",63 Error[Pe223]:\n" "\"c:\\foo\\main.c\",63 Error[Pe223]:\n"
" Some error\n") " Some error\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("[Pe223]: Some error\n" "[Pe223]: Some error\n"
" some_detail;\n" " some_detail;\n"
" ^"), " ^",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -423,8 +423,8 @@ void BareMetalPlugin::testIarOutputParsers_data()
" Some error\n" " Some error\n"
" , split\n") " , split\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("[Pe223]: Some error, split"), "[Pe223]: Some error, split",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -441,8 +441,8 @@ void BareMetalPlugin::testIarOutputParsers_data()
" n.c.o\n" " n.c.o\n"
"]\n") "]\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("[Li005]: Some error \"foo\""), "[Li005]: Some error \"foo\"",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\bar\\main.c.o")), Utils::FilePath::fromUserInput("c:\\foo\\bar\\main.c.o"),
-1, -1,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -459,9 +459,9 @@ void BareMetalPlugin::testIarOutputParsers_data()
" c:\\bar.c\n" " c:\\bar.c\n"
"Fatal error detected, aborting.\n") "Fatal error detected, aborting.\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("[Su011]: Some error:\n" "[Su011]: Some error:\n"
" c:\\foo.c\n" " c:\\foo.c\n"
" c:\\bar.c"), " c:\\bar.c",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))
@@ -473,7 +473,7 @@ void BareMetalPlugin::testIarOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("At end of source Error[Pe040]: Some error \";\"\n") << QString::fromLatin1("At end of source Error[Pe040]: Some error \";\"\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("[Pe040]: Some error \";\""), "[Pe040]: Some error \";\"",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))

View File

@@ -44,8 +44,8 @@ const char displayNameKeyC[] = "BareMetal.IDebugServerProvider.DisplayName";
static QString createId(const QString &id) static QString createId(const QString &id)
{ {
QString newId = id.left(id.indexOf(QLatin1Char(':'))); QString newId = id.left(id.indexOf(':'));
newId.append(QLatin1Char(':') + QUuid::createUuid().toString()); newId.append(':' + QUuid::createUuid().toString());
return newId; return newId;
} }
@@ -102,8 +102,8 @@ bool IDebugServerProvider::operator==(const IDebugServerProvider &other) const
if (this == &other) if (this == &other)
return true; return true;
const QString thisId = id().left(id().indexOf(QLatin1Char(':'))); const QString thisId = id().left(id().indexOf(':'));
const QString otherId = other.id().left(other.id().indexOf(QLatin1Char(':'))); const QString otherId = other.id().left(other.id().indexOf(':'));
// We ignore displayname // We ignore displayname
return thisId == otherId; return thisId == otherId;
@@ -112,8 +112,8 @@ bool IDebugServerProvider::operator==(const IDebugServerProvider &other) const
QVariantMap IDebugServerProvider::toMap() const QVariantMap IDebugServerProvider::toMap() const
{ {
return { return {
{QLatin1String(idKeyC), m_id}, {idKeyC, m_id},
{QLatin1String(displayNameKeyC), m_displayName}, {displayNameKeyC, m_displayName},
}; };
} }
@@ -136,8 +136,8 @@ void IDebugServerProvider::providerUpdated()
bool IDebugServerProvider::fromMap(const QVariantMap &data) bool IDebugServerProvider::fromMap(const QVariantMap &data)
{ {
m_id = data.value(QLatin1String(idKeyC)).toString(); m_id = data.value(idKeyC).toString();
m_displayName = data.value(QLatin1String(displayNameKeyC)).toString(); m_displayName = data.value(displayNameKeyC).toString();
return true; return true;
} }
@@ -170,12 +170,12 @@ void IDebugServerProviderFactory::setDisplayName(const QString &name)
QString IDebugServerProviderFactory::idFromMap(const QVariantMap &data) 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) void IDebugServerProviderFactory::idToMap(QVariantMap &data, const QString &id)
{ {
data.insert(QLatin1String(idKeyC), id); data.insert(idKeyC, id);
} }
// IDebugServerProviderConfigWidget // IDebugServerProviderConfigWidget
@@ -225,7 +225,7 @@ void IDebugServerProviderConfigWidget::setErrorMessage(const QString &m)
clearErrorMessage(); clearErrorMessage();
} else { } else {
m_errorLabel->setText(m); m_errorLabel->setText(m);
m_errorLabel->setStyleSheet(QLatin1String("background-color: \"red\"")); m_errorLabel->setStyleSheet("background-color: \"red\"");
m_errorLabel->setVisible(true); m_errorLabel->setVisible(true);
} }
} }

View File

@@ -186,9 +186,9 @@ bool KeilParser::parseMcs51FatalErrorMessage2(const QString &lne)
return false; return false;
const QString key = match.captured(1); const QString key = match.captured(1);
QString descr; QString descr;
if (key == QLatin1Char('A')) if (key == 'A')
descr = "Assembler fatal error"; descr = "Assembler fatal error";
else if (key == QLatin1Char('C')) else if (key == 'C')
descr = "Compiler fatal error"; descr = "Compiler fatal error";
const Task task(Task::TaskType::Error, descr, {}, -1, const Task task(Task::TaskType::Error, descr, {}, -1,
Constants::TASK_CATEGORY_COMPILE); Constants::TASK_CATEGORY_COMPILE);
@@ -208,7 +208,7 @@ void KeilParser::stdError(const QString &line)
if (parseArmErrorOrFatalErorrMessage(lne)) if (parseArmErrorOrFatalErorrMessage(lne))
return; return;
if (lne.startsWith(QLatin1Char(' '))) { if (lne.startsWith(' ')) {
m_snippets.push_back(lne); m_snippets.push_back(lne);
return; return;
} }
@@ -330,8 +330,8 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("\"c:\\foo\\main.c\", line 63: Warning: #1234: Some warning\n") << QString::fromLatin1("\"c:\\foo\\main.c\", line 63: Warning: #1234: Some warning\n")
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("#1234: Some warning"), "#1234: Some warning",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -346,10 +346,10 @@ void BareMetalPlugin::testKeilOutputParsers_data()
" int f;\n" " int f;\n"
" ^\n") " ^\n")
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("#1234: Some warning\n" "#1234: Some warning\n"
" int f;\n" " int f;\n"
" ^"), " ^",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -360,8 +360,8 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("\"c:\\foo\\main.c\", line 63: Error: #1234: Some error\n") << QString::fromLatin1("\"c:\\foo\\main.c\", line 63: Error: #1234: Some error\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("#1234: Some error"), "#1234: Some error",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -372,8 +372,8 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("\"flash.sct\", line 51 (column 20): Error: L1234: Some error\n") << QString::fromLatin1("\"flash.sct\", line 51 (column 20): Error: L1234: Some error\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("L1234: Some error"), "L1234: Some error",
Utils::FilePath::fromUserInput(QLatin1String("flash.sct")), Utils::FilePath::fromUserInput("flash.sct"),
51, 51,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -388,10 +388,10 @@ void BareMetalPlugin::testKeilOutputParsers_data()
" int f;\n" " int f;\n"
" ^\n") " ^\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("#1234: Some error\n" "#1234: Some error\n"
" int f;\n" " int f;\n"
" ^"), " ^",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -402,8 +402,8 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("\"c:\\foo\\main.c\", line 71: Error: At end of source: #40: Some error\n") << QString::fromLatin1("\"c:\\foo\\main.c\", line 71: Error: At end of source: #40: Some error\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("#40: Some error"), "#40: Some error",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
71, 71,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -414,7 +414,7 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("Error: L6226E: Some error.\n") << QString::fromLatin1("Error: L6226E: Some error.\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("L6226E: Some error."), "L6226E: Some error.",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))
@@ -429,8 +429,8 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString::fromLatin1("*** WARNING #A9 IN 15 (c:\\foo\\dscr.a51, LINE 15): Some warning\n") << QString::fromLatin1("*** WARNING #A9 IN 15 (c:\\foo\\dscr.a51, LINE 15): Some warning\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("#A9: Some warning"), "#A9: Some warning",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\dscr.a51")), Utils::FilePath::fromUserInput("c:\\foo\\dscr.a51"),
15, 15,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -441,8 +441,8 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString::fromLatin1("*** ERROR #A9 IN 15 (c:\\foo\\dscr.a51, LINE 15): Some error\n") << QString::fromLatin1("*** ERROR #A9 IN 15 (c:\\foo\\dscr.a51, LINE 15): Some error\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("#A9: Some error"), "#A9: Some error",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\dscr.a51")), Utils::FilePath::fromUserInput("c:\\foo\\dscr.a51"),
15, 15,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -457,9 +457,9 @@ void BareMetalPlugin::testKeilOutputParsers_data()
" Some detail N\n") " Some detail N\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("Assembler fatal error\n" "Assembler fatal error\n"
" Some detail 1\n" " Some detail 1\n"
" Some detail N"), " Some detail N",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))
@@ -475,10 +475,10 @@ void BareMetalPlugin::testKeilOutputParsers_data()
"*** ERROR #A45 IN 28 (d:\\foo.a51, LINE 28): Some error\n") "*** ERROR #A45 IN 28 (d:\\foo.a51, LINE 28): Some error\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("#A45: Some error\n" "#A45: Some error\n"
" Some detail\n" " Some detail\n"
" ___^"), " ___^",
Utils::FilePath::fromUserInput(QLatin1String("d:\\foo.a51")), Utils::FilePath::fromUserInput("d:\\foo.a51"),
28, 28,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -490,8 +490,8 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString::fromLatin1("*** WARNING C123 IN LINE 13 OF c:\\foo.c: Some warning\n") << QString::fromLatin1("*** WARNING C123 IN LINE 13 OF c:\\foo.c: Some warning\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("C123: Some warning"), "C123: Some warning",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), Utils::FilePath::fromUserInput("c:\\foo.c"),
13, 13,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -502,8 +502,8 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString::fromLatin1("*** WARNING C123 IN LINE 13 OF c:\\foo.c: Some warning : 'extended text'\n") << QString::fromLatin1("*** WARNING C123 IN LINE 13 OF c:\\foo.c: Some warning : 'extended text'\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("C123: Some warning : 'extended text'"), "C123: Some warning : 'extended text'",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), Utils::FilePath::fromUserInput("c:\\foo.c"),
13, 13,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -514,8 +514,8 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString::fromLatin1("*** ERROR C123 IN LINE 13 OF c:\\foo.c: Some error\n") << QString::fromLatin1("*** ERROR C123 IN LINE 13 OF c:\\foo.c: Some error\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("C123: Some error"), "C123: Some error",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), Utils::FilePath::fromUserInput("c:\\foo.c"),
13, 13,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -526,8 +526,8 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString::fromLatin1("*** ERROR C123 IN LINE 13 OF c:\\foo.c: Some error : 'extended text'\n") << QString::fromLatin1("*** ERROR C123 IN LINE 13 OF c:\\foo.c: Some error : 'extended text'\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("C123: Some error : 'extended text'"), "C123: Some error : 'extended text'",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), Utils::FilePath::fromUserInput("c:\\foo.c"),
13, 13,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -542,9 +542,9 @@ void BareMetalPlugin::testKeilOutputParsers_data()
" Some detail N\n") " Some detail N\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("Compiler fatal error\n" "Compiler fatal error\n"
" Some detail 1\n" " Some detail 1\n"
" Some detail N"), " Some detail N",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))
@@ -559,8 +559,8 @@ void BareMetalPlugin::testKeilOutputParsers_data()
" Some detail 1\n") " Some detail 1\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("L16: Some warning\n" "L16: Some warning\n"
" Some detail 1"), " Some detail 1",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))
@@ -572,7 +572,7 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString::fromLatin1("*** FATAL ERROR L456: Some error\n") << QString::fromLatin1("*** FATAL ERROR L456: Some error\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("L456: Some error"), "L456: Some error",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))
@@ -588,9 +588,9 @@ void BareMetalPlugin::testKeilOutputParsers_data()
" Some detail N\n") " Some detail N\n")
<< QString() << QString()
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("L456: Some error\n" "L456: Some error\n"
" Some detail 1\n" " Some detail 1\n"
" Some detail N"), " Some detail N",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))

View File

@@ -73,7 +73,7 @@ void SdccParser::newTask(const Task &task)
void SdccParser::amendDescription(const QString &desc) void SdccParser::amendDescription(const QString &desc)
{ {
const int start = m_lastTask.description.count() + 1; const int start = m_lastTask.description.count() + 1;
m_lastTask.description.append(QLatin1Char('\n')); m_lastTask.description.append('\n');
m_lastTask.description.append(desc); m_lastTask.description.append(desc);
QTextLayout::FormatRange fr; QTextLayout::FormatRange fr;
@@ -214,8 +214,8 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("c:\\foo\\main.c:63: Error: Some error\n") << QString::fromLatin1("c:\\foo\\main.c:63: Error: Some error\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("Some error"), "Some error",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -226,8 +226,8 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("c:\\foo\\main.c:63: warning 123: Some warning\n") << QString::fromLatin1("c:\\foo\\main.c:63: warning 123: Some warning\n")
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("Some warning"), "Some warning",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -242,10 +242,10 @@ void BareMetalPlugin::testSdccOutputParsers_data()
"details #1\n" "details #1\n"
" details #2\n") " details #2\n")
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("Some warning\n" "Some warning\n"
"details #1\n" "details #1\n"
" details #2"), " details #2",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -256,8 +256,8 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("c:\\foo\\main.c:63: error: Some error\n") << QString::fromLatin1("c:\\foo\\main.c:63: error: Some error\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("Some error"), "Some error",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -268,8 +268,8 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("c:\\foo\\main.c:63: error 123: Some error\n") << QString::fromLatin1("c:\\foo\\main.c:63: error 123: Some error\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("Some error"), "Some error",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -284,10 +284,10 @@ void BareMetalPlugin::testSdccOutputParsers_data()
"details #1\n" "details #1\n"
" details #2\n") " details #2\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("Some error\n" "Some error\n"
"details #1\n" "details #1\n"
" details #2"), " details #2",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -298,8 +298,8 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("c:\\foo\\main.c:63: syntax error: Some error\n") << QString::fromLatin1("c:\\foo\\main.c:63: syntax error: Some error\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("Some error"), "Some error",
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63, 63,
categoryCompile)) categoryCompile))
<< QString(); << QString();
@@ -310,7 +310,7 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("at 1: error 123: Some error\n") << QString::fromLatin1("at 1: error 123: Some error\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("Some error"), "Some error",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))
@@ -322,7 +322,7 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("at 1: warning 123: Some warning\n") << QString::fromLatin1("at 1: warning 123: Some warning\n")
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("Some warning"), "Some warning",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))
@@ -334,7 +334,7 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("?ASlink-Warning-Couldn't find library 'foo.lib'\n") << QString::fromLatin1("?ASlink-Warning-Couldn't find library 'foo.lib'\n")
<< (Tasks() << Task(Task::Warning, << (Tasks() << Task(Task::Warning,
QLatin1String("Couldn't find library 'foo.lib'"), "Couldn't find library 'foo.lib'",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))
@@ -346,7 +346,7 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString() << QString()
<< QString::fromLatin1("?ASlink-Error-<cannot open> : \"foo.rel\"\n") << QString::fromLatin1("?ASlink-Error-<cannot open> : \"foo.rel\"\n")
<< (Tasks() << Task(Task::Error, << (Tasks() << Task(Task::Error,
QLatin1String("<cannot open> : \"foo.rel\""), "<cannot open> : \"foo.rel\"",
Utils::FilePath(), Utils::FilePath(),
-1, -1,
categoryCompile)) categoryCompile))