Commit 2be4fc89 authored by David Jarvie's avatar David Jarvie
Browse files

Use QStringLiteral

parent f000b91e
......@@ -58,7 +58,7 @@ QString AlarmTime::alarmTimeText(const DateTime& dateTime)
if (QApplication::isLeftToRight()) // don't try to align right-to-left languages
{
QString fmt = locale->timeFormat();
int i = fmt.indexOf(QRegExp(QLatin1String("%[kl]"))); // check if leading zeroes are omitted
int i = fmt.indexOf(QRegExp(QStringLiteral("%[kl]"))); // check if leading zeroes are omitted
if (i >= 0 && i == fmt.indexOf(QLatin1Char('%'))) // and whether the hour is first
mTimeHourPos = i; // yes, so need to align
}
......@@ -235,12 +235,12 @@ KDateTime AlarmTime::applyTimeZone(const QString& tzstring, const QDate& date, c
{
bool error = false;
KDateTime::Spec spec = KDateTime::LocalZone;
QString zone = tzstring.trimmed();
const QString zone = tzstring.trimmed();
if (!zone.isEmpty())
{
if (zone == QLatin1String("Clock"))
if (zone == QStringLiteral("Clock"))
spec = KDateTime::ClockTime;
else if (zone == QLatin1String("UTC"))
else if (zone == QStringLiteral("UTC"))
spec = KDateTime::UTC;
else
{
......
/*
* calendarmigrator.cpp - migrates or creates KAlarm Akonadi resources
* Program: kalarm
* Copyright © 2011-2014 by David Jarvie <djarvie@kde.org>
* Copyright © 2011-2015 by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -48,6 +48,11 @@
using namespace Akonadi;
using namespace KAlarmCal;
namespace
{
const QString KALARM_RESOURCE("akonadi_kalarm_resource");
const QString KALARM_DIR_RESOURCE("akonadi_kalarm_dir_resource");
}
// Creates, or migrates from KResources, a single alarm calendar
class CalendarCreator : public QObject
......@@ -186,8 +191,7 @@ void CalendarMigrator::migrateOrCreate()
foreach (const AgentInstance& agent, agents)
{
const QString type = agent.type().identifier();
if (type == QLatin1String("akonadi_kalarm_resource")
|| type == QLatin1String("akonadi_kalarm_dir_resource"))
if (type == KALARM_RESOURCE || type == KALARM_DIR_RESOURCE)
{
// Fetch the resource's collection to determine its alarm types
CollectionFetchJob* job = new CollectionFetchJob(Collection::root(), CollectionFetchJob::FirstLevel);
......@@ -203,7 +207,7 @@ void CalendarMigrator::migrateOrCreate()
{
// There are no Akonadi resources, so migrate any KResources alarm
// calendars from pre-Akonadi versions of KAlarm.
const QString configFile = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1String("/kresources/alarms/stdrc");
const QString configFile = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QStringLiteral("/kresources/alarms/stdrc");
const KConfig config(configFile, KConfig::SimpleConfig);
// Fetch all the KResource identifiers which are actually in use
......@@ -215,15 +219,15 @@ void CalendarMigrator::migrateOrCreate()
CalendarCreator* creator;
foreach (const QString& id, keys)
{
const KConfigGroup configGroup = config.group(QLatin1String("Resource_") + id);
const KConfigGroup configGroup = config.group(QStringLiteral("Resource_") + id);
const QString resourceType = configGroup.readEntry("ResourceType", QString());
QString agentType;
if (resourceType == QLatin1String("file"))
agentType = QLatin1String("akonadi_kalarm_resource");
else if (resourceType == QLatin1String("dir"))
agentType = QLatin1String("akonadi_kalarm_dir_resource");
else if (resourceType == QLatin1String("remote"))
agentType = QLatin1String("akonadi_kalarm_resource");
if (resourceType == QStringLiteral("file"))
agentType = KALARM_RESOURCE;
else if (resourceType == QStringLiteral("dir"))
agentType = KALARM_DIR_RESOURCE;
else if (resourceType == QStringLiteral("remote"))
agentType = KALARM_RESOURCE;
else
continue; // unknown resource type - can't convert
......@@ -291,7 +295,7 @@ void CalendarMigrator::createDefaultResources()
connect(creator, SIGNAL(finished(CalendarCreator*)), SLOT(calendarCreated(CalendarCreator*)));
connect(creator, SIGNAL(creating(QString)), SLOT(creatingCalendar(QString)));
mCalendarsPending << creator;
creator->createAgent(QLatin1String("akonadi_kalarm_resource"), this);
creator->createAgent(KALARM_RESOURCE, this);
}
if (!(mExistingAlarmTypes & CalEvent::ARCHIVED))
{
......@@ -299,7 +303,7 @@ void CalendarMigrator::createDefaultResources()
connect(creator, SIGNAL(finished(CalendarCreator*)), SLOT(calendarCreated(CalendarCreator*)));
connect(creator, SIGNAL(creating(QString)), SLOT(creatingCalendar(QString)));
mCalendarsPending << creator;
creator->createAgent(QLatin1String("akonadi_kalarm_resource"), this);
creator->createAgent(KALARM_RESOURCE, this);
}
if (!(mExistingAlarmTypes & CalEvent::TEMPLATE))
{
......@@ -307,7 +311,7 @@ void CalendarMigrator::createDefaultResources()
connect(creator, SIGNAL(finished(CalendarCreator*)), SLOT(calendarCreated(CalendarCreator*)));
connect(creator, SIGNAL(creating(QString)), SLOT(creatingCalendar(QString)));
mCalendarsPending << creator;
creator->createAgent(QLatin1String("akonadi_kalarm_resource"), this);
creator->createAgent(KALARM_RESOURCE, this);
}
if (mCalendarsPending.isEmpty())
......@@ -380,9 +384,9 @@ void CalendarMigrator::updateToCurrentFormat(const Collection& collection, bool
const AgentInstance agent = AgentManager::self()->instance(collection.resource());
const QString id = agent.type().identifier();
bool dirResource;
if (id == QLatin1String("akonadi_kalarm_resource"))
if (id == KALARM_RESOURCE)
dirResource = false;
else if (id == QLatin1String("akonadi_kalarm_dir_resource"))
else if (id == KALARM_DIR_RESOURCE)
dirResource = true;
else
{
......@@ -517,8 +521,8 @@ template <class Interface> bool CalendarMigrator::updateStorageFormat(const Agen
*/
template <class Interface> Interface* CalendarMigrator::getAgentInterface(const AgentInstance& agent, QString& errorMessage, QObject* parent)
{
Interface* iface = new Interface(QLatin1String("org.freedesktop.Akonadi.Resource.") + agent.identifier(),
QLatin1String("/Settings"), QDBusConnection::sessionBus(), parent);
Interface* iface = new Interface(QStringLiteral("org.freedesktop.Akonadi.Resource.") + agent.identifier(),
QStringLiteral("/Settings"), QDBusConnection::sessionBus(), parent);
if (!iface->isValid())
{
errorMessage = iface->lastError().message();
......@@ -540,17 +544,17 @@ CalendarCreator::CalendarCreator(const QString& resourceType, const KConfigGroup
{
// Read the resource configuration parameters from the config
const char* pathKey = Q_NULLPTR;
if (resourceType == QLatin1String("file"))
if (resourceType == QStringLiteral("file"))
{
mResourceType = LocalFile;
pathKey = "CalendarURL";
}
else if (resourceType == QLatin1String("dir"))
else if (resourceType == QStringLiteral("dir"))
{
mResourceType = LocalDir;
pathKey = "CalendarURL";
}
else if (resourceType == QLatin1String("remote"))
else if (resourceType == QStringLiteral("remote"))
{
mResourceType = RemoteFile;
pathKey = "DownloadUrl";
......@@ -774,7 +778,7 @@ void CalendarCreator::collectionFetchResult(KJob* j)
mCollectionId = collection.id();
collection.setContentMimeTypes(CalEvent::mimeTypes(mAlarmType));
EntityDisplayAttribute* dattr = collection.attribute<EntityDisplayAttribute>(Collection::AddIfMissing);
dattr->setIconName(QLatin1String("kalarm"));
dattr->setIconName(QStringLiteral("kalarm"));
CollectionAttribute* attr = collection.attribute<CollectionAttribute>(Entity::AddIfMissing);
attr->setEnabled(mEnabled ? mAlarmType : CalEvent::EMPTY);
if (mStandard)
......
......@@ -605,7 +605,7 @@ bool CollectionView::viewportEvent(QEvent* e)
int i = toolTip.indexOf(QLatin1Char('@'));
if (i > 0)
{
int j = toolTip.indexOf(QRegExp(QLatin1String("<(nl|br)"), Qt::CaseInsensitive), i + 1);
int j = toolTip.indexOf(QRegExp(QStringLiteral("<(nl|br)"), Qt::CaseInsensitive), i + 1);
int k = toolTip.indexOf(QLatin1Char('@'), j);
const QString name = toolTip.mid(i + 1, j - i - 1);
value = model()->data(index, Qt::FontRole);
......@@ -954,7 +954,7 @@ QString CollectionControlModel::typeListForDisplay(CalEvent::Types alarmTypes)
if (alarmTypes & CalEvent::TEMPLATE)
list += QLatin1String("<item>") + i18nc("@info", "Alarm Templates") + QLatin1String("</item>");
if (!list.isEmpty())
list = QLatin1String("<list>") + list + QLatin1String("</list>");
list = QStringLiteral("<list>") + list + QStringLiteral("</list>");
return list;
}
......
......@@ -41,7 +41,10 @@ using namespace KCalCore;
#include <stdlib.h>
static const char* REQUEST_DBUS_OBJECT = "/kalarm"; // D-Bus object path of KAlarm's request interface
namespace
{
const QString REQUEST_DBUS_OBJECT("/kalarm"); // D-Bus object path of KAlarm's request interface
}
/*=============================================================================
......@@ -52,7 +55,7 @@ DBusHandler::DBusHandler()
{
qCDebug(KALARM_LOG);
new KalarmAdaptor(this);
QDBusConnection::sessionBus().registerObject(QLatin1String(REQUEST_DBUS_OBJECT), this);
QDBusConnection::sessionBus().registerObject(REQUEST_DBUS_OBJECT, this);
}
......
......@@ -1181,7 +1181,7 @@ void EditEmailAlarmDlg::type_initValues(const KAEvent* event)
{
// Set the values to those for the specified event
mEmailAttachList->addItems(event->emailAttachments());
mEmailToEdit->setText(event->emailAddresses(QLatin1String(", ")));
mEmailToEdit->setText(event->emailAddresses(QStringLiteral(", ")));
mEmailSubjectEdit->setText(event->emailSubject());
mEmailBcc->setChecked(event->emailBcc());
if (mEmailFromList)
......
......@@ -1394,7 +1394,7 @@ QString runKMail(bool minimise)
QString errmsg;
if (minimise && Private::startKMailMinimised())
return QString();
if (KToolInvocation::startServiceByDesktopName(QLatin1String("kmail"), QString(), &errmsg))
if (KToolInvocation::startServiceByDesktopName(QStringLiteral("kmail"), QString(), &errmsg))
{
qCCritical(KALARM_LOG) << "Couldn't start KMail (" << errmsg << ")";
return xi18nc("@info", "Unable to start <application>KMail</application><nl/>(<message>%1</message>)", errmsg);
......@@ -1606,11 +1606,11 @@ void writeConfigWindowSize(const char* window, const QSize& size, int splitterWi
*/
FileType fileType(const KMimeType::Ptr& mimetype)
{
if (mimetype->is(QLatin1String("text/html")))
if (mimetype->is(QStringLiteral("text/html")))
return TextFormatted;
if (mimetype->is(QLatin1String("application/x-executable")))
if (mimetype->is(QStringLiteral("application/x-executable")))
return TextApplication;
if (mimetype->is(QLatin1String("text/plain")))
if (mimetype->is(QStringLiteral("text/plain")))
return TextPlain;
if (mimetype->name().startsWith(QStringLiteral("image/")))
return Image;
......@@ -1627,7 +1627,7 @@ FileErr checkFileExists(QString& filename, KUrl& url)
url = KUrl();
FileErr err = FileErr_None;
QString file = filename;
QRegExp f(QLatin1String("^file:/+"));
QRegExp f(QStringLiteral("^file:/+"));
if (f.indexIn(file) >= 0)
file = file.mid(f.matchedLength() - 1);
// Convert any relative file path to absolute
......@@ -1675,7 +1675,7 @@ bool showFileErrMessage(const QString& filename, FileErr err, FileErr blankError
{
// If file is a local file, remove "file://" from name
QString file = filename;
QRegExp f(QLatin1String("^file:/+"));
QRegExp f(QStringLiteral("^file:/+"));
if (f.indexIn(file) >= 0)
file = file.mid(f.matchedLength() - 1);
......@@ -1712,7 +1712,7 @@ bool showFileErrMessage(const QString& filename, FileErr err, FileErr blankError
*/
QString pathOrUrl(const QString& url)
{
static const QRegExp localfile(QLatin1String("^file:/+"));
static const QRegExp localfile(QStringLiteral("^file:/+"));
return (localfile.indexIn(url) >= 0) ? url.mid(localfile.matchedLength() - 1) : url;
}
......@@ -1732,7 +1732,7 @@ QString pathOrUrl(const QString& url)
QString browseFile(const QString& caption, QString& defaultDir, const QString& initialFile,
const QString& filter, KFile::Modes mode, QWidget* parent)
{
QString initialDir = !initialFile.isEmpty() ? QString(initialFile).remove(QRegExp(QLatin1String("/[^/]*$")))
QString initialDir = !initialFile.isEmpty() ? QString(initialFile).remove(QRegExp(QStringLiteral("/[^/]*$")))
: !defaultDir.isEmpty() ? defaultDir
: QDir::homePath();
// Use AutoQPointer to guard against crash on application exit while
......@@ -1745,7 +1745,7 @@ QString browseFile(const QString& caption, QString& defaultDir, const QString& i
if (!initialFile.isEmpty())
fileDlg->setSelection(initialFile);
if (fileDlg->exec() != QDialog::Accepted)
return fileDlg ? QLatin1String("") : QString(); // return null only if dialog was deleted
return fileDlg ? QStringLiteral("") : QString(); // return null only if dialog was deleted
KUrl url = fileDlg->selectedUrl();
if (url.isEmpty())
return QStringLiteral(""); // return empty, non-null string
......@@ -1799,7 +1799,7 @@ void setTestModeConditions()
void setSimulatedSystemTime(const KDateTime& dt)
{
KDateTime::setSimulatedSystemTime(dt);
qCDebug(KALARM_LOG) << "New time =" << qPrintable(KDateTime::currentLocalDateTime().toString(QLatin1String("%Y-%m-%d %H:%M %:Z")));
qCDebug(KALARM_LOG) << "New time =" << qPrintable(KDateTime::currentLocalDateTime().toString(QStringLiteral("%Y-%m-%d %H:%M %:Z")));
}
#endif
......@@ -1869,7 +1869,7 @@ KAlarm::UpdateResult sendToKOrganizer(const KAEvent& event)
? Identities::identityManager()->identityForUoid(event.emailFromId()).fullEmailAddr()
: Preferences::emailAddress();
AlarmText atext;
atext.setEmail(event.emailAddresses(QLatin1String(", ")), from, QString(), QString(), event.emailSubject(), QString());
atext.setEmail(event.emailAddresses(QStringLiteral(", ")), from, QString(), QString(), event.emailSubject(), QString());
kcalEvent->setSummary(atext.displayText());
userEmail = from;
break;
......@@ -1937,7 +1937,7 @@ KAlarm::UpdateResult runKOrganizer()
{
KAlarm::UpdateResult status;
QString error, dbusService;
int result = KDBusServiceStarter::self()->findServiceFor(QLatin1String("DBUS/Organizer"), QString(), &error, &dbusService);
int result = KDBusServiceStarter::self()->findServiceFor(QStringLiteral("DBUS/Organizer"), QString(), &error, &dbusService);
if (result)
{
status.set(KAlarm::UPDATE_KORG_ERRINIT, error);
......@@ -1947,14 +1947,14 @@ 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), QStringLiteral("org.kde.PIMUniqueApplication"));
QDBusInterface iface(KORG_DBUS_SERVICE, QStringLiteral(KORG_DBUS_LOAD_PATH), QStringLiteral("org.kde.PIMUniqueApplication"));
if (!iface.isValid())
{
status.set(KAlarm::UPDATE_KORG_ERR, iface.lastError().message());
qCWarning(KALARM_LOG) << "Unable to access " KORG_DBUS_LOAD_PATH " D-Bus interface:" << status.message;
return status;
}
QDBusReply<bool> reply = iface.call(QLatin1String("load"));
QDBusReply<bool> reply = iface.call(QStringLiteral("load"));
if ((!reply.isValid() || !reply.value())
&& iface.lastError().type() != QDBusError::UnknownMethod)
{
......@@ -1968,7 +1968,7 @@ KAlarm::UpdateResult runKOrganizer()
if (!korgInterface || !korgInterface->isValid())
{
delete korgInterface;
korgInterface = new QDBusInterface(KORG_DBUS_SERVICE, QLatin1String(KORG_DBUS_PATH), KORG_DBUS_IFACE);
korgInterface = new QDBusInterface(KORG_DBUS_SERVICE, QStringLiteral(KORG_DBUS_PATH), KORG_DBUS_IFACE);
if (!korgInterface->isValid())
{
status.set(KAlarm::UPDATE_KORG_ERRSTART, korgInterface->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"), QStringLiteral("Name == 'KTTSD'")).count() > 0);
mSpeechEnabled = (KServiceTypeTrader::self()->query(QStringLiteral("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");
......@@ -269,8 +269,8 @@ bool KAlarmApp::restoreSession()
MainWindow* trayParent = Q_NULLPTR;
for (int i = 1; KMainWindow::canBeRestored(i); ++i)
{
QString type = KMainWindow::classNameOfToplevel(i);
if (type == QLatin1String("MainWindow"))
const QString type = KMainWindow::classNameOfToplevel(i);
if (type == QStringLiteral("MainWindow"))
{
MainWindow* win = MainWindow::create(true);
win->restore(i, false);
......@@ -279,7 +279,7 @@ bool KAlarmApp::restoreSession()
else
win->show();
}
else if (type == QLatin1String("MessageWin"))
else if (type == QStringLiteral("MessageWin"))
{
MessageWin* win = new MessageWin;
win->restore(i, false);
......@@ -763,7 +763,7 @@ void KAlarmApp::checkNextDueAlarm()
KDateTime nextDt = nextEvent->nextTrigger(KAEvent::ALL_TRIGGER).effectiveKDateTime();
KDateTime now = KDateTime::currentDateTime(Preferences::timeZone());
qint64 interval = now.secsTo_long(nextDt);
qCDebug(KALARM_LOG) << "now:" << qPrintable(now.toString(QLatin1String("%Y-%m-%d %H:%M %:Z"))) << ", next:" << qPrintable(nextDt.toString(QLatin1String("%Y-%m-%d %H:%M %:Z"))) << ", due:" << interval;
qCDebug(KALARM_LOG) << "now:" << qPrintable(now.toString(QStringLiteral("%Y-%m-%d %H:%M %:Z"))) << ", next:" << qPrintable(nextDt.toString(QStringLiteral("%Y-%m-%d %H:%M %:Z"))) << ", due:" << interval;
if (interval <= 0)
{
// Queue the alarm
......@@ -1231,7 +1231,7 @@ QStringList KAlarmApp::scheduledAlarmList()
AkonadiModel::instance()->refresh(c);
QString text(c.resource() + QLatin1String(":"));
text += event->id() + QLatin1Char(' ')
+ dateTime.toString(QLatin1String("%Y%m%dT%H%M "))
+ dateTime.toString(QStringLiteral("%Y%m%dT%H%M "))
+ AlarmText::summary(*event, 1);
alarms << text;
}
......@@ -1351,7 +1351,7 @@ bool KAlarmApp::dbusHandleEvent(const EventId& eventID, EventFunc function)
QString KAlarmApp::dbusList()
{
qCDebug(KALARM_LOG);
return scheduledAlarmList().join(QLatin1String("\n")) + QLatin1Char('\n');
return scheduledAlarmList().join(QStringLiteral("\n")) + QLatin1Char('\n');
}
/******************************************************************************
......@@ -1390,7 +1390,7 @@ bool KAlarmApp::handleEvent(const EventId& id, EventFunc function, bool checkDup
case EVENT_HANDLE: // handle it if it's due
{
KDateTime now = KDateTime::currentUtcDateTime();
qCDebug(KALARM_LOG) << eventID << "," << (function==EVENT_TRIGGER?"TRIGGER:":"HANDLE:") << qPrintable(now.dateTime().toString(QLatin1String("yyyy-MM-dd hh:mm"))) << "UTC";
qCDebug(KALARM_LOG) << eventID << "," << (function==EVENT_TRIGGER?"TRIGGER:":"HANDLE:") << qPrintable(now.dateTime().toString(QStringLiteral("yyyy-MM-dd hh:mm"))) << "UTC";
bool updateCalAndDisplay = false;
bool alarmToExecuteValid = false;
KAAlarm alarmToExecute;
......@@ -1877,7 +1877,7 @@ void* KAlarmApp::execAlarm(KAEvent& event, const KAAlarm& alarm, bool reschedule
}
case KAAlarm::EMAIL:
{
qCDebug(KALARM_LOG) << "EMAIL to:" << event.emailAddresses(QLatin1String(","));
qCDebug(KALARM_LOG) << "EMAIL to:" << event.emailAddresses(QStringLiteral(","));
QStringList errmsgs;
KAMail::JobData data(event, alarm, reschedule, (reschedule || allowDefer));
data.queued = true;
......@@ -2006,7 +2006,7 @@ ShellProcess* KAlarmApp::doShellCommand(const QString& command, const KAEvent& e
// Use ShellProcess, which automatically checks whether the user is
// authorised to run shell commands.
proc = new ShellProcess(cmd);
proc->setEnv(QLatin1String("KALARM_UID"), event.id(), true);
proc->setEnv(QStringLiteral("KALARM_UID"), event.id(), true);
proc->setOutputChannelMode(KProcess::MergedChannels); // combine stdout & stderr
connect(proc, &ShellProcess::shellExited, this, &KAlarmApp::slotCommandExited);
if ((flags & ProcData::DISP_OUTPUT) && receiver && slot)
......@@ -2285,7 +2285,7 @@ OrgKdeKSpeechInterface* KAlarmApp::kspeechInterface(QString& error) const
// kttsd is not running, so start it
delete mKSpeech;
mKSpeech = 0;
if (KToolInvocation::startServiceByDesktopName(QLatin1String("kttsd"), QStringList(), &error))
if (KToolInvocation::startServiceByDesktopName(QStringLiteral("kttsd"), QStringList(), &error))
{
qCDebug(KALARM_LOG) << "Failed to start kttsd:" << error;
return 0;
......
......@@ -145,7 +145,7 @@ int KAMail::send(JobData& jobdata, QStringList& errmsgs)
return -1;
}
jobdata.bcc = (jobdata.event.emailBcc() ? Preferences::emailBccAddress() : QString());
qCDebug(KALARM_LOG) << "To:" << jobdata.event.emailAddresses(QLatin1String(","))
qCDebug(KALARM_LOG) << "To:" << jobdata.event.emailAddresses(QStringLiteral(","))
<< endl << "Subject:" << jobdata.event.emailSubject();
MailTransport::TransportManager* manager = MailTransport::TransportManager::self();
......@@ -169,7 +169,7 @@ int KAMail::send(JobData& jobdata, QStringList& errmsgs)
paths << QStringLiteral("/sbin") << QStringLiteral("/usr/sbin") << QStringLiteral("/usr/lib");
QString command = QStandardPaths::findExecutable(QStringLiteral("sendmail"), paths);
transport = manager->createTransport();
transport->setName(QLatin1String("sendmail"));
transport->setName(QStringLiteral("sendmail"));
transport->setType(MailTransport::Transport::EnumType::Sendmail);
transport->setHost(command);
transport->setRequiresAuthentication(false);
......@@ -209,7 +209,7 @@ int KAMail::send(JobData& jobdata, QStringList& errmsgs)
// MessageQueueJob email addresses must be pure, i.e. without display name. Note
// that display names are included in the actual headers set up by initHeaders().
mailjob->addressAttribute().setFrom(extractEmailAndNormalize(jobdata.from));
mailjob->addressAttribute().setTo(extractEmailsAndNormalize(jobdata.event.emailAddresses(QLatin1String(","))));
mailjob->addressAttribute().setTo(extractEmailsAndNormalize(jobdata.event.emailAddresses(QStringLiteral(","))));
if (!jobdata.bcc.isEmpty())
mailjob->addressAttribute().setBcc(extractEmailsAndNormalize(jobdata.bcc));
MailTransport::SentBehaviourAttribute::SentBehaviour sentAction =
......@@ -423,8 +423,8 @@ QString KAMail::appendBodyAttachments(KMime::Message& message, JobData& data)
void KAMail::notifyQueued(const KAEvent& event)
{
KMime::Types::Address addr;
QString localhost = QLatin1String("localhost");
QString hostname = QHostInfo::localHostName();
const QString localhost = QLatin1String("localhost");
const QString hostname = QHostInfo::localHostName();
KCalCore::Person::List addresses = event.emailAddressees();
for (int i = 0, end = addresses.count(); i < end; ++i)
{
......
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