Commit 8bc600d2 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix clazy warning

parent ace9cda3
......@@ -179,7 +179,7 @@ bool QCsvModel::load(QIODevice *device)
return true;
}
void QCsvModel::setTextQuote(const QChar &textQuote)
void QCsvModel::setTextQuote(QChar textQuote)
{
const bool isRunning = d->mParser->isRunning();
......
......@@ -46,7 +46,7 @@ public:
/**
* Sets the character that is used for quoting. The default is '"'.
*/
void setTextQuote(const QChar &textQuote);
void setTextQuote(QChar textQuote);
/**
* Returns the character that is used for quoting.
......
......@@ -94,7 +94,9 @@ void GravatarUpdateJob::updatePixmap(const QPixmap &pix)
{
if (mItem.hasPayload<KContacts::Addressee>()) {
KContacts::Addressee contact = mItem.payload<KContacts::Addressee>();
contact.photo().setData(pix.toImage());
KContacts::Picture pic = contact.photo();
pic.setData(pix.toImage());
contact.setPhoto(pic);
mItem.setPayload<KContacts::Addressee>(contact);
// save the new item in akonadi storage
......
......@@ -47,7 +47,7 @@ SendmailJob::~SendmailJob()
void SendmailJob::doStart()
{
const QStringList arguments = QStringList() << QLatin1String("-i") << QLatin1String("-f") << sender() << to() << cc() << bcc();
const QStringList arguments = QStringList() << QStringLiteral("-i") << QStringLiteral("-f") << sender() << to() << cc() << bcc();
mProcess->start(transport()->host(), arguments);
if (!mProcess->waitForStarted()) {
......
......@@ -79,9 +79,9 @@ Q_SIGNALS:
void gotNewExtensiveText(const QString &) const;
void gotNewUrl(const QUrl &) const;
// The following three signals are only used internally
void step1Success() const;
void step2Success() const;
void step3Success() const;
void step1Success();
void step2Success();
void step3Success();
protected Q_SLOTS:
void step1StartDownload();
......
......@@ -66,8 +66,6 @@ void RenderTest::testRender()
QFETCH(QString, referenceFileName);
QFETCH(QString, outFileName);
const QString htmlFileName = outFileName + QStringLiteral(".html");
QIcon::setThemeName(QStringLiteral("oxygen"));
// load input mail
......
......@@ -103,8 +103,7 @@ QString FancyHeaderStyle::format(KMime::Message *message) const
const KTextToHTML::Options flags = KTextToHTML::PreserveSpaces | KTextToHTML::ReplaceSmileys;
headerStr += QStringLiteral("<div dir=\"%1\">%2</div>\n")
.arg(subjectDir)
.arg(mHeaderStyleUtil.subjectString(message, flags));
.arg(subjectDir, mHeaderStyleUtil.subjectString(message, flags));
}
headerStr += QLatin1String("<table class=\"outer\"><tr><td width=\"100%\"><table>\n");
//headerStr += "<table>\n";
......@@ -154,8 +153,7 @@ QString FancyHeaderStyle::format(KMime::Message *message) const
headerStr.append(QStringLiteral("<tr><th>%1</th>\n"
"<td>%2</td></tr>\n")
.arg(i18nc("To-field of the mail header.", "To: "))
.arg(to));
.arg(i18nc("To-field of the mail header.", "To: "), to));
}
// cc line, if an
......@@ -166,8 +164,7 @@ QString FancyHeaderStyle::format(KMime::Message *message) const
if (!str.isEmpty()) {
headerStr.append(QStringLiteral("<tr><th>%1</th>\n"
"<td>%2</td></tr>\n")
.arg(i18n("CC: "))
.arg(str));
.arg(i18n("CC: "), str));
}
}
......
......@@ -47,6 +47,7 @@ QStringList TestDataParser::allTestData()
QDir testdir(QStringLiteral(PIMEVENT_DATADIR "/data"));
const auto data = testdir.entryInfoList({ QStringLiteral("*.json") }, QDir::Files);
QStringList testcases;
testcases.reserve(data.count());
for (const auto &fi : data) {
testcases << fi.baseName();
}
......
......@@ -83,15 +83,15 @@ void EventModel::createMonitor()
if (oldIncidence->allDay() != incidence->allDay()
|| oldIncidence->dtStart() != incidence->dtStart()
|| oldIncidence->dateTime(KCalCore::IncidenceBase::RoleEnd) != incidence->dateTime(KCalCore::IncidenceBase::RoleEnd)) {
incidenceChanger()->deleteFinished(0, { item.id() }, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
incidenceChanger()->createFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
Q_EMIT incidenceChanger()->deleteFinished(0, { item.id() }, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
Q_EMIT incidenceChanger()->createFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
} else {
incidenceChanger()->modifyFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
Q_EMIT incidenceChanger()->modifyFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
}
});
connect(mMonitor, &Akonadi::Monitor::itemRemoved,
this, [this](const Akonadi::Item &item) {
incidenceChanger()->deleteFinished(0, { item.id() }, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
Q_EMIT incidenceChanger()->deleteFinished(0, { item.id() }, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
});
connect(mMonitor, &Akonadi::Monitor::collectionRemoved,
this, &EventModel::removeCalendar);
......@@ -156,7 +156,7 @@ void EventModel::onItemsReceived(const Akonadi::Item::List &items)
qCDebug(PIMEVENTSPLUGIN_LOG) << "Batch: received" << items.count() << "items";
for (const auto &item : items) {
if (item.hasPayload<KCalCore::Incidence::Ptr>()) {
incidenceChanger()->createFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
Q_EMIT incidenceChanger()->createFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
} else {
qCDebug(PIMEVENTSPLUGIN_LOG) << "Item" << item.id() << "has no payload";
}
......@@ -181,5 +181,5 @@ void EventModel::removeCollection(const Akonadi::Collection &col)
std::transform(items.cbegin(), items.cend(), std::back_inserter(ids),
std::mem_fn(&Akonadi::Item::id));
incidenceChanger()->deleteFinished(0, ids, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
Q_EMIT incidenceChanger()->deleteFinished(0, ids, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
}
......@@ -23,7 +23,7 @@
#include <QDialog>
#include "adblocklib_export.h"
namespace AdBlock {
class AdBlockResult;
struct AdBlockResult;
class AdBlockBlockableItemsWidget;
class ADBLOCKLIB_EXPORT AdBlockBlockableItemsDialog : public QDialog
{
......
......@@ -26,7 +26,7 @@ namespace PimCommon {
class CustomTreeView;
}
namespace AdBlock {
class AdBlockResult;
struct AdBlockResult;
class ADBLOCKLIB_EXPORT AdBlockBlockableItemsWidget : public QWidget
{
Q_OBJECT
......
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