Commit 97b7f434 authored by Laurent Montel's avatar Laurent Montel 😁

Use QStringLiteral

parent 5086d966
......@@ -287,7 +287,7 @@ void CalendarMigrator::createDefaultResources()
CalendarCreator* creator;
if (!(mExistingAlarmTypes & CalEvent::ACTIVE))
{
creator = new CalendarCreator(CalEvent::ACTIVE, QLatin1String("calendar.ics"), i18nc("@info", "Active Alarms"));
creator = new CalendarCreator(CalEvent::ACTIVE, QStringLiteral("calendar.ics"), i18nc("@info", "Active Alarms"));
connect(creator, SIGNAL(finished(CalendarCreator*)), SLOT(calendarCreated(CalendarCreator*)));
connect(creator, SIGNAL(creating(QString)), SLOT(creatingCalendar(QString)));
mCalendarsPending << creator;
......@@ -295,7 +295,7 @@ void CalendarMigrator::createDefaultResources()
}
if (!(mExistingAlarmTypes & CalEvent::ARCHIVED))
{
creator = new CalendarCreator(CalEvent::ARCHIVED, QLatin1String("expired.ics"), i18nc("@info", "Archived Alarms"));
creator = new CalendarCreator(CalEvent::ARCHIVED, QStringLiteral("expired.ics"), i18nc("@info", "Archived Alarms"));
connect(creator, SIGNAL(finished(CalendarCreator*)), SLOT(calendarCreated(CalendarCreator*)));
connect(creator, SIGNAL(creating(QString)), SLOT(creatingCalendar(QString)));
mCalendarsPending << creator;
......@@ -303,7 +303,7 @@ void CalendarMigrator::createDefaultResources()
}
if (!(mExistingAlarmTypes & CalEvent::TEMPLATE))
{
creator = new CalendarCreator(CalEvent::TEMPLATE, QLatin1String("template.ics"), i18nc("@info", "Alarm Templates"));
creator = new CalendarCreator(CalEvent::TEMPLATE, QStringLiteral("template.ics"), i18nc("@info", "Alarm Templates"));
connect(creator, SIGNAL(finished(CalendarCreator*)), SLOT(calendarCreated(CalendarCreator*)));
connect(creator, SIGNAL(creating(QString)), SLOT(creatingCalendar(QString)));
mCalendarsPending << creator;
......@@ -560,7 +560,7 @@ CalendarCreator::CalendarCreator(const QString& resourceType, const KConfigGroup
qCCritical(KALARM_LOG) << "Invalid resource type:" << resourceType;
return;
}
mPath = config.readPathEntry(pathKey, QLatin1String(""));
mPath = config.readPathEntry(pathKey, QStringLiteral(""));
switch (config.readEntry("AlarmType", (int)0))
{
case 1: mAlarmType = CalEvent::ACTIVE; break;
......
......@@ -184,7 +184,7 @@ CommandOptions::CommandOptions()
{
QString addr = params[i];
if (!KAMail::checkAddress(addr))
setError(xi18nc("@info:shell", "<icode>%1</icode>: invalid email address", QLatin1String("--mail")));
setError(xi18nc("@info:shell", "<icode>%1</icode>: invalid email address", QStringLiteral("--mail")));
KCalCore::Person::Ptr person(new KCalCore::Person(QString(), addr));
mAddressees += person;
}
......@@ -233,7 +233,7 @@ CommandOptions::CommandOptions()
// Background colour is specified
QString colourText = mArgs->getOption("color");
if (colourText[0] == QLatin1Char('0') && colourText[1].toLower() == QLatin1Char('x'))
colourText.replace(0, 2, QLatin1String("#"));
colourText.replace(0, 2, QStringLiteral("#"));
mBgColour.setNamedColor(colourText);
if (!mBgColour.isValid())
setErrorParameter("--color");
......@@ -243,7 +243,7 @@ CommandOptions::CommandOptions()
// Foreground colour is specified
QString colourText = mArgs->getOption("colorfg");
if (colourText[0] == QLatin1Char('0') && colourText[1].toLower() == QLatin1Char('x'))
colourText.replace(0, 2, QLatin1String("#"));
colourText.replace(0, 2, QStringLiteral("#"));
mFgColour.setNamedColor(colourText);
if (!mFgColour.isValid())
setErrorParameter("--colorfg");
......@@ -297,11 +297,11 @@ CommandOptions::CommandOptions()
if (!ok)
setErrorParameter("--until");
else if (mAlarmTime.isDateOnly() && !endTime.isDateOnly())
setError(xi18nc("@info:shell", "Invalid <icode>%1</icode> parameter for date-only alarm", QLatin1String("--until")));
setError(xi18nc("@info:shell", "Invalid <icode>%1</icode> parameter for date-only alarm", QStringLiteral("--until")));
if (!mAlarmTime.isDateOnly() && endTime.isDateOnly())
endTime.setTime(QTime(23,59,59));
if (endTime < mAlarmTime)
setError(xi18nc("@info:shell", "<icode>%1</icode> earlier than <icode>%2</icode>", QLatin1String("--until"), QLatin1String("--time")));
setError(xi18nc("@info:shell", "<icode>%1</icode> earlier than <icode>%2</icode>", QStringLiteral("--until"), QStringLiteral("--time")));
}
else
count = -1;
......@@ -312,7 +312,7 @@ CommandOptions::CommandOptions()
if (!convInterval(mArgs->getOption("interval").toLocal8Bit(), recurType, interval, !haveRecurrence))
setErrorParameter("--interval");
else if (mAlarmTime.isDateOnly() && recurType == KARecurrence::MINUTELY)
setError(xi18nc("@info:shell", "Invalid <icode>%1</icode> parameter for date-only alarm", QLatin1String("--interval")));
setError(xi18nc("@info:shell", "Invalid <icode>%1</icode> parameter for date-only alarm", QStringLiteral("--interval")));
if (haveRecurrence)
{
......@@ -322,7 +322,7 @@ CommandOptions::CommandOptions()
int longestInterval = mRecurrence->longestInterval();
if (count * interval > longestInterval)
setError(xi18nc("@info:shell", "Invalid <icode>%1</icode> and <icode>%2</icode> parameters: repetition is longer than <icode>%3</icode> interval",
QLatin1String("--interval"), QLatin1String("--repeat"), QLatin1String("--recurrence")));
QLatin1String("--interval"), QStringLiteral("--repeat"), QStringLiteral("--recurrence")));
mRepeatCount = count;
mRepeatInterval = interval;
}
......@@ -371,7 +371,7 @@ CommandOptions::CommandOptions()
if (mArgs->isSet("beep"))
setErrorIncompatible("--beep", "--speak");
else if (!theApp()->speechEnabled())
setError(xi18nc("@info:shell", "<icode>%1</icode> requires speech synthesis to be configured using Jovie", QLatin1String("--speak")));
setError(xi18nc("@info:shell", "<icode>%1</icode> requires speech synthesis to be configured using Jovie", QStringLiteral("--speak")));
}
bool onceOnly = mArgs->isSet("reminder-once");
if (mArgs->isSet("reminder") || onceOnly)
......
......@@ -1232,7 +1232,7 @@ void EditEmailAlarmDlg::setEmailFields(uint fromID, const KCalCore::Person::List
if (fromID)
mEmailFromList->setCurrentIdentity(fromID);
if (!addresses.isEmpty())
mEmailToEdit->setText(KAEvent::joinEmailAddresses(addresses, QLatin1String(", ")));
mEmailToEdit->setText(KAEvent::joinEmailAddresses(addresses, QStringLiteral(", ")));
if (!subject.isEmpty())
mEmailSubjectEdit->setText(subject);
if (!attachments.isEmpty())
......@@ -1396,9 +1396,9 @@ void EditEmailAlarmDlg::slotTrySuccess()
{
disconnect(theApp(), SIGNAL(execAlarmSuccess()), this, SLOT(slotTrySuccess()));
QString msg;
QString to = KAEvent::joinEmailAddresses(mEmailAddresses, QLatin1String("<nl/>"));
to.replace(QLatin1Char('<'), QLatin1String("&lt;"));
to.replace(QLatin1Char('>'), QLatin1String("&gt;"));
QString to = KAEvent::joinEmailAddresses(mEmailAddresses, QStringLiteral("<nl/>"));
to.replace(QLatin1Char('<'), QStringLiteral("&lt;"));
to.replace(QLatin1Char('>'), QStringLiteral("&gt;"));
if (mEmailBcc->isChecked())
msg = QLatin1String("<qt>") + xi18nc("@info", "Email sent to:<nl/>%1<nl/>Bcc: <email>%2</email>",
to, Preferences::emailBccAddress()) + QLatin1String("</qt>");
......
......@@ -1895,7 +1895,7 @@ KAlarm::UpdateResult sendToKOrganizer(const KAEvent& event)
return status;
QList<QVariant> args;
args << iCal;
QDBusReply<bool> reply = korgInterface->callWithArgumentList(QDBus::Block, QLatin1String("addIncidence"), args);
QDBusReply<bool> reply = korgInterface->callWithArgumentList(QDBus::Block, QStringLiteral("addIncidence"), args);
if (!reply.isValid())
{
if (reply.error().type() == QDBusError::UnknownObject)
......@@ -1947,7 +1947,7 @@ KAlarm::UpdateResult runKOrganizer()
// If Kontact is running, there is a load() method which needs to be called to
// load KOrganizer into Kontact. But if KOrganizer is running independently,
// the load() method doesn't exist.
QDBusInterface iface(KORG_DBUS_SERVICE, QLatin1String(KORG_DBUS_LOAD_PATH), QLatin1String("org.kde.PIMUniqueApplication"));
QDBusInterface iface(KORG_DBUS_SERVICE, QLatin1String(KORG_DBUS_LOAD_PATH), QStringLiteral("org.kde.PIMUniqueApplication"));
if (!iface.isValid())
{
status.set(KAlarm::UPDATE_KORG_ERR, iface.lastError().message());
......
......@@ -165,7 +165,7 @@ KAlarmApp::KAlarmApp()
}
// Check if the speech synthesis daemon is installed
mSpeechEnabled = (KServiceTypeTrader::self()->query(QLatin1String("DBUS/Text-to-Speech"), QLatin1String("Name == 'KTTSD'")).count() > 0);
mSpeechEnabled = (KServiceTypeTrader::self()->query(QLatin1String("DBUS/Text-to-Speech"), QStringLiteral("Name == 'KTTSD'")).count() > 0);
if (!mSpeechEnabled) { qCDebug(KALARM_LOG) << "Speech synthesis disabled (KTTSD not found)"; }
// Check if KOrganizer is installed
const QString korg = QLatin1String("korganizer");
......@@ -362,7 +362,7 @@ int KAlarmApp::newInstance()
dontRedisplay = true;
if (!handleEvent(options.eventId(), function, true))
{
CommandOptions::printError(xi18nc("@info:shell", "%1: Event <resource>%2</resource> not found, or not unique", QLatin1String("--") + options.commandName(), options.eventId().eventId()));
CommandOptions::printError(xi18nc("@info:shell", "%1: Event <resource>%2</resource> not found, or not unique", QStringLiteral("--") + options.commandName(), options.eventId().eventId()));
exitCode = 1;
}
}
......@@ -390,7 +390,7 @@ int KAlarmApp::newInstance()
exitCode = 1;
else if (!KAlarm::editAlarmById(options.eventId()))
{
CommandOptions::printError(xi18nc("@info:shell", "%1: Event <resource>%2</resource> not found, or not editable", QLatin1String("--") + options.commandName(), options.eventId().eventId()));
CommandOptions::printError(xi18nc("@info:shell", "%1: Event <resource>%2</resource> not found, or not editable", QStringLiteral("--") + options.commandName(), options.eventId().eventId()));
exitCode = 1;
}
break;
......@@ -577,7 +577,7 @@ void KAlarmApp::checkKtimezoned()
qCDebug(KALARM_LOG) << "ktimezoned not running: using UTC only";
KAMessageBox::information(MainWindow::mainMainWindow(),
xi18nc("@info", "Time zones are not accessible:<nl/>KAlarm will use the UTC time zone.<nl/><nl/>(The KDE time zone service is not available:<nl/>check that <application>ktimezoned</application> is installed.)"),
QString(), QLatin1String("tzunavailable"));
QString(), QStringLiteral("tzunavailable"));
}
}
......@@ -1138,7 +1138,7 @@ void KAlarmApp::checkWritableCalendar()
KAMessageBox::information(MainWindow::mainMainWindow(),
xi18nc("@info", "Alarms cannot be created or updated, because no writable active alarm calendar is enabled.<nl/><nl/>"
"To fix this, use <interface>View | Show Calendars</interface> to check or change calendar statuses."),
QString(), QLatin1String("noWritableCal"));
QString(), QStringLiteral("noWritableCal"));
}
}
......@@ -2135,7 +2135,7 @@ QString KAlarmApp::createTempScriptFile(const QString& command, bool insertShell
}
QStringList errmsgs(i18nc("@info", "Error creating temporary script file"));
MessageWin::showError(event, alarm.dateTime(), errmsgs, QLatin1String("Script"));
MessageWin::showError(event, alarm.dateTime(), errmsgs, QStringLiteral("Script"));
return QString();
}
......
......@@ -622,8 +622,8 @@ QString KAMail::getMailBody(quint32 serialNumber)
#ifdef __GNUC__
#warning Set correct DBus interface/object for kmail
#endif
QDBusInterface iface(KMAIL_DBUS_SERVICE, QString(), QLatin1String("KMailIface"));
QDBusReply<QString> reply = iface.callWithArgumentList(QDBus::Block, QLatin1String("getDecodedBodyPart"), args);
QDBusInterface iface(KMAIL_DBUS_SERVICE, QString(), QStringLiteral("KMailIface"));
QDBusReply<QString> reply = iface.callWithArgumentList(QDBus::Block, QStringLiteral("getDecodedBodyPart"), args);
if (!reply.isValid())
{
qCCritical(KALARM_LOG) << "D-Bus call failed:" << reply.error().message();
......
......@@ -754,7 +754,7 @@ void MainWindow::slotDelete(bool force)
if (KAMessageBox::warningContinueCancel(this, i18ncp("@info", "Do you really want to delete the selected alarm?",
"Do you really want to delete the %1 selected alarms?", n),
i18ncp("@title:window", "Delete Alarm", "Delete Alarms", n),
KGuiItem(i18nc("@action:button", "&Delete"), QLatin1String("edit-delete")),
KGuiItem(i18nc("@action:button", "&Delete"), QStringLiteral("edit-delete")),
KStandardGuiItem::cancel(),
Preferences::CONFIRM_ALARM_DELETION)
!= KMessageBox::Continue)
......
......@@ -472,10 +472,10 @@ MiscPrefTab::MiscPrefTab(StackedScrollGroup* scrollGroup)
if (mXtermFirst < 0)
mXtermFirst = mXtermCount; // note the id of the first button
cmd.replace(QLatin1String("%t"), KComponentData::mainComponent().aboutData()->programName());
cmd.replace(QLatin1String("%c"), QLatin1String("<command>"));
cmd.replace(QLatin1String("%w"), QLatin1String("<command; sleep>"));
cmd.replace(QLatin1String("%C"), QLatin1String("[command]"));
cmd.replace(QLatin1String("%W"), QLatin1String("[command; sleep]"));
cmd.replace(QLatin1String("%c"), QStringLiteral("<command>"));
cmd.replace(QLatin1String("%w"), QStringLiteral("<command; sleep>"));
cmd.replace(QLatin1String("%C"), QStringLiteral("[command]"));
cmd.replace(QLatin1String("%W"), QStringLiteral("[command; sleep]"));
radio->setWhatsThis(
xi18nc("@info:whatsthis", "Check to execute command alarms in a terminal window by <icode>%1</icode>", cmd));
grid->addWidget(radio, (row = index/3), index % 3, Qt::AlignLeft);
......
......@@ -86,7 +86,7 @@ ActionReply RtcWakeAction::settimer(const QVariantMap& args)
case 0:
return ActionReply::SuccessType;
case -2:
errmsg = xi18nc("@text/plain", "Could not run <command>%1</command> to set wake from suspend", QLatin1String("rtcwake"));
errmsg = xi18nc("@text/plain", "Could not run <command>%1</command> to set wake from suspend", QStringLiteral("rtcwake"));
break;
default:
errmsg = xi18nc("@text/plain", "Error setting wake from suspend.<nl/>Command was: <command>%1</command><nl/>Error code: %2.", proc.program().join(QLatin1String(" ")), result);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment