[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdepim] knotes: Use QStringLiteral
From: Montel Laurent <montel () kde ! org>
Date: 2015-05-01 6:21:54
Message-ID: E1Yo4Kg-0005bM-OP () scm ! kde ! org
[Download RAW message or body]
Git commit 06a798a3f08ab52dc90db3d79325a76d33ac1bae by Montel Laurent.
Committed on 01/05/2015 at 06:10.
Pushed by mlaurent into branch 'master'.
Use QStringLiteral
M +3 -3 knotes/kontactplugin/knotes_plugin.cpp
M +1 -1 knotes/kontactplugin/knoteseditdialog.cpp
M +1 -1 knotes/kontactplugin/knotesiconview.cpp
M +6 -6 knotes/kontactplugin/summarywidget.cpp
M +54 -54 knotes/notes/knote.cpp
M +3 -3 knotes/print/knotegrantleeprint.cpp
M +1 -1 knotes/print/knoteprintobject.cpp
http://commits.kde.org/kdepim/06a798a3f08ab52dc90db3d79325a76d33ac1bae
diff --git a/knotes/kontactplugin/knotes_plugin.cpp \
b/knotes/kontactplugin/knotes_plugin.cpp index 4d45686..c605a45 100644
--- a/knotes/kontactplugin/knotes_plugin.cpp
+++ b/knotes/kontactplugin/knotes_plugin.cpp
@@ -60,12 +60,12 @@ KNotesPlugin::KNotesPlugin(KontactInterface::Core *core, const \
QVariantList &) : KontactInterface::Plugin(core, core, "knotes")
{
KNoteUtils::migrateToAkonadi();
- setComponentName(QLatin1String("knotes"), QLatin1String("knotes"));
+ setComponentName(QStringLiteral("knotes"), QStringLiteral("knotes"));
QAction *action =
- new QAction(QIcon::fromTheme(QLatin1String("knotes")),
+ new QAction(QIcon::fromTheme(QStringLiteral("knotes")),
i18nc("@action:inmenu", "New Popup Note..."), this);
- actionCollection()->addAction(QLatin1String("new_note"), action);
+ actionCollection()->addAction(QStringLiteral("new_note"), action);
connect(action, &QAction::triggered, this, &KNotesPlugin::slotNewNote);
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::SHIFT \
+ Qt::Key_N)); //action->setHelpText(
diff --git a/knotes/kontactplugin/knoteseditdialog.cpp \
b/knotes/kontactplugin/knoteseditdialog.cpp index 28b180a..4151edb 100644
--- a/knotes/kontactplugin/knoteseditdialog.cpp
+++ b/knotes/kontactplugin/knoteseditdialog.cpp
@@ -64,7 +64,7 @@ void KNoteEditDialog::init(bool readOnly)
setModal(true);
// this dialog is modal to prevent one from editing the same note twice
// in two different windows
- setComponentName(QLatin1String("knotes"), QLatin1String("knotes"));
+ setComponentName(QStringLiteral("knotes"), QStringLiteral("knotes"));
setXMLFile(QStringLiteral("knotesui.rc"));
QWidget *page = new QWidget(this);
diff --git a/knotes/kontactplugin/knotesiconview.cpp \
b/knotes/kontactplugin/knotesiconview.cpp index 693075e..9963bee 100644
--- a/knotes/kontactplugin/knotesiconview.cpp
+++ b/knotes/kontactplugin/knotesiconview.cpp
@@ -332,7 +332,7 @@ void KNotesIconViewItem::updateSettings()
KIconEffect effect;
const QColor color(mDisplayAttribute->backgroundColor());
if (mDefaultPixmap.isNull()) {
- mDefaultPixmap = KIconLoader::global()->loadIcon(QLatin1String("knotes"), \
KIconLoader::Desktop); + mDefaultPixmap = \
KIconLoader::global()->loadIcon(QStringLiteral("knotes"), KIconLoader::Desktop); }
QPixmap icon = effect.apply(mDefaultPixmap, KIconEffect::Colorize, 1, color, \
false); setFont(mDisplayAttribute->titleFont());
diff --git a/knotes/kontactplugin/summarywidget.cpp \
b/knotes/kontactplugin/summarywidget.cpp index a231e93..0e46c20 100644
--- a/knotes/kontactplugin/summarywidget.cpp
+++ b/knotes/kontactplugin/summarywidget.cpp
@@ -67,7 +67,7 @@ KNotesSummaryWidget::KNotesSummaryWidget(KontactInterface::Plugin \
*plugin, QWidg mainLayout->setSpacing(3);
mainLayout->setMargin(3);
- QWidget *header = createHeader(this, QLatin1String("view-pim-notes"), \
i18n("Popup Notes")); + QWidget *header = createHeader(this, \
QStringLiteral("view-pim-notes"), i18n("Popup Notes")); \
mainLayout->addWidget(header);
mLayout = new QGridLayout();
@@ -75,9 +75,9 @@ KNotesSummaryWidget::KNotesSummaryWidget(KontactInterface::Plugin \
*plugin, QWidg mLayout->setSpacing(3);
mLayout->setRowStretch(6, 1);
- KIconLoader loader(QLatin1String("knotes"));
+ KIconLoader loader(QStringLiteral("knotes"));
- mPixmap = loader.loadIcon(QLatin1String("knotes"), KIconLoader::Small);
+ mPixmap = loader.loadIcon(QStringLiteral("knotes"), KIconLoader::Small);
Akonadi::Session *session = new Akonadi::Session("KNotes Session", this);
mNoteRecorder = new NoteShared::NotesChangeRecorder(this);
@@ -169,7 +169,7 @@ void KNotesSummaryWidget::slotPopupMenu(const QString ¬e)
void KNotesSummaryWidget::deleteNote(const QString ¬e)
{
- org::kde::kontact::KNotes knotes(QLatin1String("org.kde.kontact"), \
QLatin1String("/KNotes"), QDBusConnection::sessionBus()); + \
org::kde::kontact::KNotes knotes(QStringLiteral("org.kde.kontact"), \
QStringLiteral("/KNotes"), QDBusConnection::sessionBus()); \
knotes.killNote(note.toLongLong()); }
@@ -225,7 +225,7 @@ void KNotesSummaryWidget::slotSelectNote(const QString ¬e)
} else {
mPlugin->bringToForeground();
}
- org::kde::kontact::KNotes knotes(QLatin1String("org.kde.kontact"), \
QLatin1String("/KNotes"), QDBusConnection::sessionBus()); + \
org::kde::kontact::KNotes knotes(QStringLiteral("org.kde.kontact"), \
QStringLiteral("/KNotes"), QDBusConnection::sessionBus()); \
knotes.editNote(note.toLongLong()); }
@@ -245,5 +245,5 @@ bool KNotesSummaryWidget::eventFilter(QObject *obj, QEvent *e)
QStringList KNotesSummaryWidget::configModules() const
{
- return QStringList() << QLatin1String("kcmknotessummary.desktop");
+ return QStringList() << QStringLiteral("kcmknotessummary.desktop");
}
diff --git a/knotes/notes/knote.cpp b/knotes/notes/knote.cpp
index 625aca3..63d7571 100644
--- a/knotes/notes/knote.cpp
+++ b/knotes/notes/knote.cpp
@@ -95,7 +95,7 @@ KNote::KNote(const QDomDocument &buildDoc, const Akonadi::Item \
&item, bool allow m_button(Q_NULLPTR),
m_tool(Q_NULLPTR),
m_editor(Q_NULLPTR),
- m_kwinConf(KSharedConfig::openConfig(QLatin1String("kwinrc"))),
+ m_kwinConf(KSharedConfig::openConfig(QStringLiteral("kwinrc"))),
mDisplayAttribute(new KNoteDisplaySettings),
mAllowDebugBaloo(allowDebugBaloo)
{
@@ -326,26 +326,26 @@ void KNote::slotUpdateReadOnly()
}
// enable/disable actions accordingly
- actionCollection()->action(QLatin1String("configure_note"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("delete_note"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_bold"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_italic"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_underline"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_strikeout"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_alignleft"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_aligncenter"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_alignright"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_alignblock"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_list"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_super"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_sub"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_increaseindent"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_decreaseindent"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("text_background_color"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_size"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("format_color"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("rename_note"))->setEnabled(!readOnly);
- actionCollection()->action(QLatin1String("set_alarm"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("configure_note"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("delete_note"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_bold"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_italic"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_underline"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_strikeout"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_alignleft"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_aligncenter"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_alignright"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_alignblock"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_list"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_super"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_sub"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_increaseindent"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_decreaseindent"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("text_background_color"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_size"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("format_color"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("rename_note"))->setEnabled(!readOnly);
+ actionCollection()->action(QStringLiteral("set_alarm"))->setEnabled(!readOnly);
m_keepAbove->setEnabled(!readOnly);
m_keepBelow->setEnabled(!readOnly);
@@ -685,8 +685,8 @@ void KNote::buildGui()
KXMLGUIFactory factory(&builder, this);
factory.addClient(this);
- m_menu = dynamic_cast<QMenu *>(factory.container(QLatin1String("note_context"), \
this));
- m_tool = dynamic_cast<KToolBar *>(factory.container(QLatin1String("note_tool"), \
this)); + m_menu = dynamic_cast<QMenu \
*>(factory.container(QStringLiteral("note_context"), this)); + m_tool = \
dynamic_cast<KToolBar *>(factory.container(QStringLiteral("note_tool"), this));
createNoteFooter();
}
@@ -697,68 +697,68 @@ void KNote::createActions()
// rename, mail, print, save as, insert date, alarm, close, delete, new note
QAction *action;
- action = new QAction(QIcon::fromTheme(QLatin1String("document-new")), \
i18n("New"), this);
- actionCollection()->addAction(QLatin1String("new_note"), action);
+ action = new QAction(QIcon::fromTheme(QStringLiteral("document-new")), \
i18n("New"), this); + actionCollection()->addAction(QStringLiteral("new_note"), \
action);
connect(action, &QAction::triggered, this, &KNote::slotRequestNewNote);
- action = new QAction(QIcon::fromTheme(QLatin1String("edit-rename")), \
i18n("Rename..."), this);
- actionCollection()->addAction(QLatin1String("rename_note"), action);
+ action = new QAction(QIcon::fromTheme(QStringLiteral("edit-rename")), \
i18n("Rename..."), this); + \
actionCollection()->addAction(QStringLiteral("rename_note"), action); \
connect(action, &QAction::triggered, this, &KNote::slotRename);
- m_readOnly = new \
KToggleAction(QIcon::fromTheme(QLatin1String("object-locked")), + m_readOnly = \
new KToggleAction(QIcon::fromTheme(QStringLiteral("object-locked")), i18n("Lock"), \
this);
- actionCollection()->addAction(QLatin1String("lock_note"), m_readOnly);
+ actionCollection()->addAction(QStringLiteral("lock_note"), m_readOnly);
connect(m_readOnly, &KToggleAction::triggered, this, \
&KNote::slotUpdateReadOnly);
- m_readOnly->setCheckedState(KGuiItem(i18n("Unlock"), \
QLatin1String("object-unlocked"))); + \
m_readOnly->setCheckedState(KGuiItem(i18n("Unlock"), \
QStringLiteral("object-unlocked")));
- action = new QAction(QIcon::fromTheme(QLatin1String("window-close")), \
i18n("Hide"), this);
- actionCollection()->addAction(QLatin1String("hide_note"), action);
+ action = new QAction(QIcon::fromTheme(QStringLiteral("window-close")), \
i18n("Hide"), this); + actionCollection()->addAction(QStringLiteral("hide_note"), \
action); connect(action, &QAction::triggered, this, &KNote::slotClose);
action->setShortcut(QKeySequence(Qt::Key_Escape));
- action = new QAction(QIcon::fromTheme(QLatin1String("edit-delete")), \
i18n("Delete"), this);
- actionCollection()->addAction(QLatin1String("delete_note"), action);
+ action = new QAction(QIcon::fromTheme(QStringLiteral("edit-delete")), \
i18n("Delete"), this); + \
actionCollection()->addAction(QStringLiteral("delete_note"), action); \
connect(action, &QAction::triggered, this, &KNote::slotKill);
- action = new QAction(QIcon::fromTheme(QLatin1String("knotes_alarm")), i18n("Set \
Alarm..."), + action = new \
QAction(QIcon::fromTheme(QStringLiteral("knotes_alarm")), i18n("Set Alarm..."), \
this);
- actionCollection()->addAction(QLatin1String("set_alarm"), action);
+ actionCollection()->addAction(QStringLiteral("set_alarm"), action);
connect(action, &QAction::triggered, this, &KNote::slotSetAlarm);
- action = new QAction(QIcon::fromTheme(QLatin1String("network-wired")), \
i18n("Send..."), this);
- actionCollection()->addAction(QLatin1String("send_note"), action);
+ action = new QAction(QIcon::fromTheme(QStringLiteral("network-wired")), \
i18n("Send..."), this); + \
actionCollection()->addAction(QStringLiteral("send_note"), action); connect(action, \
&QAction::triggered, this, &KNote::slotSend);
- action = new QAction(QIcon::fromTheme(QLatin1String("mail-send")), \
i18n("Mail..."), this);
- actionCollection()->addAction(QLatin1String("mail_note"), action);
+ action = new QAction(QIcon::fromTheme(QStringLiteral("mail-send")), \
i18n("Mail..."), this); + \
actionCollection()->addAction(QStringLiteral("mail_note"), action); connect(action, \
&QAction::triggered, this, &KNote::slotMail);
- action = new QAction(QIcon::fromTheme(QLatin1String("document-save-as")), \
i18n("Save As..."), + action = new \
QAction(QIcon::fromTheme(QStringLiteral("document-save-as")), i18n("Save As..."), \
this);
- actionCollection()->addAction(QLatin1String("save_note"), action);
+ actionCollection()->addAction(QStringLiteral("save_note"), action);
connect(action, &QAction::triggered, this, &KNote::slotSaveAs);
- actionCollection()->addAction(KStandardAction::Print, \
QLatin1String("print_note"), this, SLOT(slotPrint())); + \
actionCollection()->addAction(KStandardAction::Print, QStringLiteral("print_note"), \
this, SLOT(slotPrint()));
if (KPrintPreview::isAvailable()) {
- actionCollection()->addAction(KStandardAction::PrintPreview, \
QLatin1String("print_preview_note"), this, SLOT(slotPrintPreview())); + \
actionCollection()->addAction(KStandardAction::PrintPreview, \
QStringLiteral("print_preview_note"), this, SLOT(slotPrintPreview())); }
- action = new QAction(QIcon::fromTheme(QLatin1String("configure")), \
i18n("Preferences..."), this);
- actionCollection()->addAction(QLatin1String("configure_note"), action);
+ action = new QAction(QIcon::fromTheme(QStringLiteral("configure")), \
i18n("Preferences..."), this); + \
actionCollection()->addAction(QStringLiteral("configure_note"), action); \
connect(action, &QAction::triggered, this, &KNote::slotPreferences);
- m_keepAbove = new KToggleAction(QIcon::fromTheme(QLatin1String("go-up")),
+ m_keepAbove = new KToggleAction(QIcon::fromTheme(QStringLiteral("go-up")),
i18n("Keep Above Others"), this);
- actionCollection()->addAction(QLatin1String("keep_above"), m_keepAbove);
+ actionCollection()->addAction(QStringLiteral("keep_above"), m_keepAbove);
connect(m_keepAbove, &KToggleAction::triggered, this, &KNote::slotKeepAbove);
- m_keepBelow = new KToggleAction(QIcon::fromTheme(QLatin1String("go-down")),
+ m_keepBelow = new KToggleAction(QIcon::fromTheme(QStringLiteral("go-down")),
i18n("Keep Below Others"), this);
- actionCollection()->addAction(QLatin1String("keep_below"), m_keepBelow);
+ actionCollection()->addAction(QStringLiteral("keep_below"), m_keepBelow);
connect(m_keepBelow, &KToggleAction::triggered, this, &KNote::slotKeepBelow);
#if KDEPIM_HAVE_X11
m_toDesktop = new KSelectAction(i18n("To Desktop"), this);
- actionCollection()->addAction(QLatin1String("to_desktop"), m_toDesktop);
+ actionCollection()->addAction(QStringLiteral("to_desktop"), m_toDesktop);
connect(m_toDesktop, static_cast<void \
(KSelectAction::*)(int)>(&KSelectAction::triggered), this, \
&KNote::slotPopupActionToDesktop);
connect(m_toDesktop->menu(), SIGNAL(aboutToShow()), \
SLOT(slotUpdateDesktopActions())); // initially populate it, otherwise stays \
disabled @@ -766,7 +766,7 @@ void KNote::createActions()
#endif
// invisible action to walk through the notes to make this configurable
action = new QAction(i18n("Walk Through Notes"), this);
- actionCollection()->addAction(QLatin1String("walk_notes"), action);
+ actionCollection()->addAction(QStringLiteral("walk_notes"), action);
connect(action, &QAction::triggered, this, &KNote::sigShowNextNote);
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::SHIFT + \
Qt::Key_Backtab));
@@ -776,8 +776,8 @@ void KNote::createActions()
}
if (mAllowDebugBaloo) {
//Don't translate it it's just for debugging
- action = new QAction(QLatin1String("Debug Baloo..."), this);
- actionCollection()->addAction(QLatin1String("debug_baloo"), action);
+ action = new QAction(QStringLiteral("Debug Baloo..."), this);
+ actionCollection()->addAction(QStringLiteral("debug_baloo"), action);
connect(action, &QAction::triggered, this, &KNote::slotDebugBaloo);
}
}
diff --git a/knotes/print/knotegrantleeprint.cpp \
b/knotes/print/knotegrantleeprint.cpp index 22b5751..580efd1 100644
--- a/knotes/print/knotegrantleeprint.cpp
+++ b/knotes/print/knotegrantleeprint.cpp
@@ -71,9 +71,9 @@ QString KNoteGrantleePrint::notesToHtml(const \
QList<KNotePrintObject *> lst) notes << QVariant::fromValue(static_cast<QObject \
*>(n)); }
Grantlee::Context c;
- c.insert(QLatin1String("notes"), notes);
- c.insert(QLatin1String("alarm_i18n"), i18n("Alarm:"));
- c.insert(QLatin1String("note_is_locked_i18n"), i18n("Note is locked"));
+ c.insert(QStringLiteral("notes"), notes);
+ c.insert(QStringLiteral("alarm_i18n"), i18n("Alarm:"));
+ c.insert(QStringLiteral("note_is_locked_i18n"), i18n("Note is locked"));
const QString htmlText = mSelfcontainedTemplate->render(&c);
return htmlText;
diff --git a/knotes/print/knoteprintobject.cpp b/knotes/print/knoteprintobject.cpp
index 292d36a..074edfc 100644
--- a/knotes/print/knoteprintobject.cpp
+++ b/knotes/print/knoteprintobject.cpp
@@ -41,7 +41,7 @@ QString KNotePrintObject::description() const
if (noteMessage->contentType()->isHTMLText()) {
return noteMessage->mainBodyPart()->decodedText();
} else {
- return noteMessage->mainBodyPart()->decodedText().replace(QLatin1Char('\n'), \
QLatin1String("<br>")); + return \
noteMessage->mainBodyPart()->decodedText().replace(QLatin1Char('\n'), \
QStringLiteral("<br>")); }
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic