From kde-commits Fri Mar 31 21:56:22 2017 From: Thomas Fischer Date: Fri, 31 Mar 2017 21:56:22 +0000 To: kde-commits Subject: [kbibtex] src/program/docklets: Add 'QStringLiteral' around raw char strings Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=149099748215530 Git commit 499f026249f3f6b5364055d3ec45d346eb8daf2b by Thomas Fischer. Committed on 31/03/2017 at 21:43. Pushed by thomasfischer into branch 'master'. Add 'QStringLiteral' around raw char strings M +9 -9 src/program/docklets/referencepreview.cpp https://commits.kde.org/kbibtex/499f026249f3f6b5364055d3ec45d346eb8daf2b diff --git a/src/program/docklets/referencepreview.cpp b/src/program/dockle= ts/referencepreview.cpp index f306798d..a9e6ed77 100644 --- a/src/program/docklets/referencepreview.cpp +++ b/src/program/docklets/referencepreview.cpp @@ -108,8 +108,8 @@ public: configKeyName(QStringLiteral("Style")), file(nullptr), fileView(= nullptr), textColor(QApplication::palette().text().color()), defaultFontSize(QFontDatabase::systemFont(QFontDatabase::General= Font).pointSize()), - htmlStart("\n\n\n= \n\n"), - notAvailableMessage(htmlStart + "

" + i18n("No preview available") + "

= " + i18n("Reason:") + " %1

") { + htmlStart(QStringLiteral("\n\n\n\n\n")), + notAvailableMessage(htmlStart + QStringLiteral("

") + i18n("No preview available") + QStringLiteral("

=

") + i18n("Reason:") + QStringLiteral(" %1")) { QGridLayout *gridLayout =3D new QGridLayout(p); gridLayout->setMargin(0); gridLayout->setColumnStretch(0, 1); @@ -160,7 +160,7 @@ public: if (tempFile.open()) { QTextStream ts(&tempFile); ts.setCodec("utf-8"); - ts << QString(htmlText).replace(QRegExp("]+href=3D\"kbibt= ex:[^>]+>([^<]+)"), QStringLiteral("\\1")); + ts << QString(htmlText).replace(QRegExp(QStringLiteral("]= +href=3D\"kbibtex:[^>]+>([^<]+)")), QStringLiteral("\\1")); tempFile.close(); return true; } @@ -269,7 +269,7 @@ void ReferencePreview::renderHTML() exporter =3D exporterHTML; } else if (previewStyle.type =3D=3D QStringLiteral("xml") || previewSt= yle.type.endsWith(QStringLiteral("_xml"))) { crossRefHandling =3D merge; - const QString filename =3D previewStyle.style + ".xsl"; + const QString filename =3D previewStyle.style + QStringLiteral(".x= sl"); exporter =3D new FileExporterXSLT(QStandardPaths::locate(QStandard= Paths::GenericDataLocation, QStringLiteral("kbibtex/") + filename), this); } else qCWarning(LOG_KBIBTEX_PROGRAM) << "Don't know how to handle output= type " << previewStyle.type; @@ -338,13 +338,13 @@ void ReferencePreview::renderHTML() /// bibtex2html = /// remove "generated by" line from HTML code if BibTeX2HT= ML was used - text.remove(QRegExp("


.*

")); - text.remove(QRegExp("<[/]?(font)[^>]*>")); - QRegExp reTable("^.*"); + text.remove(QRegExp(QStringLiteral("

.*

"))); + text.remove(QRegExp(QStringLiteral("<[/]?(font)[^>]*>"))); + QRegExp reTable(QStringLiteral("^.*")); reTable.setMinimal(true); text.remove(reTable); - text.remove(QRegExp(".*$")); - QRegExp reAnchor("\\[ \\]"); + text.remove(QRegExp(QStringLiteral(".*$"))); + QRegExp reAnchor(QStringLiteral("\\[ \\]")); reAnchor.setMinimal(true); text.remove(reAnchor); =