Commit d4e13598 authored by Laurent Montel's avatar Laurent Montel
Browse files

const'ify variables

parent 49983d60
Pipeline #242662 canceled with stage
in 4 minutes and 45 seconds
......@@ -12,7 +12,7 @@ namespace Kolab
{
namespace DateTimeUtils
{
KOLAB_EXPORT std::string getLocalTimezone()
std::string getLocalTimezone()
{
const auto tz = QTimeZone::systemTimeZoneId();
return tz.toStdString();
......
......@@ -45,7 +45,6 @@ Contact::Contact(const KContacts::Addressee *addr)
// loading (xml->addressee)
Contact::Contact(const QString &xml)
: mHasGeo(false)
{
load(xml);
}
......
......@@ -302,7 +302,7 @@ private:
QString mPreferredAddress;
float mLatitude;
float mLongitude;
bool mHasGeo;
bool mHasGeo = false;
struct Custom {
QString app;
QString name;
......
......@@ -53,7 +53,7 @@ void KolabV2::DistributionList::loadDistrListMember(const QDomElement &element)
}
if (n.isElement()) {
QDomElement e = n.toElement();
QString tagName = e.tagName();
const QString tagName = e.tagName();
if (tagName == QLatin1String("display-name")) {
member.displayName = e.text();
} else if (tagName == QLatin1String("smtp-address")) {
......
......@@ -21,9 +21,6 @@ using namespace KolabV2;
Incidence::Incidence(const QString &tz, const KCalendarCore::Incidence::Ptr &incidence)
: KolabBase(tz)
, mFloatingStatus(Unset)
, mHasAlarm(false)
, mPriority(0)
{
Q_UNUSED(incidence)
}
......@@ -153,7 +150,7 @@ bool Incidence::loadAttendeeAttribute(QDomElement &element, Attendee &attendee)
}
if (n.isElement()) {
QDomElement e = n.toElement();
QString tagName = e.tagName();
const QString tagName = e.tagName();
if (tagName == QLatin1String("display-name")) {
attendee.displayName = e.text();
......
......@@ -135,9 +135,9 @@ protected:
QString mLocation;
Email mOrganizer;
QDateTime mStartDate;
FloatingStatus mFloatingStatus;
FloatingStatus mFloatingStatus = Unset;
float mAlarm = 0.0;
bool mHasAlarm;
bool mHasAlarm = false;
Recurrence mRecurrence;
QList<Attendee> mAttendees;
QList<KCalendarCore::Alarm::Ptr> mAlarms;
......@@ -152,6 +152,6 @@ protected:
// This is the KCal priority, not the Kolab priority.
// See kcalPriorityToKolab() and kolabPrioritytoKCal().
int mPriority;
int mPriority = 0;
};
}
......@@ -70,7 +70,7 @@ QDateTime Journal::endDate() const
bool Journal::loadAttribute(QDomElement &element)
{
QString tagName = element.tagName();
const QString tagName = element.tagName();
if (tagName == QLatin1String("summary")) {
setSummary(element.text());
......
......@@ -20,8 +20,6 @@ KolabBase::KolabBase(const QString &tz)
: mCreationDate(QDateTime::currentDateTime())
, mLastModified(QDateTime::currentDateTimeUtc())
, mSensitivity(Public)
, mHasPilotSyncId(false)
, mHasPilotSyncStatus(false)
{
// unlike the previously used KTimeZone here, QTimeZone defaults to local time zone if tz.isEmpty()
// we therefore force it to invalid, which however is unsafe to use (unlike KTimeZone)
......
......@@ -151,7 +151,8 @@ protected:
QTimeZone mTimeZone;
// KPilot synchronization stuff
bool mHasPilotSyncId, mHasPilotSyncStatus;
bool mHasPilotSyncId = false;
bool mHasPilotSyncStatus = false;
unsigned long mPilotSyncId;
int mPilotSyncStatus;
};
......
......@@ -29,7 +29,6 @@ QString Note::journalToXML(const KCalendarCore::Journal::Ptr &journal)
}
Note::Note(const KCalendarCore::Journal::Ptr &journal)
: mRichText(false)
{
if (journal) {
setFields(journal);
......@@ -80,7 +79,7 @@ bool Note::richText() const
bool Note::loadAttribute(QDomElement &element)
{
QString tagName = element.tagName();
const QString tagName = element.tagName();
if (tagName == QLatin1String("summary")) {
setSummary(element.text());
} else if (tagName == QLatin1String("foreground-color")) {
......
......@@ -80,6 +80,6 @@ protected:
QString mSummary;
QColor mBackgroundColor;
QColor mForegroundColor;
bool mRichText;
bool mRichText = false;
};
}
......@@ -31,9 +31,6 @@ Task::Task(const QString &tz, const KCalendarCore::Todo::Ptr &task)
: Incidence(tz, task)
, mPercentCompleted(0)
, mStatus(KCalendarCore::Incidence::StatusNone)
, mHasStartDate(false)
, mHasDueDate(false)
, mHasCompletedDate(false)
{
if (task) {
setFields(task);
......
......@@ -94,12 +94,12 @@ protected:
KCalendarCore::Incidence::Status mStatus;
QString mParent;
bool mHasStartDate;
bool mHasStartDate = false;
bool mHasDueDate;
bool mHasDueDate = false;
QDateTime mDueDate;
bool mHasCompletedDate;
bool mHasCompletedDate = false;
QDateTime mCompletedDate;
};
}
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