Commit e0f86a20 authored by Laurent Montel's avatar Laurent Montel 😁

Fix clazy warning

parent a37f9e9d
Pipeline #32197 failed with stage
in 60 minutes and 6 seconds
......@@ -93,7 +93,7 @@ void ImportWindowContactTest::shouldImportWindowContact()
}
qDebug() << " EXPECTED";
for (const KContacts::Addressee &address : result) {
for (const KContacts::Addressee &address : qAsConst(result)) {
qDebug() << "Data: " << address.toString();
}
}
......
......@@ -54,7 +54,7 @@ Element::List Picoftheday::createDayElements(const QDate &date)
////////////////////////////////////////////////////////////////////////////////
POTDElement::POTDElement(const QString &id, const QDate &date, const QSize &initialThumbSize)
POTDElement::POTDElement(const QString &id, QDate date, QSize initialThumbSize)
: StoredElement(id)
, mDate(date)
, mThumbSize(initialThumbSize)
......@@ -340,7 +340,7 @@ QPixmap POTDElement::newPixmap(const QSize &size)
return mPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
void POTDElement::setThumbnailSize(const QSize &size)
void POTDElement::setThumbnailSize(QSize size)
{
mThumbSize = size;
}
......@@ -46,13 +46,12 @@ class POTDElement : public StoredElement
Q_OBJECT
public:
POTDElement(const QString &id, const QDate &date, const QSize &initialThumbSize);
POTDElement(const QString &id, QDate date, QSize initialThumbSize);
~POTDElement()
{
}
void setDate(const QDate &date);
void setThumbnailSize(const QSize &size);
void setThumbnailSize(QSize size);
/** @reimp from Element */
QPixmap newPixmap(const QSize &size) override;
......
......@@ -1084,7 +1084,7 @@ public:
return stat;
}
void showCalendar(const QDate &date) const
void showCalendar(QDate date) const
{
// If korganizer or kontact is running, bring it to the front. Otherwise start korganizer.
if (KontactInterface::PimUniqueApplication::activateApplication(QStringLiteral("korganizer"))) {
......
......@@ -189,6 +189,7 @@ bool ItineraryRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, Me
data.insert(QStringLiteral("groupId"), i);
QVector<QVariant> reservations;
reservations.reserve(d.reservations.count());
for (const auto &r : d.reservations) {
QVariantMap m;
m.insert(QStringLiteral("reservation"), r);
......@@ -231,6 +232,6 @@ bool ItineraryRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, Me
dynamic_cast<GrantleeTheme::Engine *>(const_cast<Grantlee::Engine *>(t->engine()))->localizer()->setApplicationDomain(QByteArrayLiteral("messageviewer_semantic_plugin"));
Grantlee::OutputStream s(htmlWriter->stream());
t->render(&s, &c);
dynamic_cast<GrantleeTheme::Engine *>(const_cast<Grantlee::Engine *>(t->engine()))->localizer()->setApplicationDomain(QByteArrayLiteral("libmessageviewer"));
qobject_cast<GrantleeTheme::Engine *>(const_cast<Grantlee::Engine *>(t->engine()))->localizer()->setApplicationDomain(QByteArrayLiteral("libmessageviewer"));
return false; // yes, false, we want the rest of the email rendered normally after this
}
......@@ -169,7 +169,7 @@ ItineraryMemento *ItineraryUrlHandler::memento(MimeTreeParser::Interface::BodyPa
return dynamic_cast<ItineraryMemento *>(nodeHelper->bodyPartMemento(node->topLevel(), ItineraryMemento::identifier()));
}
void ItineraryUrlHandler::showCalendar(const QDate &date) const
void ItineraryUrlHandler::showCalendar(QDate date) const
{
// ensure KOrganizer or Kontact are running
if (KontactInterface::PimUniqueApplication::activateApplication(QStringLiteral("korganizer"))) {
......
......@@ -31,7 +31,7 @@ public:
static bool hasItineraryApp();
private:
ItineraryMemento *memento(MimeTreeParser::Interface::BodyPart *part) const;
void showCalendar(const QDate &date) const;
void showCalendar(QDate date) const;
void addToCalendar(ItineraryMemento *memento) const;
void openInApp(MimeTreeParser::Interface::BodyPart *part) const;
void openWithKDEConnect(MimeTreeParser::Interface::BodyPart *part, const QString &deviceId) const;
......
......@@ -107,7 +107,8 @@ void GrantleeHeaderStylePluginTest::testThemeActivation()
QVERIFY(interface->mThemeManager->themes().contains(themeName));
for (const auto &action : act->actions()) {
const auto actions = act->actions();
for (const auto &action : actions) {
if (action->data() == themeName) {
action->trigger();
break;
......
......@@ -79,12 +79,12 @@ QTime EventDateTimeWidget::time() const
return mTimeEdit->time();
}
void EventDateTimeWidget::setTime(const QTime &time)
void EventDateTimeWidget::setTime(QTime time)
{
mTimeEdit->setTime(time);
}
void EventDateTimeWidget::setDate(const QDate &date)
void EventDateTimeWidget::setDate(QDate date)
{
mDateEdit->setDate(date);
}
......@@ -26,8 +26,8 @@ public:
QDate date() const;
QTime time() const;
void setTime(const QTime &time);
void setDate(const QDate &date);
void setTime(QTime time);
void setDate(QDate date);
Q_SIGNALS:
void dateTimeChanged(const QDateTime &dateTime);
......
......@@ -25,7 +25,7 @@ template<typename Visitor>
class TestableVisitor : public Visitor
{
public:
TestableVisitor(PimDataSource *source, const QDate &start = QDate(), const QDate &end = QDate())
TestableVisitor(PimDataSource *source, QDate start = QDate(), QDate end = QDate())
: Visitor(source, start, end)
{
}
......@@ -35,7 +35,7 @@ public:
return Visitor::generateUid(incidence, recurrenceId);
}
bool callIsInRange(const QDate &start, const QDate &end) const
bool callIsInRange(QDate start, QDate end) const
{
return Visitor::isInRange(start, end);
}
......
......@@ -167,7 +167,7 @@ void PimEventsPluginTest::testEventModified()
QVERIFY(source.calendar()->addEvent(event));
QCOMPARE(eventModifiedSpy.size(), 1);
const auto result = eventModifiedSpy.takeFirst().first().value<CalendarEvents::EventData>();
const auto result = eventModifiedSpy.takeFirst().constFirst().value<CalendarEvents::EventData>();
// TODO: Test for other property changes too?
QCOMPARE(result.title(), event->summary());
QCOMPARE(result.uid(), expectedData[0].uid());
......
......@@ -9,7 +9,7 @@
#include "pimdatasource.h"
#include "pimeventsplugin_debug.h"
BaseEventDataVisitor::BaseEventDataVisitor(PimDataSource *dataSource, const QDate &start, const QDate &end)
BaseEventDataVisitor::BaseEventDataVisitor(PimDataSource *dataSource, QDate start, QDate end)
: mDataSource(dataSource)
, mStart(start)
, mEnd(end)
......@@ -43,7 +43,7 @@ bool BaseEventDataVisitor::act(const KCalendarCore::Todo::List &todos)
return ok;
}
bool BaseEventDataVisitor::isInRange(const QDate &start, const QDate &end) const
bool BaseEventDataVisitor::isInRange(QDate start, QDate end) const
{
if (!mStart.isValid() || !mEnd.isValid()) {
return true;
......@@ -185,7 +185,7 @@ CalendarEvents::EventData EventDataVisitor::incidenceData(const KCalendarCore::I
return data;
}
EventDataIdVisitor::EventDataIdVisitor(PimDataSource *dataSource, const QDate &start, const QDate &end)
EventDataIdVisitor::EventDataIdVisitor(PimDataSource *dataSource, QDate start, QDate end)
: BaseEventDataVisitor(dataSource, start, end)
{
}
......
......@@ -23,10 +23,10 @@ public:
bool act(const KCalendarCore::Todo::List &todos);
protected:
BaseEventDataVisitor(PimDataSource *dataSource, const QDate &start, const QDate &end);
BaseEventDataVisitor(PimDataSource *dataSource, QDate start, QDate end);
QString generateUid(const KCalendarCore::Incidence::Ptr &incidence, const QDateTime &recurrenceId = {}) const;
bool isInRange(const QDate &start, const QDate &end) const;
bool isInRange(QDate start, QDate end) const;
QVector<CalendarEvents::EventData> explodeIncidenceOccurences(const CalendarEvents::EventData &ed, const KCalendarCore::Incidence::Ptr &incidence, bool &ok);
protected:
......@@ -68,7 +68,7 @@ private:
class EventDataIdVisitor : public BaseEventDataVisitor
{
public:
explicit EventDataIdVisitor(PimDataSource *dataSource, const QDate &start, const QDate &end);
explicit EventDataIdVisitor(PimDataSource *dataSource, QDate start, QDate end);
const QStringList &results() const;
......
......@@ -10,7 +10,7 @@
#include <QWidget>
class QWebEngineView;
namespace AdBlock {
class AdBlockResult;
struct AdBlockResult;
}
class AdblockBlockableElementGui : public QWidget
......
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