Commit 4ac30cde authored by Laurent Montel's avatar Laurent Montel 😁

Fix some clazy warning

parent ee4ee4aa
......@@ -59,7 +59,7 @@ bool OperaImportData::importMails()
MailImporter::FilterOpera opera;
initializeFilter(opera);
opera.filterInfo()->setStatusMessage(i18n("Import in progress"));
const QString mailPath(mPath + QLatin1String("mail/store/"));
const QString mailPath(mPath + QStringLiteral("mail/store/"));
QDir directory(mailPath);
if (directory.exists()) {
opera.importMails(mailPath);
......@@ -72,7 +72,7 @@ bool OperaImportData::importMails()
bool OperaImportData::importAddressBook()
{
const QString addressbookFile(mPath + QLatin1String("bookmarks.adr"));
const QString addressbookFile(mPath + QStringLiteral("bookmarks.adr"));
OperaAddressBook addressbook(addressbookFile);
addressbook.setAbstractDisplayInfo(mAbstractDisplayInfo);
addressbook.importAddressBook();
......@@ -81,7 +81,7 @@ bool OperaImportData::importAddressBook()
bool OperaImportData::importSettings()
{
const QString settingFile(mPath + QLatin1String("mail/accounts.ini"));
const QString settingFile(mPath + QStringLiteral("mail/accounts.ini"));
OperaSettings settings(settingFile);
settings.setAbstractDisplayInfo(mAbstractDisplayInfo);
settings.importSettings();
......
......@@ -256,7 +256,7 @@ void OperaSettings::readIdentity(const KConfigGroup &grp)
KIdentityManagement::Signature signature;
const int signatureHtml = grp.readEntry(QStringLiteral("Signature is HTML"), -1);
if (signatureFile.contains(QStringLiteral("{Preferences}"))) {
signatureFile.replace(QStringLiteral("{Preferences}"), MailImporter::FilterOpera::defaultSettingsPath() + QLatin1String("/"));
signatureFile.replace(QStringLiteral("{Preferences}"), MailImporter::FilterOpera::defaultSettingsPath() + QStringLiteral("/"));
}
QFile file(signatureFile);
......
......@@ -31,19 +31,19 @@ CreateFolderContentsWidget::CreateFolderContentsWidget(Trip *trip, int role, con
, m_trip(trip)
, m_role(role)
{
QPushButton *button = new QPushButton(QLatin1String("Select ") + type);
QPushButton *button = new QPushButton(QStringLiteral("Select ") + type);
QString iconName;
switch (role) {
case Trip::MailCollectionRole:
iconName = QLatin1String("kmail");
iconName = QStringLiteral("kmail");
break;
case Trip::NotesCollectionRole:
iconName = QLatin1String("knotes");
iconName = QStringLiteral("knotes");
break;
case Trip::TodoCollectionRole:
iconName = QLatin1String("korg-todo");
iconName = QStringLiteral("korg-todo");
break;
}
QIcon icon = QIcon::fromTheme(iconName);
......
......@@ -56,9 +56,9 @@ CreateTripWidget::CreateTripWidget(Trip *trip, Akonadi::Monitor *monitor, QWidge
layout->addLayout(configureLayout);
m_mailWidget = createView(QLatin1String("Mail"), Trip::MailCollectionRole);
m_todoWidget = createView(QLatin1String("Todos"), Trip::TodoCollectionRole);
m_notesWidget = createView(QLatin1String("Notes"), Trip::NotesCollectionRole);
m_mailWidget = createView(QStringLiteral("Mail"), Trip::MailCollectionRole);
m_todoWidget = createView(QStringLiteral("Todos"), Trip::TodoCollectionRole);
m_notesWidget = createView(QStringLiteral("Notes"), Trip::NotesCollectionRole);
configureLayout->addWidget(m_mailWidget);
configureLayout->addWidget(m_todoWidget);
......
......@@ -29,7 +29,7 @@
int main(int argc, char **argv)
{
const QString ba(QLatin1String("coisceim"));
const QString ba(QStringLiteral("coisceim"));
const QString name = i18n("Coisceim application");
KAboutData aboutData(ba, name, name);
QApplication app(argc, argv);
......
......@@ -74,7 +74,7 @@ QVariant MixedTreeModel::entityData(const Akonadi::Item &item, int column, int r
if (item.mimeType() == KMime::Message::mimeType()) {
return message->from()->asUnicodeString();
} else {
return QString(message->mainBodyPart()->decodedText().mid(0, 30) + QLatin1String("..."));
return QString(message->mainBodyPart()->decodedText().mid(0, 30) + QStringLiteral("..."));
}
default:
return QVariant();
......
......@@ -23,5 +23,5 @@ using namespace Akonotes;
QString Note::mimeType()
{
return QString::fromLatin1("text/x-vnd.akonadi.note");
return QStringLiteral("text/x-vnd.akonadi.note");
}
......@@ -95,7 +95,7 @@ QVariant TripModel::data(const QModelIndex &index, int role) const
return QVariant::fromValue<QWidget *>(m_createWidget);
}
if (role == Qt::DecorationRole) {
return QIcon::fromTheme(QLatin1String("list-add-new"));
return QIcon::fromTheme(QStringLiteral("list-add-new"));
}
return QVariant();
}
......
......@@ -67,9 +67,9 @@ TripWidget::TripWidget(Trip *trip, QWidget *parent)
vSplitter->addWidget(splitter);
FolderContentsWidget *mailWidget = createView(QLatin1String("Mail"), Trip::MailCollectionRole);
FolderContentsWidget *todoWidget = createView(QLatin1String("Todos"), Trip::TodoCollectionRole);
FolderContentsWidget *notesWidget = createView(QLatin1String("Notes"), Trip::NotesCollectionRole);
FolderContentsWidget *mailWidget = createView(QStringLiteral("Mail"), Trip::MailCollectionRole);
FolderContentsWidget *todoWidget = createView(QStringLiteral("Todos"), Trip::TodoCollectionRole);
FolderContentsWidget *notesWidget = createView(QStringLiteral("Notes"), Trip::NotesCollectionRole);
ItemSelection *itemSelection = new ItemSelection(mailWidget->selectionModel(),
todoWidget->selectionModel(),
......
......@@ -80,7 +80,7 @@ Checkable2::Checkable2(QWidget *parent, Qt::WindowFlags f)
allChildrenView->setModel(selectionProxy);
Akonadi::EntityMimeTypeFilterModel *itemFilter = new Akonadi::EntityMimeTypeFilterModel(this);
itemFilter->setObjectName(QLatin1String("itemFilter"));
itemFilter->setObjectName(QStringLiteral("itemFilter"));
itemFilter->addMimeTypeExclusionFilter(Akonadi::Collection::mimeType());
itemFilter->setHeaderGroup(Akonadi::EntityTreeModel::ItemListHeaders);
itemFilter->setSourceModel(selectionProxy);
......
......@@ -56,8 +56,8 @@ EntityFindingWidget::EntityFindingWidget(QWidget *parent, Qt::WindowFlags f)
{
QGridLayout *gridLayout = new QGridLayout(this);
QLabel *collectionIdLabel = new QLabel(QLatin1String("Collection Id :"));
QLabel *itemIdLabel = new QLabel(QLatin1String("Item Id :"));
QLabel *collectionIdLabel = new QLabel(QStringLiteral("Collection Id :"));
QLabel *itemIdLabel = new QLabel(QStringLiteral("Item Id :"));
m_collectionIdInput = new QLineEdit;
m_itemIdInput = new QLineEdit;
......
......@@ -89,7 +89,7 @@ void EntityTreeWidget::mimeTypesChoiceChanged(int index)
void EntityTreeWidget::mimeTypesChanged(const QString &mimetypeList)
{
const QStringList list = mimetypeList.isEmpty() ? QStringList() : mimetypeList.split(QLatin1String(","));
const QStringList list = mimetypeList.isEmpty() ? QStringList() : mimetypeList.split(QStringLiteral(","));
foreach (const QString mimetype, m_monitor->mimeTypesMonitored()) {
if (!list.contains(mimetype)) {
......
......@@ -35,8 +35,8 @@ public:
MailModelPrivate(MailModel *model)
: q_ptr(model)
{
m_collectionHeaders << QLatin1String("Folder") << QLatin1String("Count");
m_itemHeaders << QLatin1String("Subject") << QLatin1String("From") << QLatin1String("Date");
m_collectionHeaders << QStringLiteral("Folder") << QStringLiteral("Count");
m_itemHeaders << QStringLiteral("Subject") << QStringLiteral("From") << QStringLiteral("Date");
}
Q_DECLARE_PUBLIC(MailModel)
......
......@@ -29,14 +29,14 @@
int main(int argc, char *argv[])
{
KAboutData aboutData(QLatin1String("etm_usage"),
KAboutData aboutData(QStringLiteral("etm_usage"),
i18n("ETM Test application"),
QLatin1String("0.99"),
QStringLiteral("0.99"),
i18n("Test app for EntityTreeModel"),
KAboutLicense::GPL,
QLatin1String("http://pim.kde.org/akonadi/"));
QApplication::setWindowIcon(QIcon::fromTheme(QLatin1String("akonadi")));
aboutData.addAuthor(i18n("Stephen Kelly"), i18n("Author"), QLatin1String("steveire@gmail.com"));
QStringLiteral("http://pim.kde.org/akonadi/"));
QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("akonadi")));
aboutData.addAuthor(i18n("Stephen Kelly"), i18n("Author"), QStringLiteral("steveire@gmail.com"));
QApplication app(argc, argv);
QCommandLineParser parser;
......
......@@ -48,21 +48,21 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags)
Akonadi::Control::start();
tabWidget->addTab(new Checkable2(tabWidget), QLatin1String("Checkable2"));
tabWidget->addTab(new DescTabWidget(tabWidget), QLatin1String("Desc"));
tabWidget->addTab(new Tab1Widget(tabWidget), QLatin1String("EntityTreeModel"));
tabWidget->addTab(new Tab2Widget(tabWidget), QLatin1String("setRootIndex"));
tabWidget->addTab(new Tab2_5Widget(tabWidget), QLatin1String("Type specific data"));
tabWidget->addTab(new Tab3Widget(tabWidget), QLatin1String("KSelectionProxyModel"));
tabWidget->addTab(new Tab4Widget(tabWidget), QLatin1String("KSelectionProxyModel Filtered"));
tabWidget->addTab(new Tab6Widget(tabWidget), QLatin1String("Checkable Collections"));
tabWidget->addTab(new Tab5Widget(tabWidget), QLatin1String("Categorized Items"));
tabWidget->addTab(new Tab7Widget(tabWidget), QLatin1String("Tagged Items"));
tabWidget->addTab(new UnreadMailsWidget(tabWidget), QLatin1String("Unread Mails"));
tabWidget->addTab(new RecursiveItemListWidget(tabWidget), QLatin1String("Items only"));
tabWidget->addTab(new EntityFindingWidget(tabWidget), QLatin1String("Find entities"));
tabWidget->addTab(new CollectionMonitoredWidget(tabWidget), QLatin1String("SetCollectionMonitored"));
tabWidget->addTab(new UnreadMailsInCollectionsWidget(tabWidget), QLatin1String("UnreadMails"));
tabWidget->addTab(new Checkable2(tabWidget), QStringLiteral("Checkable2"));
tabWidget->addTab(new DescTabWidget(tabWidget), QStringLiteral("Desc"));
tabWidget->addTab(new Tab1Widget(tabWidget), QStringLiteral("EntityTreeModel"));
tabWidget->addTab(new Tab2Widget(tabWidget), QStringLiteral("setRootIndex"));
tabWidget->addTab(new Tab2_5Widget(tabWidget), QStringLiteral("Type specific data"));
tabWidget->addTab(new Tab3Widget(tabWidget), QStringLiteral("KSelectionProxyModel"));
tabWidget->addTab(new Tab4Widget(tabWidget), QStringLiteral("KSelectionProxyModel Filtered"));
tabWidget->addTab(new Tab6Widget(tabWidget), QStringLiteral("Checkable Collections"));
tabWidget->addTab(new Tab5Widget(tabWidget), QStringLiteral("Categorized Items"));
tabWidget->addTab(new Tab7Widget(tabWidget), QStringLiteral("Tagged Items"));
tabWidget->addTab(new UnreadMailsWidget(tabWidget), QStringLiteral("Unread Mails"));
tabWidget->addTab(new RecursiveItemListWidget(tabWidget), QStringLiteral("Items only"));
tabWidget->addTab(new EntityFindingWidget(tabWidget), QStringLiteral("Find entities"));
tabWidget->addTab(new CollectionMonitoredWidget(tabWidget), QStringLiteral("SetCollectionMonitored"));
tabWidget->addTab(new UnreadMailsInCollectionsWidget(tabWidget), QStringLiteral("UnreadMails"));
setCentralWidget(tabWidget);
}
......@@ -71,7 +71,7 @@ QVariant MixedTreeModel::entityData(const Akonadi::Item &item, int column, int r
if (item.mimeType() == KMime::Message::mimeType()) {
return message->from()->asUnicodeString();
} else {
return QString(message->mainBodyPart()->decodedText().mid(0, 30) + QLatin1String("..."));
return QString(message->mainBodyPart()->decodedText().mid(0, 30) + QStringLiteral("..."));
}
default:
return QVariant();
......
......@@ -106,7 +106,7 @@ Tab6Widget::Tab6Widget(QWidget *parent, Qt::WindowFlags f)
selectionProxy->setSourceModel(m_etw->model());
Akonadi::EntityMimeTypeFilterModel *itemFilter = new Akonadi::EntityMimeTypeFilterModel(this);
itemFilter->setObjectName(QLatin1String("itemFilter"));
itemFilter->setObjectName(QStringLiteral("itemFilter"));
itemFilter->addMimeTypeExclusionFilter(Akonadi::Collection::mimeType());
itemFilter->setHeaderGroup(Akonadi::EntityTreeModel::ItemListHeaders);
itemFilter->setSourceModel(selectionProxy);
......
......@@ -97,7 +97,7 @@ Tab7Widget::Tab7Widget(QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f)
{
EntityTreeModelFactory *modelFactory = new CategorisedEntityModelFactory(this);
modelFactory->createFromRemoteId(QLatin1String("nepomuktags"));
modelFactory->createFromRemoteId(QStringLiteral("nepomuktags"));
connect(modelFactory, &CategorisedEntityModelFactory::modelCreated, this, &Tab7Widget::initModel);
}
......
......@@ -82,7 +82,7 @@ UnreadMailsInCollectionsWidget::UnreadMailsInCollectionsWidget(QWidget *parent,
: QWidget(parent, f)
{
QVBoxLayout *layout = new QVBoxLayout(this);
QPushButton *configureButton = new QPushButton(QLatin1String("Configure"));
QPushButton *configureButton = new QPushButton(QStringLiteral("Configure"));
connect(configureButton, SIGNAL(clicked(bool)), SLOT(configure()));
layout->addWidget(configureButton);
......
......@@ -89,7 +89,7 @@ void Dialog::save()
int main(int argc, char **argv)
{
KAboutData aboutData(QLatin1String("kabceditor"), i18n("KABC Editor"), QLatin1String("1.0"));
KAboutData aboutData(QStringLiteral("kabceditor"), i18n("KABC Editor"), QStringLiteral("1.0"));
aboutData.setShortDescription(i18n("A contact editor for Akonadi"));
QApplication app(argc, argv);
QCommandLineParser parser;
......
......@@ -61,7 +61,7 @@ void Dialog::loadUid(Akonadi::Item::Id uid)
int main(int argc, char **argv)
{
KAboutData aboutData(QLatin1String("kabcviewer"), i18n("KABC Viewer"), QLatin1String("1.0"));
KAboutData aboutData(QStringLiteral("kabcviewer"), i18n("KABC Viewer"), QStringLiteral("1.0"));
aboutData.setShortDescription(i18n("A contact viewer for Akonadi"));
QApplication app(argc, argv);
QCommandLineParser parser;
......@@ -72,15 +72,15 @@ int main(int argc, char **argv)
parser.process(app);
aboutData.processCommandLine(&parser);
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("uid"), i18n("Uid of the Akonadi contact"), QLatin1String("uid")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("uid"), i18n("Uid of the Akonadi contact"), QStringLiteral("uid")));
Dialog dlg;
if (!parser.isSet(QLatin1String("uid"))) {
if (!parser.isSet(QStringLiteral("uid"))) {
parser.showHelp();
return 1;
}
dlg.loadUid(parser.value(QLatin1String("uid")).toLongLong());
dlg.loadUid(parser.value(QStringLiteral("uid")).toLongLong());
dlg.exec();
return 0;
......
......@@ -70,7 +70,7 @@ void mailreader::setupDocks()
monitor->setSession(session);
monitor->setCollectionMonitored(Akonadi::Collection::root());
monitor->fetchCollection(true);
monitor->setMimeTypeMonitored(QLatin1String("message/rfc822"), true);
monitor->setMimeTypeMonitored(QStringLiteral("message/rfc822"), true);
monitor->itemFetchScope().fetchPayloadPart(Akonadi::MessagePart::Header);
Akonadi::EntityTreeModel *entityModel = new Akonadi::EntityTreeModel(monitor, this);
......@@ -107,14 +107,14 @@ void mailreader::setupDocks()
// Dock the message list view
QDockWidget *messageListDock = new QDockWidget(i18n("Messages"), this);
messageListDock->setObjectName(QLatin1String("Messages"));
messageListDock->setObjectName(QStringLiteral("Messages"));
messageListDock->setWidget(m_messagePane);
messageListDock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
addDockWidget(Qt::TopDockWidgetArea, messageListDock);
// Dock the folder tree view
QDockWidget *folderDock = new QDockWidget(i18n("Folders"), this);
folderDock->setObjectName(QLatin1String("Folders"));
folderDock->setObjectName(QStringLiteral("Folders"));
folderDock->setWidget(collectionView);
folderDock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
addDockWidget(Qt::LeftDockWidgetArea, folderDock);
......@@ -132,17 +132,17 @@ void mailreader::setupActions()
KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollection());
KStandardAction::preferences(m_view, SLOT(slotConfigure()), actionCollection());
QAction *createTab = new QAction(QIcon::fromTheme(QLatin1String("tab-new")),
QAction *createTab = new QAction(QIcon::fromTheme(QStringLiteral("tab-new")),
i18n("Open a new tab"),
this);
actionCollection()->addAction(QLatin1String("new_tab"), createTab);
actionCollection()->addAction(QStringLiteral("new_tab"), createTab);
connect(createTab, &QAction::triggered, m_messagePane, &MessageList::Pane::createNewTab);
m_previousMessage = new QAction(i18n("Previous Message"), this);
actionCollection()->addAction(QLatin1String("previous_message"), m_previousMessage);
actionCollection()->addAction(QStringLiteral("previous_message"), m_previousMessage);
connect(m_previousMessage, &QAction::triggered, this, &mailreader::slotPreviousMessage);
m_nextMessage = new QAction(i18n("Next Message"), this);
actionCollection()->addAction(QLatin1String("next_message"), m_nextMessage);
actionCollection()->addAction(QStringLiteral("next_message"), m_nextMessage);
connect(m_nextMessage, &QAction::triggered, this, &mailreader::slotNextMessage);
}
......
......@@ -74,7 +74,7 @@ void mailreaderView::displayAboutPage()
"<h2 style='margin-top: 0px;'>Welcome to Mailreader %1</h2>"
"<p>Mailread is a proof of concept reader for the Akonadi/KMime framework.</p>\n"
"<p style='margin-bottom: 0px'>&nbsp; &nbsp; <a href='http://pim.kde.org/akonadi'>The Akonadi Team</a></p>")
.subs(QLatin1String("0.1")); // Akonadi Mail Reader version
.subs(QStringLiteral("0.1")); // Akonadi Mail Reader version
//TODO PORT MEm_readerWin->displaySplashPage(info.toString());
}
......
......@@ -23,7 +23,7 @@ int main(int argc, char **argv)
about.setupCommandLine(&parser);
parser.process(app);
about.processCommandLine(&parser);
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("+[URL]"), i18n("Document to open")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("+[URL]"), i18n("Document to open")));
mailreader *widget = new mailreader;
......
......@@ -694,9 +694,9 @@ void CSVImportDialog::saveTemplate()
}
const QString fileName
= QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kaddressbook/csv-templates/")
= QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/kaddressbook/csv-templates/")
+QUuid::createUuid().toString()
+QLatin1String(".desktop");
+QStringLiteral(".desktop");
QFileInfo fileInfo(fileName);
QDir().mkpath(fileInfo.absolutePath());
......
......@@ -108,7 +108,7 @@ void GMXImportExportPluginInterface::exportGMX()
KAddressBookImportExport::KAddressBookImportExportContactList contactLists;
contactLists.setAddressList(contacts);
QFileDialog::Options options = QFileDialog::DontConfirmOverwrite;
QUrl url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QDir::homePath() + QLatin1String("/addressbook.gmx")), GMX_FILESELECTION_STRING, nullptr, options);
QUrl url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QDir::homePath() + QStringLiteral("/addressbook.gmx")), GMX_FILESELECTION_STRING, nullptr, options);
if (url.isEmpty()) {
return;
}
......@@ -500,7 +500,7 @@ void GMXImportExportPluginInterface::importGMX()
addressee->setNickName(itemList.at(1));
addressee->setGivenName(itemList.at(2));
addressee->setFamilyName(itemList.at(3));
addressee->setFormattedName(itemList.at(3) + QLatin1String(", ") + itemList.at(2));
addressee->setFormattedName(itemList.at(3) + QStringLiteral(", ") + itemList.at(2));
addressee->setPrefix(itemList.at(4));
if (checkDateTime(itemList.at(5), dt)) {
addressee->setBirthday(dt);
......
......@@ -154,7 +154,7 @@ void LDifImportExportPluginInterface::exportLdif()
QFileDialog::Options options = QFileDialog::DontConfirmOverwrite;
const QUrl url
= QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QDir::homePath() + QLatin1String("/addressbook.ldif")),
= QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QDir::homePath() + QStringLiteral("/addressbook.ldif")),
i18n("LDif Files (*.ldif)"), nullptr, options);
if (url.isEmpty()) {
return;
......
......@@ -481,7 +481,7 @@ void VCardImportExportPluginInterface::exportVCard()
QString(list[ 0 ].givenName()
+QLatin1Char(QLatin1Char('_'))
+list[ 0 ].familyName()
+QLatin1String(".vcf"))),
+QStringLiteral(".vcf"))),
QString(), nullptr, options);
if (url.isEmpty()) { // user canceled export
return;
......@@ -520,7 +520,7 @@ void VCardImportExportPluginInterface::exportVCard()
for (int i = 0; i < list.count(); ++i) {
const KContacts::Addressee contact = list.at(i);
url = QUrl::fromLocalFile(baseUrl.path() + QLatin1Char('/') + contactFileName(contact) + QLatin1String(".vcf"));
url = QUrl::fromLocalFile(baseUrl.path() + QLatin1Char('/') + contactFileName(contact) + QStringLiteral(".vcf"));
bool tmpOk = false;
......
......@@ -76,7 +76,7 @@ void MailSenderJobTest::shouldSendSignalWhenOneEmail()
QSignalSpy spy(&mailsender, SIGNAL(sendMails(QStringList)));
mailsender.start();
QCOMPARE(spy.count(), 1);
const QStringList resultLst = spy.at(0).at(0).value<QStringList>();
const QStringList resultLst = spy.at(0).at(0).toStringList();
QCOMPARE(resultLst.count(), 1);
}
......@@ -92,7 +92,7 @@ void MailSenderJobTest::shouldNotSendTwiceEmails()
KABMailSender::MailSenderJob mailsender(lst);
QSignalSpy spy(&mailsender, SIGNAL(sendMails(QStringList)));
mailsender.start();
const QStringList resultLst = spy.at(0).at(0).value<QStringList>();
const QStringList resultLst = spy.at(0).at(0).toStringList();
QCOMPARE(resultLst.count(), 1);
}
......@@ -148,7 +148,7 @@ void MailSenderJobTest::shouldEmitSignalIfThereIsAValidEmail()
QSignalSpy spy(&mailsender, SIGNAL(sendMails(QStringList)));
mailsender.start();
QCOMPARE(spy.count(), 1);
const QStringList resultLst = spy.at(0).at(0).value<QStringList>();
const QStringList resultLst = spy.at(0).at(0).toStringList();
QCOMPARE(resultLst.count(), 2);
}
......
......@@ -72,13 +72,13 @@ bool SendVcardsJob::start()
KContacts::adaptIMAttributes(data);
createTemporaryDir();
const QString contactRealName(contact.realName());
const QString attachmentName = (contactRealName.isEmpty() ? QStringLiteral("vcard") : contactRealName) + QLatin1String(".vcf");
const QString attachmentName = (contactRealName.isEmpty() ? QStringLiteral("vcard") : contactRealName) + QStringLiteral(".vcf");
createTemporaryFile(data, attachmentName);
} else if (item.hasPayload<KContacts::ContactGroup>()) {
++mExpandGroupJobCount;
const KContacts::ContactGroup group = item.payload<KContacts::ContactGroup>();
const QString groupName(group.name());
const QString attachmentName = (groupName.isEmpty() ? QStringLiteral("vcard") : groupName) + QLatin1String(".vcf");
const QString attachmentName = (groupName.isEmpty() ? QStringLiteral("vcard") : groupName) + QStringLiteral(".vcf");
Akonadi::ContactGroupExpandJob *expandJob = new Akonadi::ContactGroupExpandJob(group, this);
expandJob->setProperty("groupName", attachmentName);
connect(expandJob, &KJob::result, this, &SendVcardsJob::slotExpandGroupResult);
......@@ -95,7 +95,7 @@ bool SendVcardsJob::start()
void SendVcardsJob::createTemporaryDir()
{
if (!mTempDir) {
mTempDir = new QTemporaryDir(QDir::tempPath() + QLatin1Char('/') + QLatin1String("sendvcards"));
mTempDir = new QTemporaryDir(QDir::tempPath() + QLatin1Char('/') + QStringLiteral("sendvcards"));
mTempDir->setAutoRemove(false);
mAttachmentTemporary->addTempDir(mTempDir->path());
}
......@@ -107,7 +107,7 @@ void SendVcardsJob::jobFinished()
if (!lstAttachment.isEmpty()) {
KToolInvocation::invokeMailer(QString(), QString(), QString(), QString(), QString(), QString(), lstAttachment);
} else {
sendVCardsError(i18n("No vCard created."));
Q_EMIT sendVCardsError(i18n("No vCard created."));
}
mAttachmentTemporary->removeTempFiles();
deleteLater();
......@@ -145,7 +145,7 @@ void SendVcardsJob::createTemporaryFile(const QByteArray &data, const QString &f
QFile file(mTempDir->path() + QLatin1Char('/') + filename);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
qCDebug(KADDRESSBOOK_SENDVCARDS_LOG) << "Cannot write vcard filename :" << filename;
sendVCardsError(i18n("Temporary file \'%1\' cannot be created", filename));
Q_EMIT sendVCardsError(i18n("Temporary file \'%1\' cannot be created", filename));
return;
}
......
......@@ -684,9 +684,9 @@ void AntiSpamWizard::sortFilterOnExistance(
const QString &intendedFilterName, QString &newFilters, QString &replaceFilters)
{
if (uniqueNameFor(intendedFilterName) == intendedFilterName) {
newFilters += QLatin1String("<li>") + intendedFilterName + QLatin1String("</li>");
newFilters += QStringLiteral("<li>") + intendedFilterName + QStringLiteral("</li>");
} else {
replaceFilters += QLatin1String("<li>") + intendedFilterName + QLatin1String("</li>");
replaceFilters += QStringLiteral("<li>") + intendedFilterName + QStringLiteral("</li>");
}
}
......
......@@ -67,7 +67,7 @@ Element::List Hebrew::createDayElements(const QDate &date)
text = cal->formatDate(date, KLocale::Day, KLocale::LongNumber) + QLatin1Char(' ') + cal->monthName(date);
for (const QString &holiday : holidays) {
text += QLatin1String("<br/>\n") + holiday;
text += QStringLiteral("<br/>\n") + holiday;
}
text = i18nc("Change the next two strings if emphasis is done differently in your language.",
......
......@@ -88,7 +88,7 @@ void POTDElement::step1StartDownload()
{
// Start downloading the picture
if (!mFirstStepCompleted && !mFirstStepJob) {
QUrl url = QUrl(QLatin1String("http://en.wikipedia.org/w/index.php?title=Template:POTD/")
QUrl url = QUrl(QStringLiteral("http://en.wikipedia.org/w/index.php?title=Template:POTD/")
+mDate.toString(Qt::ISODate) + QStringLiteral("&action=raw"));
// The file at that URL contains the file name for the POTD
......@@ -155,7 +155,7 @@ void POTDElement::step1Result(KJob *job)
void POTDElement::step2GetImagePage()
{
if (!mSecondStepCompleted && !mSecondStepJob) {
mUrl = QUrl(QLatin1String("http://en.wikipedia.org/wiki/File:") + mFileName);
mUrl = QUrl(QStringLiteral("http://en.wikipedia.org/wiki/File:") + mFileName);
// We'll find the info to get the thumbnail we want on the POTD's image page
Q_EMIT gotNewUrl(mUrl);
......
......@@ -50,7 +50,7 @@ void ShortUrlEngineInterface::setShortUrl(const QString &url)
&& !url.trimmed().startsWith(QStringLiteral("https://"))
&& !url.trimmed().startsWith(QStringLiteral("ftp://"))
&& !url.trimmed().startsWith(QStringLiteral("ftps://"))) {
mOriginalUrl = QLatin1String("http://") + url;
mOriginalUrl = QStringLiteral("http://") + url;