Commit 018b19fa authored by David Jarvie's avatar David Jarvie
Browse files

Fix spacing

parent b281625e
......@@ -326,7 +326,7 @@ QString KAEventFormatter::value(Parameter param) const
case CustomProperties:
{
if (mEvent.customProperties().isEmpty()) {
return {};
return {};
}
QString value;
const auto customProperties = mEvent.customProperties();
......
......@@ -394,7 +394,7 @@ QString AlarmText::emailHeaders(const QString &text, bool subjectOnly)
const QStringList lines = text.split(QLatin1Char('\n'), Qt::SkipEmptyParts);
const int n = Private::emailHeaderCount(lines);
if (!n) {
return {};
return {};
}
if (subjectOnly) {
return lines[n - 1].mid(Private::mSubjectPrefix.length()).trimmed();
......@@ -556,7 +556,7 @@ QString AlarmText::Private::todoTitle(const QString &text)
;
}
if (!n || n > 3) {
return {};
return {};
}
QString title;
int i = 0;
......
......@@ -19,9 +19,10 @@ class Q_DECL_HIDDEN CollectionAttribute::Private
public:
Private() = default;
bool operator==(const Private &other) const {
return mBackgroundColour == other.mBackgroundColour &&
mEnabled == other.mEnabled && mStandard == other.mStandard &&
mKeepFormat == other.mKeepFormat;
return mBackgroundColour == other.mBackgroundColour
&& mEnabled == other.mEnabled
&& mStandard == other.mStandard
&& mKeepFormat == other.mKeepFormat;
}
QColor mBackgroundColour; // background color for collection and its alarms
......
......@@ -19,7 +19,8 @@ class Q_DECL_HIDDEN CompatibilityAttribute::Private
public:
Private() = default;
bool operator==(KAlarmCal::CompatibilityAttribute::Private other) const {
return mCompatibility == other.mCompatibility && mVersion == other.mVersion;
return mCompatibility == other.mCompatibility
&& mVersion == other.mVersion;
}
KACalendar::Compat mCompatibility{KACalendar::Incompatible}; // calendar compatibility with current KAlarm format
......
......@@ -17,17 +17,17 @@ namespace KAlarmCal
class Q_DECL_HIDDEN DateTime::Private
{
public:
Private() = default;
Private(const QDate &d, const KADateTime::Spec &spec) : mDateTime(d, spec) {}
Private(const QDate &d, const QTime &t, const KADateTime::Spec &spec)
: mDateTime(d, t, spec) {}
Private(const QDateTime &dt, const KADateTime::Spec &spec)
: mDateTime(dt, spec) {}
Private(const QDateTime &dt) : mDateTime(dt) {}
Private(const KADateTime &dt) : mDateTime(dt) {}
static QTime mStartOfDay;
KADateTime mDateTime;
Private() = default;
Private(const QDate &d, const KADateTime::Spec &spec) : mDateTime(d, spec) {}
Private(const QDate &d, const QTime &t, const KADateTime::Spec &spec)
: mDateTime(d, t, spec) {}
Private(const QDateTime &dt, const KADateTime::Spec &spec)
: mDateTime(dt, spec) {}
Private(const QDateTime &dt) : mDateTime(dt) {}
Private(const KADateTime &dt) : mDateTime(dt) {}
static QTime mStartOfDay;
KADateTime mDateTime;
};
QTime DateTime::Private::mStartOfDay;
......
......@@ -425,7 +425,7 @@ QString mimeType(Type type)
case ARCHIVED: return MIME_ARCHIVED;
case TEMPLATE: return MIME_TEMPLATE;
default:
return {};
return {};
}
}
......
This diff is collapsed.
......@@ -371,7 +371,7 @@ public:
QByteArray KAEvent::currentCalendarVersionString()
{
return {"2.7.0"}; // This is NOT the KAlarmCal library .so version!
return {"2.7.0"}; // This is NOT the KAlarmCal library .so version!
}
int KAEvent::currentCalendarVersion()
{
......@@ -977,9 +977,7 @@ KAEventPrivate::KAEventPrivate(const KAEventPrivate &other)
copy(other);
}
KAEvent::KAEvent(const KAEvent &other)
= default;
KAEvent::KAEvent(const KAEvent &other) = default;
KAEvent::~KAEvent() = default;
......@@ -2506,8 +2504,7 @@ DateTime KAEvent::nextTrigger(TriggerType type) const
? (reminderAfter ? d->mAllWorkTrigger : d->mMainWorkTrigger)
: (reminderAfter ? d->mAllTrigger : d->mMainTrigger);
}
default:
return {};
default: return {};
}
}
......@@ -5932,7 +5929,7 @@ QString EmailAddressList::join(const QString &separator) const
QString EmailAddressList::address(int index) const
{
if (index < 0 || index > count()) {
return {};
return {};
}
QString result;
bool quote = false;
......
......@@ -34,12 +34,12 @@ public:
class Q_DECL_HIDDEN KARecurrence::Private
{
public:
Private() = default;
explicit Private(const Recurrence &r) : mRecurrence(r) {}
void clear() {
mRecurrence.clear();
mFeb29Type = Feb29_None;
mCachedType = -1;
Private() = default;
explicit Private(const Recurrence &r) : mRecurrence(r) {}
void clear() {
mRecurrence.clear();
mFeb29Type = Feb29_None;
mCachedType = -1;
}
bool set(Type, int freq, int count, int f29, const KADateTime &start, const KADateTime &end);
bool init(RecurrenceRule::PeriodType, int freq, int count, int feb29Type, const KADateTime &start, const KADateTime &end);
......@@ -68,7 +68,7 @@ QTimeZone KARecurrence::Private::toTimeZone(const KADateTime::Spec &spec)
return QTimeZone(spec.utcOffset());
case KADateTime::Invalid:
default:
return {};
return {};
}
}
......@@ -985,12 +985,12 @@ Duration KARecurrence::longestInterval() const
const int freq = d->mRecurrence.frequency();
switch (type()) {
case MINUTELY:
return {freq * 60, Duration::Seconds};
return {freq * 60, Duration::Seconds};
case DAILY: {
const QList<RecurrenceRule::WDayPos> days = d->mRecurrence.defaultRRuleConst()->byDays();
if (days.isEmpty()) {
return {freq, Duration::Days};
return {freq, Duration::Days};
}
// After applying the frequency, the specified days of the week
......@@ -1027,7 +1027,7 @@ Duration KARecurrence::longestInterval() const
// It will recur on the same day of the week every time.
// Ensure that the day is a day which is not excluded.
if (ds[d->mRecurrence.startDate().dayOfWeek() - 1]) {
return {freq, Duration::Days};
return {freq, Duration::Days};
}
break;
}
......@@ -1059,16 +1059,16 @@ Duration KARecurrence::longestInterval() const
}
const int span = last - first;
if (freq > 1) {
return {freq * 7 - span, Duration::Days};
return {freq * 7 - span, Duration::Days};
}
if (7 - span > maxgap) {
return {7 - span, Duration::Days};
return {7 - span, Duration::Days};
}
return {maxgap, Duration::Days};
}
case MONTHLY_DAY:
case MONTHLY_POS:
return {freq * 31, Duration::Days};
return {freq * 31, Duration::Days};
case ANNUAL_DATE:
case ANNUAL_POS: {
......@@ -1079,7 +1079,7 @@ Duration KARecurrence::longestInterval() const
break; // no months recur
}
if (months.count() == 1) {
return {freq * 365, Duration::Days};
return {freq * 365, Duration::Days};
}
int first = -1;
int last = -1;
......@@ -1097,10 +1097,10 @@ Duration KARecurrence::longestInterval() const
}
const int span = QDate(2001, first, 1).daysTo(QDate(2001, last, 1));
if (freq > 1) {
return {freq * 365 - span, Duration::Days};
return {freq * 365 - span, Duration::Days};
}
if (365 - span > maxgap) {
return {365 - span, Duration::Days};
return {365 - span, Duration::Days};
}
return {maxgap, Duration::Days};
}
......@@ -1120,11 +1120,11 @@ Duration KARecurrence::regularInterval() const
int freq = d->mRecurrence.frequency();
switch (type()) {
case MINUTELY:
return {freq * 60, Duration::Seconds};
return {freq * 60, Duration::Seconds};
case DAILY: {
const QList<RecurrenceRule::WDayPos> days = d->mRecurrence.defaultRRuleConst()->byDays();
if (days.isEmpty()) {
return {freq, Duration::Days};
return {freq, Duration::Days};
}
// After applying the frequency, the specified days of the week
// further restrict when the recurrence occurs.
......@@ -1139,7 +1139,7 @@ Duration KARecurrence::regularInterval() const
// It will recur on the same day of the week every time.
// Check whether that day is in the list of included days.
if (ds[d->mRecurrence.startDate().dayOfWeek() - 1]) {
return {freq, Duration::Days};
return {freq, Duration::Days};
}
break;
}
......@@ -1150,18 +1150,17 @@ Duration KARecurrence::regularInterval() const
}
}
if (n == 7) {
return {freq, Duration::Days}; // every day is included
return {freq, Duration::Days}; // every day is included
}
if (n == 1) {
return {freq * 7,
Duration::Days}; // only one day of the week is included
return {freq * 7, Duration::Days}; // only one day of the week is included
}
break;
}
case WEEKLY: {
const QList<RecurrenceRule::WDayPos> days = d->mRecurrence.defaultRRuleConst()->byDays();
if (days.isEmpty()) {
return {freq * 7, Duration::Days};
return {freq * 7, Duration::Days};
}
// The specified days of the week occur every week in which the
// recurrence occurs.
......@@ -1180,13 +1179,12 @@ Duration KARecurrence::regularInterval() const
}
if (n == 7) {
if (freq == 1) {
return {freq, Duration::Days}; // every day is included
return {freq, Duration::Days}; // every day is included
}
break;
}
if (n == 1) {
return {freq * 7,
Duration::Days}; // only one day of the week is included
return {freq * 7, Duration::Days}; // only one day of the week is included
}
break;
}
......
......@@ -17,13 +17,14 @@ namespace KAlarmCal
class Q_DECL_HIDDEN Repetition::Private
{
public:
Private() = default;
Private(const Duration &interval, int count)
: mInterval(interval), mCount(count) {
if ((!count && !interval.isNull()) || (count && interval.isNull())) {
mCount = 0;
mInterval = 0;
}
Private() = default;
Private(const Duration &interval, int count)
: mInterval(interval)
, mCount(count) {
if ((!count && !interval.isNull()) || (count && interval.isNull())) {
mCount = 0;
mInterval = 0;
}
}
Duration mInterval = 0; // sub-repetition interval
......
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