Commit 5a274a63 authored by David Jarvie's avatar David Jarvie
Browse files

Fix cppcheck warnings

parent 8a05b153
Pipeline #149386 passed with stage
in 3 minutes and 1 second
......@@ -46,7 +46,7 @@ public:
explicit DateTime(const QDateTime& dt);
/** Constructor for a date-time value. */
DateTime(const KADateTime& dt); //krazy:exclude=explicit Allow implicit conversion
DateTime(const KADateTime& dt); //cppcheck-suppress noExplicitConstructor Allow implicit conversion
/** Copy constructor. */
DateTime(const DateTime& dt);
......
......@@ -192,7 +192,7 @@ public:
*
* @param tz time zone
*/
Spec(const QTimeZone& tz); // allow implicit conversion
Spec(const QTimeZone& tz); //cppcheck-suppress noExplicitConstructor Allow implicit conversion
/**
* Constructs a time specification.
......@@ -201,7 +201,7 @@ public:
* @param utcOffset number of seconds to add to UTC to get the local
* time. Ignored if @p type is not @c OffsetFromUTC.
*/
Spec(SpecType type, int utcOffset = 0); // allow implicit conversion
Spec(SpecType type, int utcOffset = 0); //cppcheck-suppress noExplicitConstructor Allow implicit conversion
/**
* Copy constructor.
......
......@@ -71,7 +71,7 @@ public:
};
KARecurrence();
KARecurrence(const KCalendarCore::Recurrence& r); //krazy:exclude=explicit Allow implicit conversion
KARecurrence(const KCalendarCore::Recurrence& r); //cppcheck-suppress noExplicitConstructor Allow implicit conversion
KARecurrence(const KARecurrence& r);
~KARecurrence();
......
......@@ -21,8 +21,8 @@ class AutoQPointer : public QPointer<T>
{
public:
AutoQPointer() = default;
AutoQPointer(T* p) : QPointer<T>(p) {} //cppcheck-suppress noExplicitConstructor
AutoQPointer(const QPointer<T>& p) : QPointer<T>(p) {}
AutoQPointer(T* p) : QPointer<T>(p) {} //cppcheck-suppress noExplicitConstructor Allow implicit conversion
AutoQPointer(const QPointer<T>& p) : QPointer<T>(p) {} //cppcheck-suppress noExplicitConstructor Allow implicit conversion
~AutoQPointer() { delete this->data(); }
AutoQPointer<T>& operator=(const AutoQPointer<T>& p) { QPointer<T>::operator=(p); return *this; }
AutoQPointer<T>& operator=(T* p) { QPointer<T>::operator=(p); return *this; }
......
/*
* packedlayout.h - layout to pack items into rows
* Program: kalarm
* SPDX-FileCopyrightText: 2007-2021 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2007-2022 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
......@@ -43,7 +43,7 @@ public:
QSize sizeHint() const override { return minimumSize(); }
QSize minimumSize() const override;
Qt::Orientations expandingDirections() const override { return Qt::Vertical | Qt::Horizontal; }
void invalidate() override { mWidthCached = mHeightCached = false; }
void invalidate() override { mWidthCached = mHeightCached = 0; }
private:
int arrange(const QRect&, bool set) const;
......@@ -55,7 +55,7 @@ private:
int mHorizontalSpacing {-1}; // default = not set
int mVerticalSpacing {-1}; // default = not set
mutable int mWidthCached {0};
mutable int mHeightCached;
mutable int mHeightCached {0};
};
// vim: et sw=4:
......@@ -210,7 +210,7 @@ void MessageDisplayHelper::initTexts()
// enclosing "Reminder".
QString s = i18nc("@info", "Reminder");
QRegExp re(QStringLiteral("^(<[^>]+>)*")); // search for HTML tag "<...>"
re.indexIn(s);
(void) re.indexIn(s);
// Prefix the time, plus a newline, to "Reminder", inside any HTML tags.
s.insert(re.matchedLength(), mTexts.time + QLatin1String("<br/>"));
mTexts.timeFull = s;
......
Supports Markdown
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