summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-08-03 13:48:34 +0200
committerMontel Laurent <[email protected]>2015-08-03 13:48:34 +0200
commitc160d1fae2a08e96a8af2ac4ffbe30ba6a32411e (patch)
tree9b2d688f9edc0bc0253ffb0a43eb37526f0b1a7a
parent064aa56714e3509e1330753ec5eec99738682aec (diff)
Use QStringLiteral
-rw-r--r--calendarviews/agenda/agendaitem.cpp4
-rw-r--r--calendarviews/agenda/timelabels.cpp6
-rw-r--r--calendarviews/timespent/timespentview.cpp2
-rw-r--r--calendarviews/viewerapp/main.cpp4
-rw-r--r--messageviewer/adblock/adblockrulefallbackimpl.cpp28
-rw-r--r--messageviewer/adblock/adblockrulenullimpl.cpp30
-rw-r--r--messageviewer/adblock/adblocksettingwidget.cpp14
-rw-r--r--messageviewer/viewer/mimeparttree/mimetreemodel.cpp2
8 files changed, 45 insertions, 45 deletions
diff --git a/calendarviews/agenda/agendaitem.cpp b/calendarviews/agenda/agendaitem.cpp
index 0e199c0..185c0dc 100644
--- a/calendarviews/agenda/agendaitem.cpp
+++ b/calendarviews/agenda/agendaitem.cpp
@@ -1269,7 +1269,7 @@ void AgendaItem::drawRoundedRect(QPainter *p, const QRect &rect,
if (r.height() - 16 > 0) {
QPixmap leftLines;
- QString key(QLatin1String("ko_l"));
+ QString key(QStringLiteral("ko_l"));
if (!QPixmapCache::find(key, leftLines)) {
leftLines = QPixmap(QStringLiteral(":/leftLines.png"));
QPixmapCache::insert(key, leftLines);
@@ -1279,7 +1279,7 @@ void AgendaItem::drawRoundedRect(QPainter *p, const QRect &rect,
QBrush(leftLines));
QPixmap rightLines;
- key = QLatin1String("ko_r");
+ key = QStringLiteral("ko_r");
if (!QPixmapCache::find(key, rightLines)) {
rightLines = QPixmap(QStringLiteral(":/rightLines.png"));
QPixmapCache::insert(key, rightLines);
diff --git a/calendarviews/agenda/timelabels.cpp b/calendarviews/agenda/timelabels.cpp
index ab9f48e..c9739aa 100644
--- a/calendarviews/agenda/timelabels.cpp
+++ b/calendarviews/agenda/timelabels.cpp
@@ -203,11 +203,11 @@ void TimeLabels::paintEvent(QPaintEvent *)
// in some locale's
QString suffix;
if (!KLocale::global()->use12Clock()) {
- suffix = QLatin1String("00");
+ suffix = QStringLiteral("00");
} else {
- suffix = QLatin1String("am");
+ suffix = QStringLiteral("am");
if (cell > 11) {
- suffix = QLatin1String("pm");
+ suffix = QStringLiteral("pm");
}
}
diff --git a/calendarviews/timespent/timespentview.cpp b/calendarviews/timespent/timespentview.cpp
index 85619db..3791a5b 100644
--- a/calendarviews/timespent/timespentview.cpp
+++ b/calendarviews/timespent/timespentview.cpp
@@ -147,7 +147,7 @@ public:
QMapIterator<QString, int> i(secondsSpent);
QFontMetrics fm = p.fontMetrics();
- int lineHeight = fm.boundingRect(QLatin1String("No category")).height();
+ int lineHeight = fm.boundingRect(QStringLiteral("No category")).height();
int totalLineHeight = lineHeight + 2; // vertical margin included
while (i.hasNext())
diff --git a/calendarviews/viewerapp/main.cpp b/calendarviews/viewerapp/main.cpp
index bacb8a6..2fd9bee 100644
--- a/calendarviews/viewerapp/main.cpp
+++ b/calendarviews/viewerapp/main.cpp
@@ -29,7 +29,7 @@ static const char description[] = I18N_NOOP("A test app for embedding calendarvi
int main(int argc, char **argv)
{
- KAboutData about(QStringLiteral("viewerapp"), i18n("ViewerApp"), QLatin1String("0.1"), i18n(description),
+ KAboutData about(QStringLiteral("viewerapp"), i18n("ViewerApp"), QStringLiteral("0.1"), i18n(description),
KAboutLicense::GPL,
i18n("Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected]"));
about.addAuthor(i18n("Kevin Krammer"), QString(), QStringLiteral("[email protected]"));
@@ -41,7 +41,7 @@ int main(int argc, char **argv)
about.setupCommandLine(&parser);
parser.process(app);
about.processCommandLine(&parser);
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("+[viewname]"), i18n("Optional list of view names to instantiate")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("+[viewname]"), i18n("Optional list of view names to instantiate")));
QStringList viewNames;
for (int i = 0; i < parser.positionalArguments().count(); ++i) {
diff --git a/messageviewer/adblock/adblockrulefallbackimpl.cpp b/messageviewer/adblock/adblockrulefallbackimpl.cpp
index 6a146c8..4324310 100644
--- a/messageviewer/adblock/adblockrulefallbackimpl.cpp
+++ b/messageviewer/adblock/adblockrulefallbackimpl.cpp
@@ -59,22 +59,22 @@ AdBlockRuleFallbackImpl::AdBlockRuleFallbackImpl(const QString &filter)
QStringList options(parsedLine.mid(optionsNumber + 1).split(QLatin1Char(',')));
parsedLine = parsedLine.left(optionsNumber);
- if (options.removeOne(QLatin1String("match-case"))) {
+ if (options.removeOne(QStringLiteral("match-case"))) {
m_regExp.setCaseSensitivity(Qt::CaseSensitive);
}
- if (options.removeOne(QLatin1String("third-party"))) {
+ if (options.removeOne(QStringLiteral("third-party"))) {
m_thirdPartyOption = true;
}
- if (options.removeOne(QLatin1String("~third-party"))) {
+ if (options.removeOne(QStringLiteral("~third-party"))) {
m_thirdPartyOption = true;
m_thirdPartyOptionReversed = true;
}
Q_FOREACH (const QString &option, options) {
// Domain restricted filter
- const QString domainKeyword(QLatin1String("domain="));
+ const QString domainKeyword(QStringLiteral("domain="));
if (option.startsWith(domainKeyword)) {
options.removeOne(option);
const QStringList domainList = option.mid(domainKeyword.length()).split(QLatin1Char('|'));
@@ -148,34 +148,34 @@ QString AdBlockRuleFallbackImpl::convertPatternToRegExp(const QString &wildcardP
QString pattern = wildcardPattern;
// remove multiple wildcards
- pattern.replace(QRegExp(QLatin1String("\\*+")), QStringLiteral("*"));
+ pattern.replace(QRegExp(QStringLiteral("\\*+")), QStringLiteral("*"));
// remove anchors following separator placeholder
- pattern.replace(QRegExp(QLatin1String("\\^\\|$")), QStringLiteral("^"));
+ pattern.replace(QRegExp(QStringLiteral("\\^\\|$")), QStringLiteral("^"));
// remove leading wildcards
- pattern.replace(QRegExp(QLatin1String("^(\\*)")), QStringLiteral(""));
+ pattern.replace(QRegExp(QStringLiteral("^(\\*)")), QStringLiteral(""));
// remove trailing wildcards
- pattern.replace(QRegExp(QLatin1String("(\\*)$")), QStringLiteral(""));
+ pattern.replace(QRegExp(QStringLiteral("(\\*)$")), QStringLiteral(""));
// escape special symbols
- pattern.replace(QRegExp(QLatin1String("(\\W)")), QStringLiteral("\\\\1"));
+ pattern.replace(QRegExp(QStringLiteral("(\\W)")), QStringLiteral("\\\\1"));
// process extended anchor at expression start
- pattern.replace(QRegExp(QLatin1String("^\\\\\\|\\\\\\|")), QStringLiteral("^[\\w\\-]+:\\/+(?!\\/)(?:[^\\/]+\\.)?"));
+ pattern.replace(QRegExp(QStringLiteral("^\\\\\\|\\\\\\|")), QStringLiteral("^[\\w\\-]+:\\/+(?!\\/)(?:[^\\/]+\\.)?"));
// process separator placeholders
- pattern.replace(QRegExp(QLatin1String("\\\\\\^")), QStringLiteral("(?:[^\\w\\d\\-.%]|$)"));
+ pattern.replace(QRegExp(QStringLiteral("\\\\\\^")), QStringLiteral("(?:[^\\w\\d\\-.%]|$)"));
// process anchor at expression start
- pattern.replace(QRegExp(QLatin1String("^\\\\\\|")), QStringLiteral("^"));
+ pattern.replace(QRegExp(QStringLiteral("^\\\\\\|")), QStringLiteral("^"));
// process anchor at expression end
- pattern.replace(QRegExp(QLatin1String("\\\\\\|$")), QStringLiteral("$"));
+ pattern.replace(QRegExp(QStringLiteral("\\\\\\|$")), QStringLiteral("$"));
// replace wildcards by .*
- pattern.replace(QRegExp(QLatin1String("\\\\\\*")), QStringLiteral(".*"));
+ pattern.replace(QRegExp(QStringLiteral("\\\\\\*")), QStringLiteral(".*"));
// Finally, return...
return pattern;
diff --git a/messageviewer/adblock/adblockrulenullimpl.cpp b/messageviewer/adblock/adblockrulenullimpl.cpp
index 09bfeea..6125326 100644
--- a/messageviewer/adblock/adblockrulenullimpl.cpp
+++ b/messageviewer/adblock/adblockrulenullimpl.cpp
@@ -58,77 +58,77 @@ bool AdBlockRuleNullImpl::isNullFilter(const QString &filter)
// to check option && ~option. Hope it will NOT be a problem...
// third_party: managed inside adblockrulefallbackimpl
- if (option.endsWith(QLatin1String("third-party"))) {
+ if (option.endsWith(QStringLiteral("third-party"))) {
return false;
}
// script
- if (option.endsWith(QLatin1String("script"))) {
+ if (option.endsWith(QStringLiteral("script"))) {
return true;
}
// image
- if (option.endsWith(QLatin1String("image"))) {
+ if (option.endsWith(QStringLiteral("image"))) {
return true;
}
// background
- if (option.endsWith(QLatin1String("background"))) {
+ if (option.endsWith(QStringLiteral("background"))) {
return true;
}
// stylesheet
- if (option.endsWith(QLatin1String("stylesheet"))) {
+ if (option.endsWith(QStringLiteral("stylesheet"))) {
return true;
}
// object
- if (option.endsWith(QLatin1String("object"))) {
+ if (option.endsWith(QStringLiteral("object"))) {
return true;
}
// xbl
- if (option.endsWith(QLatin1String("xbl"))) {
+ if (option.endsWith(QStringLiteral("xbl"))) {
return true;
}
// ping
- if (option.endsWith(QLatin1String("ping"))) {
+ if (option.endsWith(QStringLiteral("ping"))) {
return true;
}
// xmlhttprequest
- if (option.endsWith(QLatin1String("xmlhttprequest"))) {
+ if (option.endsWith(QStringLiteral("xmlhttprequest"))) {
return true;
}
// object_subrequest
- if (option.endsWith(QLatin1String("object-subrequest"))) {
+ if (option.endsWith(QStringLiteral("object-subrequest"))) {
return true;
}
// dtd
- if (option.endsWith(QLatin1String("dtd"))) {
+ if (option.endsWith(QStringLiteral("dtd"))) {
return true;
}
// subdocument
- if (option.endsWith(QLatin1String("subdocument"))) {
+ if (option.endsWith(QStringLiteral("subdocument"))) {
return true;
}
// document
- if (option.endsWith(QLatin1String("document"))) {
+ if (option.endsWith(QStringLiteral("document"))) {
return true;
}
// other
- if (option.endsWith(QLatin1String("other"))) {
+ if (option.endsWith(QStringLiteral("other"))) {
return true;
}
// collapse
- if (option.endsWith(QLatin1String("collapse"))) {
+ if (option.endsWith(QStringLiteral("collapse"))) {
return true;
}
}
diff --git a/messageviewer/adblock/adblocksettingwidget.cpp b/messageviewer/adblock/adblocksettingwidget.cpp
index c63f499..a567908 100644
--- a/messageviewer/adblock/adblocksettingwidget.cpp
+++ b/messageviewer/adblock/adblocksettingwidget.cpp
@@ -259,8 +259,8 @@ void AdBlockSettingWidget::save()
saveSpinBox(spinBox, GlobalSettings::self()->adBlockUpdateIntervalItem());
// automatic filters
- KConfig config(QLatin1String("messagevieweradblockrc"));
- const QStringList list = config.groupList().filter(QRegExp(QLatin1String("FilterList \\d+")));
+ KConfig config(QStringLiteral("messagevieweradblockrc"));
+ const QStringList list = config.groupList().filter(QRegExp(QStringLiteral("FilterList \\d+")));
foreach (const QString &group, list) {
config.deleteGroup(group);
}
@@ -269,17 +269,17 @@ void AdBlockSettingWidget::save()
for (int i = 0; i < numberItem; ++i) {
QListWidgetItem *subItem = automaticFiltersListWidget->item(i);
KConfigGroup grp = config.group(QStringLiteral("FilterList %1").arg(i));
- grp.writeEntry(QLatin1String("FilterEnabled"), subItem->checkState() == Qt::Checked);
- grp.writeEntry(QLatin1String("url"), subItem->data(UrlList).toString());
- grp.writeEntry(QLatin1String("name"), subItem->text());
+ grp.writeEntry(QStringLiteral("FilterEnabled"), subItem->checkState() == Qt::Checked);
+ grp.writeEntry(QStringLiteral("url"), subItem->data(UrlList).toString());
+ grp.writeEntry(QStringLiteral("name"), subItem->text());
if (subItem->data(LastUpdateList).toDateTime().isValid()) {
- grp.writeEntry(QLatin1String("lastUpdate"), subItem->data(LastUpdateList).toDateTime());
+ grp.writeEntry(QStringLiteral("lastUpdate"), subItem->data(LastUpdateList).toDateTime());
}
QString path = subItem->data(PathList).toString();
if (path.isEmpty()) {
path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + QString::fromLatin1("kmail2/adblockrules-%1").arg(i);
}
- grp.writeEntry(QLatin1String("path"), path);
+ grp.writeEntry(QStringLiteral("path"), path);
}
config.sync();
diff --git a/messageviewer/viewer/mimeparttree/mimetreemodel.cpp b/messageviewer/viewer/mimeparttree/mimetreemodel.cpp
index 462c774..01e35f2 100644
--- a/messageviewer/viewer/mimeparttree/mimetreemodel.cpp
+++ b/messageviewer/viewer/mimeparttree/mimetreemodel.cpp
@@ -47,7 +47,7 @@ public:
Q_ASSERT(index.isValid());
QStringList ids = index.toString().split(QLatin1Char('.'));
const QString lastId = ids.takeLast();
- index = KMime::ContentIndex(ids.join(QLatin1String(".")));
+ index = KMime::ContentIndex(ids.join(QStringLiteral(".")));
return lastId.toInt();
}