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 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;
}

View File

@@ -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());
}

View File

@@ -157,7 +157,7 @@ void DebugServerProviderModel::apply()
tr("The following providers were already configured:<br>"
"&nbsp;%1<br>"
"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()
: 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)

View File

@@ -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);

View File

@@ -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)

View File

@@ -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,7 +310,7 @@ 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"),
"Error in command line: Some error",
Utils::FilePath(),
-1,
categoryCompile))
@@ -322,7 +322,7 @@ void BareMetalPlugin::testIarOutputParsers_data()
<< QString::fromLatin1("Error[e46]: Some error\n")
<< QString()
<< (Tasks() << Task(Task::Error,
QLatin1String("[e46]: Some error"),
"[e46]: Some error",
Utils::FilePath(),
-1,
categoryCompile))
@@ -337,8 +337,8 @@ 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")),
"[Pe223]: Some warning \"foo\" bar",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -355,10 +355,10 @@ void BareMetalPlugin::testIarOutputParsers_data()
"\"c:\\foo\\main.c\",63 Warning[Pe223]:\n"
" Some warning\n")
<< (Tasks() << Task(Task::Warning,
QLatin1String("[Pe223]: Some warning\n"
"[Pe223]: Some warning\n"
" some_detail;\n"
" ^"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")),
" ^",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -373,8 +373,8 @@ 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")),
"[Pe223]: Some warning, split",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -387,8 +387,8 @@ 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")),
"[Pe223]: Some error",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -405,10 +405,10 @@ void BareMetalPlugin::testIarOutputParsers_data()
"\"c:\\foo\\main.c\",63 Error[Pe223]:\n"
" Some error\n")
<< (Tasks() << Task(Task::Error,
QLatin1String("[Pe223]: Some error\n"
"[Pe223]: Some error\n"
" some_detail;\n"
" ^"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")),
" ^",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -423,8 +423,8 @@ 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")),
"[Pe223]: Some error, split",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -441,8 +441,8 @@ 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")),
"[Li005]: Some error \"foo\"",
Utils::FilePath::fromUserInput("c:\\foo\\bar\\main.c.o"),
-1,
categoryCompile))
<< QString();
@@ -459,9 +459,9 @@ void BareMetalPlugin::testIarOutputParsers_data()
" c:\\bar.c\n"
"Fatal error detected, aborting.\n")
<< (Tasks() << Task(Task::Error,
QLatin1String("[Su011]: Some error:\n"
"[Su011]: Some error:\n"
" c:\\foo.c\n"
" c:\\bar.c"),
" c:\\bar.c",
Utils::FilePath(),
-1,
categoryCompile))
@@ -473,7 +473,7 @@ void BareMetalPlugin::testIarOutputParsers_data()
<< QString()
<< QString::fromLatin1("At end of source Error[Pe040]: Some error \";\"\n")
<< (Tasks() << Task(Task::Error,
QLatin1String("[Pe040]: Some error \";\""),
"[Pe040]: Some error \";\"",
Utils::FilePath(),
-1,
categoryCompile))

View File

@@ -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);
}
}

View File

@@ -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,8 +330,8 @@ 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")),
"#1234: Some warning",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -346,10 +346,10 @@ void BareMetalPlugin::testKeilOutputParsers_data()
" int f;\n"
" ^\n")
<< (Tasks() << Task(Task::Warning,
QLatin1String("#1234: Some warning\n"
"#1234: Some warning\n"
" int f;\n"
" ^"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")),
" ^",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -360,8 +360,8 @@ 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")),
"#1234: Some error",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -372,8 +372,8 @@ 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")),
"L1234: Some error",
Utils::FilePath::fromUserInput("flash.sct"),
51,
categoryCompile))
<< QString();
@@ -388,10 +388,10 @@ void BareMetalPlugin::testKeilOutputParsers_data()
" int f;\n"
" ^\n")
<< (Tasks() << Task(Task::Error,
QLatin1String("#1234: Some error\n"
"#1234: Some error\n"
" int f;\n"
" ^"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")),
" ^",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -402,8 +402,8 @@ 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")),
"#40: Some error",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
71,
categoryCompile))
<< QString();
@@ -414,7 +414,7 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString()
<< QString::fromLatin1("Error: L6226E: Some error.\n")
<< (Tasks() << Task(Task::Error,
QLatin1String("L6226E: Some error."),
"L6226E: Some error.",
Utils::FilePath(),
-1,
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()
<< (Tasks() << Task(Task::Warning,
QLatin1String("#A9: Some warning"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\dscr.a51")),
"#A9: Some warning",
Utils::FilePath::fromUserInput("c:\\foo\\dscr.a51"),
15,
categoryCompile))
<< 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()
<< (Tasks() << Task(Task::Error,
QLatin1String("#A9: Some error"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\dscr.a51")),
"#A9: Some error",
Utils::FilePath::fromUserInput("c:\\foo\\dscr.a51"),
15,
categoryCompile))
<< QString();
@@ -457,9 +457,9 @@ void BareMetalPlugin::testKeilOutputParsers_data()
" Some detail N\n")
<< QString()
<< (Tasks() << Task(Task::Error,
QLatin1String("Assembler fatal error\n"
"Assembler fatal error\n"
" Some detail 1\n"
" Some detail N"),
" Some detail N",
Utils::FilePath(),
-1,
categoryCompile))
@@ -475,10 +475,10 @@ 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"
"#A45: Some error\n"
" Some detail\n"
" ___^"),
Utils::FilePath::fromUserInput(QLatin1String("d:\\foo.a51")),
" ___^",
Utils::FilePath::fromUserInput("d:\\foo.a51"),
28,
categoryCompile))
<< QString();
@@ -490,8 +490,8 @@ 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")),
"C123: Some warning",
Utils::FilePath::fromUserInput("c:\\foo.c"),
13,
categoryCompile))
<< 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()
<< (Tasks() << Task(Task::Warning,
QLatin1String("C123: Some warning : 'extended text'"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")),
"C123: Some warning : 'extended text'",
Utils::FilePath::fromUserInput("c:\\foo.c"),
13,
categoryCompile))
<< QString();
@@ -514,8 +514,8 @@ 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")),
"C123: Some error",
Utils::FilePath::fromUserInput("c:\\foo.c"),
13,
categoryCompile))
<< 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()
<< (Tasks() << Task(Task::Error,
QLatin1String("C123: Some error : 'extended text'"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")),
"C123: Some error : 'extended text'",
Utils::FilePath::fromUserInput("c:\\foo.c"),
13,
categoryCompile))
<< QString();
@@ -542,9 +542,9 @@ void BareMetalPlugin::testKeilOutputParsers_data()
" Some detail N\n")
<< QString()
<< (Tasks() << Task(Task::Error,
QLatin1String("Compiler fatal error\n"
"Compiler fatal error\n"
" Some detail 1\n"
" Some detail N"),
" Some detail N",
Utils::FilePath(),
-1,
categoryCompile))
@@ -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,7 +572,7 @@ void BareMetalPlugin::testKeilOutputParsers_data()
<< QString::fromLatin1("*** FATAL ERROR L456: Some error\n")
<< QString()
<< (Tasks() << Task(Task::Error,
QLatin1String("L456: Some error"),
"L456: Some error",
Utils::FilePath(),
-1,
categoryCompile))
@@ -588,9 +588,9 @@ void BareMetalPlugin::testKeilOutputParsers_data()
" Some detail N\n")
<< QString()
<< (Tasks() << Task(Task::Error,
QLatin1String("L456: Some error\n"
"L456: Some error\n"
" Some detail 1\n"
" Some detail N"),
" Some detail N",
Utils::FilePath(),
-1,
categoryCompile))

View File

@@ -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,8 +214,8 @@ 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")),
"Some error",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -226,8 +226,8 @@ 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")),
"Some warning",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -242,10 +242,10 @@ void BareMetalPlugin::testSdccOutputParsers_data()
"details #1\n"
" details #2\n")
<< (Tasks() << Task(Task::Warning,
QLatin1String("Some warning\n"
"Some warning\n"
"details #1\n"
" details #2"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")),
" details #2",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -256,8 +256,8 @@ 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")),
"Some error",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -268,8 +268,8 @@ 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")),
"Some error",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -284,10 +284,10 @@ void BareMetalPlugin::testSdccOutputParsers_data()
"details #1\n"
" details #2\n")
<< (Tasks() << Task(Task::Error,
QLatin1String("Some error\n"
"Some error\n"
"details #1\n"
" details #2"),
Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")),
" details #2",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -298,8 +298,8 @@ 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")),
"Some error",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
63,
categoryCompile))
<< QString();
@@ -310,7 +310,7 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString()
<< QString::fromLatin1("at 1: error 123: Some error\n")
<< (Tasks() << Task(Task::Error,
QLatin1String("Some error"),
"Some error",
Utils::FilePath(),
-1,
categoryCompile))
@@ -322,7 +322,7 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString()
<< QString::fromLatin1("at 1: warning 123: Some warning\n")
<< (Tasks() << Task(Task::Warning,
QLatin1String("Some warning"),
"Some warning",
Utils::FilePath(),
-1,
categoryCompile))
@@ -334,7 +334,7 @@ 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'"),
"Couldn't find library 'foo.lib'",
Utils::FilePath(),
-1,
categoryCompile))
@@ -346,7 +346,7 @@ void BareMetalPlugin::testSdccOutputParsers_data()
<< QString()
<< QString::fromLatin1("?ASlink-Error-<cannot open> : \"foo.rel\"\n")
<< (Tasks() << Task(Task::Error,
QLatin1String("<cannot open> : \"foo.rel\""),
"<cannot open> : \"foo.rel\"",
Utils::FilePath(),
-1,
categoryCompile))