CErrorLogDialog: Make use of QStringLiteral where applicable

This commit is contained in:
Lioncash 2020-06-28 19:20:39 -04:00
parent 4aaf59be1a
commit 8ef246734a
1 changed files with 11 additions and 10 deletions

View File

@ -16,28 +16,29 @@ CErrorLogDialog::~CErrorLogDialog() = default;
bool CErrorLogDialog::GatherErrors()
{
const TStringList& rkErrors = NLog::GetErrorLog();
if (rkErrors.empty()) return false;
if (rkErrors.empty())
return false;
QString DialogString;
for (auto it = rkErrors.begin(); it != rkErrors.end(); it++)
for (const auto& rkError : rkErrors)
{
QString Error = TO_QSTRING(*it);
QString Error = TO_QSTRING(rkError);
QString LineColor;
if (Error.startsWith("ERROR: "))
LineColor = "#ff0000";
else if (Error.startsWith("Warning: "))
LineColor = "#ff8000";
if (Error.startsWith(QStringLiteral("ERROR: ")))
LineColor = QStringLiteral("#ff0000");
else if (Error.startsWith(QStringLiteral("Warning: ")))
LineColor = QStringLiteral("#ff8000");
QString FullLine = Error;
if (!LineColor.isEmpty())
{
FullLine.prepend(QString("<font color=\"%1\">").arg(LineColor));
FullLine.append("</font>");
FullLine.prepend(QStringLiteral("<font color=\"%1\">").arg(LineColor));
FullLine.append(QStringLiteral("</font>"));
}
FullLine.append("<br />");
FullLine.append(QStringLiteral("<br />"));
DialogString += FullLine;
}