Commit 990918e3 authored by Laurent Montel's avatar Laurent Montel 😁

Use QStringLiteral

parent 8737eaac
......@@ -286,7 +286,7 @@ void TagPropertiesDialog::slotAccept()
"WHERE ");
QStringList conds;
for (int i = 0; i < mRemovedRIDs.count(); ++i) {
conds << QLatin1String("name = ?");
conds << QStringLiteral("name = ?");
}
queryStr += conds.join(QLatin1String(" OR ")) + QLatin1String(")");
query.prepare(queryStr);
......@@ -308,7 +308,7 @@ void TagPropertiesDialog::slotAccept()
QString queryStr = QLatin1String("SELECT id, name FROM ResourceTable WHERE ");
QStringList conds;
for (int i = 0; i < mChangedRIDs.count(); ++i) {
conds << QLatin1String("name = ?");
conds << QStringLiteral("name = ?");
}
queryStr += conds.join(QLatin1String(" OR "));
query.prepare(queryStr);
......
......@@ -468,29 +468,29 @@ bool Akregator::Feed::isArticlesLoaded() const
QDomElement Akregator::Feed::toOPML(QDomElement parent, QDomDocument document) const
{
QDomElement el = document.createElement(QLatin1String("outline"));
el.setAttribute(QLatin1String("text"), title());
el.setAttribute(QLatin1String("title"), title());
el.setAttribute(QLatin1String("xmlUrl"), d->xmlUrl);
el.setAttribute(QLatin1String("htmlUrl"), d->htmlUrl);
el.setAttribute(QLatin1String("id"), QString::number(id()));
el.setAttribute(QLatin1String("description"), d->description);
el.setAttribute(QLatin1String("useCustomFetchInterval"), (useCustomFetchInterval() ? QLatin1String("true") : QLatin1String("false")));
el.setAttribute(QLatin1String("fetchInterval"), QString::number(fetchInterval()));
el.setAttribute(QLatin1String("archiveMode"), archiveModeToString(d->archiveMode));
el.setAttribute(QLatin1String("maxArticleAge"), d->maxArticleAge);
el.setAttribute(QLatin1String("maxArticleNumber"), d->maxArticleNumber);
el.setAttribute(QStringLiteral("text"), title());
el.setAttribute(QStringLiteral("title"), title());
el.setAttribute(QStringLiteral("xmlUrl"), d->xmlUrl);
el.setAttribute(QStringLiteral("htmlUrl"), d->htmlUrl);
el.setAttribute(QStringLiteral("id"), QString::number(id()));
el.setAttribute(QStringLiteral("description"), d->description);
el.setAttribute(QStringLiteral("useCustomFetchInterval"), (useCustomFetchInterval() ? QLatin1String("true") : QLatin1String("false")));
el.setAttribute(QStringLiteral("fetchInterval"), QString::number(fetchInterval()));
el.setAttribute(QStringLiteral("archiveMode"), archiveModeToString(d->archiveMode));
el.setAttribute(QStringLiteral("maxArticleAge"), d->maxArticleAge);
el.setAttribute(QStringLiteral("maxArticleNumber"), d->maxArticleNumber);
if (d->markImmediatelyAsRead) {
el.setAttribute(QLatin1String("markImmediatelyAsRead"), QLatin1String("true"));
el.setAttribute(QStringLiteral("markImmediatelyAsRead"), QLatin1String("true"));
}
if (d->useNotification) {
el.setAttribute(QLatin1String("useNotification"), QLatin1String("true"));
el.setAttribute(QStringLiteral("useNotification"), QLatin1String("true"));
}
if (d->loadLinkedWebsite) {
el.setAttribute(QLatin1String("loadLinkedWebsite"), QLatin1String("true"));
el.setAttribute(QStringLiteral("loadLinkedWebsite"), QLatin1String("true"));
}
el.setAttribute(QLatin1String("maxArticleNumber"), d->maxArticleNumber);
el.setAttribute(QLatin1String("type"), QLatin1String("rss")); // despite some additional fields, it is still "rss" OPML
el.setAttribute(QLatin1String("version"), QLatin1String("RSS"));
el.setAttribute(QStringLiteral("maxArticleNumber"), d->maxArticleNumber);
el.setAttribute(QStringLiteral("type"), QLatin1String("rss")); // despite some additional fields, it is still "rss" OPML
el.setAttribute(QStringLiteral("version"), QLatin1String("RSS"));
parent.appendChild(el);
return el;
}
......
......@@ -362,7 +362,7 @@ QDomDocument FeedList::toOpml() const
doc.appendChild(doc.createProcessingInstruction(QLatin1String("xml"), QLatin1String("version=\"1.0\" encoding=\"UTF-8\"")));
QDomElement root = doc.createElement(QLatin1String("opml"));
root.setAttribute(QLatin1String("version"), QLatin1String("1.0"));
root.setAttribute(QStringLiteral("version"), QLatin1String("1.0"));
doc.appendChild(root);
QDomElement head = doc.createElement(QLatin1String("head"));
......
......@@ -89,7 +89,7 @@ QStringList KCalModel::mimeTypes() const
{
return
QStringList()
<< QLatin1String("text/uri-list")
<< QStringLiteral("text/uri-list")
<< d->allMimeTypes();
}
......
......@@ -883,7 +883,7 @@ QDebug operator<<(QDebug s, const Node::Ptr &node)
static int level = 0;
++level;
QString padding = QString(level - 1, QLatin1Char(' '));
s << padding + QLatin1String("node") << node.data() << QLatin1String(";uid=") << node->uid << QLatin1String(";id=") << node->id << QLatin1String(";parentUid=") << node->parentUid << QLatin1String(";parentNode=") << (void *)(node->parentNode.data()) << '\n';
s << padding + QLatin1String("node") << node.data() << QStringLiteral(";uid=") << node->uid << QStringLiteral(";id=") << node->id << QStringLiteral(";parentUid=") << node->parentUid << QStringLiteral(";parentNode=") << (void *)(node->parentNode.data()) << '\n';
foreach (const Node::Ptr &child, node->directChilds) {
s << child;
......
......@@ -101,32 +101,32 @@ void ComposerImageDialogPrivate::updateImageHtml()
imageHeight = imageWidget->imageHeight();
}
if (imageWidth == -1) {
webElement.removeAttribute(QLatin1String("width"));
webElement.removeAttribute(QStringLiteral("width"));
} else {
webElement.setAttribute(QLatin1String("width"), QString::number(imageWidth));
webElement.setAttribute(QStringLiteral("width"), QString::number(imageWidth));
}
if (imageHeight == -1) {
webElement.removeAttribute(QLatin1String("height"));
webElement.removeAttribute(QStringLiteral("height"));
} else {
webElement.setAttribute(QLatin1String("height"), QString::number(imageHeight));
webElement.setAttribute(QStringLiteral("height"), QString::number(imageHeight));
}
QString str(title->text());
if (str.isEmpty()) {
webElement.removeAttribute(QLatin1String("title"));
webElement.removeAttribute(QStringLiteral("title"));
} else {
webElement.setAttribute(QLatin1String("title"), str);
webElement.setAttribute(QStringLiteral("title"), str);
}
str = alternateTitle->text();
if (str.isEmpty()) {
webElement.removeAttribute(QLatin1String("alt"));
webElement.removeAttribute(QStringLiteral("alt"));
} else {
webElement.setAttribute(QLatin1String("alt"), str);
webElement.setAttribute(QStringLiteral("alt"), str);
}
webElement.setAttribute(QLatin1String("src"), imageWidget->imageUrl().url());
webElement.setAttribute(QStringLiteral("src"), imageWidget->imageUrl().url());
}
void ComposerImageDialogPrivate::initialize()
......
......@@ -264,13 +264,13 @@ void ComposerViewPrivate::createAction(ComposerView::ComposerViewAction type)
action_font_size = new KSelectAction(i18nc("@action", "Font &Size"), q);
htmlEditorActionList.append(action_font_size);
QStringList sizes;
sizes << QLatin1String("xx-small");
sizes << QLatin1String("x-small");
sizes << QLatin1String("small");
sizes << QLatin1String("medium");
sizes << QLatin1String("large");
sizes << QLatin1String("x-large");
sizes << QLatin1String("xx-large");
sizes << QStringLiteral("xx-small");
sizes << QStringLiteral("x-small");
sizes << QStringLiteral("small");
sizes << QStringLiteral("medium");
sizes << QStringLiteral("large");
sizes << QStringLiteral("x-large");
sizes << QStringLiteral("xx-large");
action_font_size->setItems(sizes);
action_font_size->setCurrentItem(0);
q->connect(action_font_size, SIGNAL(triggered(int)), q, SLOT(_k_setFontSize(int)));
......
......@@ -98,19 +98,19 @@ public:
void ComposerTableActionMenuPrivate::_k_slotSplitCell()
{
if (webElement.hasAttribute(QLatin1String("colspan"))) {
webElement.removeAttribute(QLatin1String("colspan"));
webElement.removeAttribute(QStringLiteral("colspan"));
}
if (webElement.hasAttribute(QLatin1String("rowspan"))) {
webElement.removeAttribute(QLatin1String("rowspan"));
webElement.removeAttribute(QStringLiteral("rowspan"));
}
}
void ComposerTableActionMenuPrivate::_k_slotMergeCellToTheRight()
{
if (webElement.hasAttribute(QLatin1String("colspan"))) {
webElement.setAttribute(QLatin1String("colspan"), QString::number(webElement.attribute(QLatin1String("colspan")).toInt() + 1));
webElement.setAttribute(QStringLiteral("colspan"), QString::number(webElement.attribute(QLatin1String("colspan")).toInt() + 1));
} else {
webElement.setAttribute(QLatin1String("colspan"), QString::number(2));
webElement.setAttribute(QStringLiteral("colspan"), QString::number(2));
}
}
......
......@@ -195,32 +195,32 @@ void ComposerTableCellFormatDialogPrivate::applyChanges()
if (useBackgroundColor->isChecked()) {
const QColor col = backgroundColor->color();
if (col.isValid()) {
webElement.setAttribute(QLatin1String("bgcolor"), col.name());
webElement.setAttribute(QStringLiteral("bgcolor"), col.name());
}
} else {
webElement.removeAttribute(QLatin1String("bgcolor"));
webElement.removeAttribute(QStringLiteral("bgcolor"));
}
if (useVerticalAlignment->isChecked()) {
webElement.setAttribute(QLatin1String("valign"), verticalAlignment->itemData(verticalAlignment->currentIndex()).toString());
webElement.setAttribute(QStringLiteral("valign"), verticalAlignment->itemData(verticalAlignment->currentIndex()).toString());
} else {
webElement.removeAttribute(QLatin1String("valign"));
webElement.removeAttribute(QStringLiteral("valign"));
}
if (useHorizontalAlignment->isChecked()) {
webElement.setAttribute(QLatin1String("align"), horizontalAlignment->itemData(horizontalAlignment->currentIndex()).toString());
webElement.setAttribute(QStringLiteral("align"), horizontalAlignment->itemData(horizontalAlignment->currentIndex()).toString());
} else {
webElement.removeAttribute(QLatin1String("align"));
webElement.removeAttribute(QStringLiteral("align"));
}
const QString widthStr = width->value();
if (widthStr.isEmpty()) {
webElement.removeAttribute(QLatin1String("width"));
webElement.removeAttribute(QStringLiteral("width"));
} else {
webElement.setAttribute(QLatin1String("width"), widthStr);
webElement.setAttribute(QStringLiteral("width"), widthStr);
}
const QString heightStr = height->value();
if (heightStr.isEmpty()) {
webElement.removeAttribute(QLatin1String("height"));
webElement.removeAttribute(QStringLiteral("height"));
} else {
webElement.setAttribute(QLatin1String("height"), heightStr);
webElement.setAttribute(QStringLiteral("height"), heightStr);
}
}
}
......
......@@ -71,16 +71,16 @@ void ComposerTableFormatDialogPrivate::_k_slotWebElementChanged()
void ComposerTableFormatDialogPrivate::applyChanges()
{
if (!webElement.isNull()) {
webElement.setAttribute(QLatin1String("border"), QString::number(insertTableWidget->border()));
webElement.setAttribute(QStringLiteral("border"), QString::number(insertTableWidget->border()));
const QString width = QStringLiteral("%1%2").arg(insertTableWidget->length()).arg(insertTableWidget->typeOfLength() == QTextLength::PercentageLength ? QLatin1String("%") : QString());
webElement.setAttribute(QLatin1String("width"), width);
webElement.setAttribute(QStringLiteral("width"), width);
if (useBackgroundColor->isChecked()) {
const QColor col = backgroundColor->color();
if (col.isValid()) {
webElement.setAttribute(QLatin1String("bgcolor"), backgroundColor->color().name());
webElement.setAttribute(QStringLiteral("bgcolor"), backgroundColor->color().name());
}
} else {
webElement.removeAttribute(QLatin1String("bgcolor"));
webElement.removeAttribute(QStringLiteral("bgcolor"));
}
//TODO update column/row
}
......
......@@ -82,7 +82,7 @@ bool KonsoleKalendar::printCalendarList()
{
Akonadi::CollectionFetchJob *job = new Akonadi::CollectionFetchJob(Akonadi::Collection::root(),
Akonadi::CollectionFetchJob::Recursive);
QStringList mimeTypes = QStringList() << QLatin1String("text/calendar")
QStringList mimeTypes = QStringList() << QStringLiteral("text/calendar")
<< KCalCore::Event::eventMimeType()
<< KCalCore::Todo::todoMimeType()
<< KCalCore::Journal::journalMimeType();
......
......@@ -1433,7 +1433,7 @@ bool Private::startKMailMinimised()
// We are not using KApplication, so the env remained set.
KStartupInfoId id = KStartupInfo::currentStartupIdEnv();
KProcess* proc = new KProcess;
(*proc) << QLatin1String("kmail");
(*proc) << QStringLiteral("kmail");
int pid = proc->startDetached();
if (!pid)
{
......
......@@ -166,7 +166,7 @@ int KAMail::send(JobData& jobdata, QStringList& errmsgs)
if (!transport)
{
QStringList paths;
paths << QLatin1String("/sbin") << QLatin1String("/usr/sbin") << QLatin1String("/usr/lib");
paths << QStringLiteral("/sbin") << QStringLiteral("/usr/sbin") << QStringLiteral("/usr/lib");
QString command = QStandardPaths::findExecutable(QLatin1String("sendmail"), paths);
transport = manager->createTransport();
transport->setName(QLatin1String("sendmail"));
......
......@@ -59,7 +59,7 @@ bool ShellProcess::start(OpenMode openMode)
connect(this, SIGNAL(readyReadStandardOutput()), SLOT(stdoutReady()));
connect(this, SIGNAL(readyReadStandardError()), SLOT(stderrReady()));
QStringList args;
args << QLatin1String("-c") << mCommand;
args << QStringLiteral("-c") << mCommand;
QProcess::start(QLatin1String(shellName()), args, openMode);
if (!waitForStarted())
{
......
......@@ -420,133 +420,133 @@ void MainWindow::initActions()
KActionCollection* actions = actionCollection();
mActionTemplates = new QAction(i18nc("@action", "&Templates..."), this);
actions->addAction(QLatin1String("templates"), mActionTemplates);
actions->addAction(QStringLiteral("templates"), mActionTemplates);
connect(mActionTemplates, &QAction::triggered, this, &MainWindow::slotTemplates);
mActionNew = new NewAlarmAction(false, i18nc("@action", "&New"), this);
actions->addAction(QLatin1String("new"), mActionNew);
actions->addAction(QStringLiteral("new"), mActionNew);
QAction* action = mActionNew->displayAlarmAction();
actions->addAction(QLatin1String("newDisplay"), action);
actions->addAction(QStringLiteral("newDisplay"), action);
#pragma message("port QT5")
//QT5 action->setGlobalShortcut(dummy); // actions->addAction() must be called first!
connect(action, &QAction::triggered, this, &MainWindow::slotNewDisplay);
action = mActionNew->commandAlarmAction();
actions->addAction(QLatin1String("newCommand"), action);
actions->addAction(QStringLiteral("newCommand"), action);
#pragma message("port QT5")
//QT5 action->setGlobalShortcut(dummy); // actions->addAction() must be called first!
connect(action, &QAction::triggered, this, &MainWindow::slotNewCommand);
action = mActionNew->emailAlarmAction();
actions->addAction(QLatin1String("newEmail"), action);
actions->addAction(QStringLiteral("newEmail"), action);
#pragma message("port QT5")
//QT5 action->setGlobalShortcut(dummy); // actions->addAction() must be called first!
connect(action, &QAction::triggered, this, &MainWindow::slotNewEmail);
action = mActionNew->audioAlarmAction();
actions->addAction(QLatin1String("newAudio"), action);
actions->addAction(QStringLiteral("newAudio"), action);
#pragma message("port QT5")
//QT5 action->setGlobalShortcut(dummy); // actions->addAction() must be called first!
connect(action, &QAction::triggered, this, &MainWindow::slotNewAudio);
TemplateMenuAction *templateMenuAction = mActionNew->fromTemplateAlarmAction();
actions->addAction(QLatin1String("newFromTemplate"), templateMenuAction);
actions->addAction(QStringLiteral("newFromTemplate"), templateMenuAction);
connect(templateMenuAction, &TemplateMenuAction::selected, this, &MainWindow::slotNewFromTemplate);
mActionCreateTemplate = new QAction(i18nc("@action", "Create Tem&plate..."), this);
actions->addAction(QLatin1String("createTemplate"), mActionCreateTemplate);
actions->addAction(QStringLiteral("createTemplate"), mActionCreateTemplate);
connect(mActionCreateTemplate, &QAction::triggered, this, &MainWindow::slotNewTemplate);
mActionCopy = new QAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18nc("@action", "&Copy..."), this);
actions->addAction(QLatin1String("copy"), mActionCopy);
actions->addAction(QStringLiteral("copy"), mActionCopy);
actions->setDefaultShortcut(mActionCopy, QKeySequence(Qt::SHIFT + Qt::Key_Insert));
connect(mActionCopy, &QAction::triggered, this, &MainWindow::slotCopy);
mActionModify = new QAction(QIcon::fromTheme(QStringLiteral("document-properties")), i18nc("@action", "&Edit..."), this);
actions->addAction(QLatin1String("modify"), mActionModify);
actions->addAction(QStringLiteral("modify"), mActionModify);
actions->setDefaultShortcut(mActionModify, QKeySequence(Qt::CTRL + Qt::Key_E));
connect(mActionModify, &QAction::triggered, this, &MainWindow::slotModify);
mActionDelete = new QAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18nc("@action", "&Delete"), this);
actions->addAction(QLatin1String("delete"), mActionDelete);
actions->addAction(QStringLiteral("delete"), mActionDelete);
actions->setDefaultShortcut(mActionDelete, QKeySequence::Delete);
connect(mActionDelete, &QAction::triggered, this, &MainWindow::slotDeleteIf);
// Set up Shift-Delete as a shortcut to delete without confirmation
mActionDeleteForce = new QAction(i18nc("@action", "Delete Without Confirmation"), this);
actions->addAction(QLatin1String("delete-force"), mActionDeleteForce);
actions->addAction(QStringLiteral("delete-force"), mActionDeleteForce);
actions->setDefaultShortcut(mActionDeleteForce, QKeySequence::Delete + Qt::SHIFT);
connect(mActionDeleteForce, &QAction::triggered, this, &MainWindow::slotDeleteForce);
mActionReactivate = new QAction(i18nc("@action", "Reac&tivate"), this);
actions->addAction(QLatin1String("undelete"), mActionReactivate);
actions->addAction(QStringLiteral("undelete"), mActionReactivate);
actions->setDefaultShortcut(mActionReactivate, QKeySequence(Qt::CTRL + Qt::Key_R));
connect(mActionReactivate, &QAction::triggered, this, &MainWindow::slotReactivate);
mActionEnable = new QAction(this);
actions->addAction(QLatin1String("disable"), mActionEnable);
actions->addAction(QStringLiteral("disable"), mActionEnable);
actions->setDefaultShortcut(mActionEnable, QKeySequence(Qt::CTRL + Qt::Key_B));
connect(mActionEnable, &QAction::triggered, this, &MainWindow::slotEnable);
action = new QAction(i18nc("@action", "Wake From Suspend..."), this);
actions->addAction(QLatin1String("wakeSuspend"), action);
actions->addAction(QStringLiteral("wakeSuspend"), action);
connect(action, &QAction::triggered, this, &MainWindow::slotWakeFromSuspend);
action = KAlarm::createStopPlayAction(this);
actions->addAction(QLatin1String("stopAudio"), action);
actions->addAction(QStringLiteral("stopAudio"), action);
//QT5 action->setGlobalShortcut(dummy); // actions->addAction() must be called first!
mActionShowTime = new KToggleAction(i18n_a_ShowAlarmTimes(), this);
actions->addAction(QLatin1String("showAlarmTimes"), mActionShowTime);
actions->addAction(QStringLiteral("showAlarmTimes"), mActionShowTime);
connect(mActionShowTime, &KToggleAction::triggered, this, &MainWindow::slotShowTime);
mActionShowTimeTo = new KToggleAction(i18n_o_ShowTimeToAlarms(), this);
actions->addAction(QLatin1String("showTimeToAlarms"), mActionShowTimeTo);
actions->addAction(QStringLiteral("showTimeToAlarms"), mActionShowTimeTo);
actions->setDefaultShortcut(mActionShowTimeTo, QKeySequence(Qt::CTRL + Qt::Key_I));
connect(mActionShowTimeTo, &KToggleAction::triggered, this, &MainWindow::slotShowTimeTo);
mActionShowArchived = new KToggleAction(i18nc("@action", "Show Archi&ved Alarms"), this);
actions->addAction(QLatin1String("showArchivedAlarms"), mActionShowArchived);
actions->addAction(QStringLiteral("showArchivedAlarms"), mActionShowArchived);
actions->setDefaultShortcut(mActionShowArchived, QKeySequence(Qt::CTRL + Qt::Key_P));
connect(mActionShowArchived, &KToggleAction::triggered, this, &MainWindow::slotShowArchived);
mActionToggleTrayIcon = new KToggleAction(i18nc("@action", "Show in System &Tray"), this);
actions->addAction(QLatin1String("showInSystemTray"), mActionToggleTrayIcon);
actions->addAction(QStringLiteral("showInSystemTray"), mActionToggleTrayIcon);
connect(mActionToggleTrayIcon, &KToggleAction::triggered, this, &MainWindow::slotToggleTrayIcon);
mActionToggleResourceSel = new KToggleAction(QIcon::fromTheme(QStringLiteral("view-choose")), i18nc("@action", "Show &Calendars"), this);
actions->addAction(QLatin1String("showResources"), mActionToggleResourceSel);
actions->addAction(QStringLiteral("showResources"), mActionToggleResourceSel);
connect(mActionToggleResourceSel, &KToggleAction::triggered, this, &MainWindow::slotToggleResourceSelector);
mActionSpreadWindows = KAlarm::createSpreadWindowsAction(this);
actions->addAction(QLatin1String("spread"), mActionSpreadWindows);
actions->addAction(QStringLiteral("spread"), mActionSpreadWindows);
#pragma message("port QT5")
//QT5 mActionSpreadWindows->setGlobalShortcut(dummy); // actions->addAction() must be called first!
mActionImportAlarms = new QAction(i18nc("@action", "Import &Alarms..."), this);
actions->addAction(QLatin1String("importAlarms"), mActionImportAlarms);
actions->addAction(QStringLiteral("importAlarms"), mActionImportAlarms);
connect(mActionImportAlarms, &QAction::triggered, this, &MainWindow::slotImportAlarms);
mActionImportBirthdays = new QAction(i18nc("@action", "Import &Birthdays..."), this);
actions->addAction(QLatin1String("importBirthdays"), mActionImportBirthdays);
actions->addAction(QStringLiteral("importBirthdays"), mActionImportBirthdays);
connect(mActionImportBirthdays, &QAction::triggered, this, &MainWindow::slotBirthdays);
mActionExportAlarms = new QAction(i18nc("@action", "E&xport Selected Alarms..."), this);
actions->addAction(QLatin1String("exportAlarms"), mActionExportAlarms);
actions->addAction(QStringLiteral("exportAlarms"), mActionExportAlarms);
connect(mActionExportAlarms, &QAction::triggered, this, &MainWindow::slotExportAlarms);
mActionExport = new QAction(i18nc("@action", "E&xport..."), this);
actions->addAction(QLatin1String("export"), mActionExport);
actions->addAction(QStringLiteral("export"), mActionExport);
connect(mActionExport, &QAction::triggered, this, &MainWindow::slotExportAlarms);
action = new QAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18nc("@action", "&Refresh Alarms"), this);
actions->addAction(QLatin1String("refreshAlarms"), action);
actions->addAction(QStringLiteral("refreshAlarms"), action);
connect(action, &QAction::triggered, this, &MainWindow::slotRefreshAlarms);
KToggleAction* toggleAction = KAlarm::createAlarmEnableAction(this);
actions->addAction(QLatin1String("alarmsEnable"), toggleAction);
actions->addAction(QStringLiteral("alarmsEnable"), toggleAction);
if (undoText.isNull())
{
// Get standard texts, etc., for Undo and Redo actions
......@@ -562,12 +562,12 @@ void MainWindow::initActions()
delete act;
}
mActionUndo = new KToolBarPopupAction(QIcon::fromTheme(QStringLiteral("edit-undo")), undoText, this);
actions->addAction(QLatin1String("edit_undo"), mActionUndo);
actions->addAction(QStringLiteral("edit_undo"), mActionUndo);
mActionUndo->setShortcuts(undoShortcut);
connect(mActionUndo, &KToolBarPopupAction::triggered, this, &MainWindow::slotUndo);
mActionRedo = new KToolBarPopupAction(QIcon::fromTheme(QStringLiteral("edit-redo")), redoText, this);
actions->addAction(QLatin1String("edit_redo"), mActionRedo);
actions->addAction(QStringLiteral("edit_redo"), mActionRedo);
mActionRedo->setShortcuts(redoShortcut);
connect(mActionRedo, &KToolBarPopupAction::triggered, this, &MainWindow::slotRedo);
......
......@@ -356,37 +356,37 @@ void ResourceSelector::selectionChanged()
void ResourceSelector::initActions(KActionCollection* actions)
{
mActionReload = new QAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18nc("@action Reload calendar", "Re&load"), this);
actions->addAction(QLatin1String("resReload"), mActionReload);
actions->addAction(QStringLiteral("resReload"), mActionReload);
connect(mActionReload, &QAction::triggered, this, &ResourceSelector::reloadResource);
mActionShowDetails = new QAction(QIcon::fromTheme(QStringLiteral("help-about")), i18nc("@action", "Show &Details"), this);
actions->addAction(QLatin1String("resDetails"), mActionShowDetails);
actions->addAction(QStringLiteral("resDetails"), mActionShowDetails);
connect(mActionShowDetails, &QAction::triggered, this, &ResourceSelector::showInfo);
mActionSetColour = new QAction(QIcon::fromTheme(QStringLiteral("color-picker")), i18nc("@action", "Set &Color..."), this);
actions->addAction(QLatin1String("resSetColour"), mActionSetColour);
actions->addAction(QStringLiteral("resSetColour"), mActionSetColour);
connect(mActionSetColour, &QAction::triggered, this, &ResourceSelector::setColour);
mActionClearColour = new QAction(i18nc("@action", "Clear C&olor"), this);
actions->addAction(QLatin1String("resClearColour"), mActionClearColour);
actions->addAction(QStringLiteral("resClearColour"), mActionClearColour);
connect(mActionClearColour, &QAction::triggered, this, &ResourceSelector::clearColour);
mActionEdit = new QAction(QIcon::fromTheme(QStringLiteral("document-properties")), i18nc("@action", "&Edit..."), this);
actions->addAction(QLatin1String("resEdit"), mActionEdit);
actions->addAction(QStringLiteral("resEdit"), mActionEdit);
connect(mActionEdit, &QAction::triggered, this, &ResourceSelector::editResource);
mActionUpdate = new QAction(i18nc("@action", "&Update Calendar Format"), this);
actions->addAction(QLatin1String("resUpdate"), mActionUpdate);
actions->addAction(QStringLiteral("resUpdate"), mActionUpdate);
connect(mActionUpdate, &QAction::triggered, this, &ResourceSelector::updateResource);
mActionRemove = new QAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18nc("@action", "&Remove"), this);
actions->addAction(QLatin1String("resRemove"), mActionRemove);
actions->addAction(QStringLiteral("resRemove"), mActionRemove);
connect(mActionRemove, &QAction::triggered, this, &ResourceSelector::removeResource);
mActionSetDefault = new KToggleAction(this);
actions->addAction(QLatin1String("resDefault"), mActionSetDefault);
actions->addAction(QStringLiteral("resDefault"), mActionSetDefault);
connect(mActionSetDefault, &KToggleAction::triggered, this, &ResourceSelector::setStandard);
QAction* action = new QAction(QIcon::fromTheme(QStringLiteral("document-new")), i18nc("@action", "&Add..."), this);
actions->addAction(QLatin1String("resAdd"), action);
actions->addAction(QStringLiteral("resAdd"), action);
connect(action, &QAction::triggered, this, &ResourceSelector::addResource);
mActionImport = new QAction(i18nc("@action", "Im&port..."), this);
actions->addAction(QLatin1String("resImport"), mActionImport);
actions->addAction(QStringLiteral("resImport"), mActionImport);
connect(mActionImport, &QAction::triggered, this, &ResourceSelector::importCalendar);
mActionExport = new QAction(i18nc("@action", "E&xport..."), this);
actions->addAction(QLatin1String("resExport"), mActionExport);
actions->addAction(QStringLiteral("resExport"), mActionExport);
connect(mActionExport, &QAction::triggered, this, &ResourceSelector::exportCalendar);
}
......
......@@ -77,7 +77,7 @@ ActionReply RtcWakeAction::settimer(const QVariantMap& args)
// If 't' is zero, the current wakeup is cancelled by setting a new wakeup
// time 2 seconds from now, which will then expire.
unsigned now = KDateTime::currentUtcDateTime().toTime_t();
proc << exe << QLatin1String("-m") << QLatin1String("no") << QLatin1String("-s") << QString::number(t ? t - now : 2);
proc << exe << QStringLiteral("-m") << QStringLiteral("no") << QStringLiteral("-s") << QString::number(t ? t - now : 2);
result = proc.execute(5000); // allow a timeout of 5 seconds