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

USe Q_FALLTHROUGH

parent 545e83ab
......@@ -914,6 +914,9 @@ void KAEventPrivate::set(const Event::Ptr &event)
break;
}
// Fall through to AUDIO_ALARM
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case AUDIO_ALARM:
mAudioFile = data.cleanText;
mSpeak = data.speak && mAudioFile.isEmpty();
......@@ -988,6 +991,9 @@ void KAEventPrivate::set(const Event::Ptr &event)
noSetNextTime = true;
}
// fall through to REMINDER_ALARM
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case REMINDER_ALARM:
case AT_LOGIN_ALARM:
case DISPLAYING_ALARM:
......@@ -995,6 +1001,9 @@ void KAEventPrivate::set(const Event::Ptr &event)
mNextMainDateTime = alTime;
}
// fall through to MAIN_ALARM
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case MAIN_ALARM:
// Ensure that the basic fields are set up even if there is no main
// alarm in the event (if it has expired and then been deferred)
......@@ -1008,6 +1017,9 @@ void KAEventPrivate::set(const Event::Ptr &event)
break;
}
// fall through to MESSAGE
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case KAAlarm::MESSAGE:
mFont = data.font;
mUseDefaultFont = data.defaultFont;
......@@ -1015,6 +1027,9 @@ void KAEventPrivate::set(const Event::Ptr &event)
isEmailText = true;
}
// fall through to FILE
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case KAAlarm::FILE:
mBgColour = data.bgColour;
mFgColour = data.fgColour;
......@@ -1545,6 +1560,9 @@ Alarm::Ptr KAEventPrivate::initKCalAlarm(const Event::Ptr &event, int startOffse
alarm->setCustomProperty(KACalendar::APPNAME, NEXT_REPEAT_PROPERTY,
QString::number(mNextRepeat));
// fall through to INVALID_ALARM
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case REMINDER_ALARM:
case INVALID_ALARM: {
if (types == QStringList(REMINDER_TYPE)
......@@ -1558,6 +1576,9 @@ Alarm::Ptr KAEventPrivate::initKCalAlarm(const Event::Ptr &event, int startOffse
case KAEvent::FILE:
alltypes += FILE_TYPE;
// fall through to MESSAGE
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case KAEvent::MESSAGE:
alarm->setDisplayAlarm(AlarmText::toCalendarText(mText));
display = true;
......@@ -3494,6 +3515,9 @@ KAAlarm KAEventPrivate::alarm(KAAlarm::Type type) const
break;
}
// fall through to DEFERRED_ALARM
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case KAAlarm::DEFERRED_ALARM:
if (mDeferral != NO_DEFERRAL) {
al_d->mType = (mDeferral == REMINDER_DEFERRAL) ? KAAlarm::DEFERRED_REMINDER_ALARM : KAAlarm::DEFERRED_ALARM;
......@@ -3569,6 +3593,9 @@ KAAlarm KAEventPrivate::nextAlarm(KAAlarm::Type previousType) const
return alarm(KAAlarm::REMINDER_ALARM);
}
// fall through to REMINDER_ALARM
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case KAAlarm::REMINDER_ALARM:
// There can only be one deferral alarm
if (mDeferral == REMINDER_DEFERRAL) {
......@@ -3578,17 +3605,26 @@ KAAlarm KAEventPrivate::nextAlarm(KAAlarm::Type previousType) const
return alarm(KAAlarm::DEFERRED_ALARM);
}
// fall through to DEFERRED_ALARM
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case KAAlarm::DEFERRED_REMINDER_ALARM:
case KAAlarm::DEFERRED_ALARM:
if (mRepeatAtLogin) {
return alarm(KAAlarm::AT_LOGIN_ALARM);
}
// fall through to AT_LOGIN_ALARM
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case KAAlarm::AT_LOGIN_ALARM:
if (mDisplaying) {
return alarm(KAAlarm::DISPLAYING_ALARM);
}
// fall through to DISPLAYING_ALARM
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case KAAlarm::DISPLAYING_ALARM:
// fall through to default
case KAAlarm::INVALID_ALARM:
......@@ -3632,6 +3668,9 @@ void KAEventPrivate::removeExpiredAlarm(KAAlarm::Type type)
--mAlarmCount;
}
// fall through to AT_LOGIN_ALARM
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case KAAlarm::AT_LOGIN_ALARM:
if (mRepeatAtLogin) {
// Remove the at-login alarm, but keep a note of it for archiving purposes
......@@ -3954,6 +3993,9 @@ void KAEventPrivate::readAlarm(const Alarm::Ptr &alarm, AlarmData &data, bool au
break;
}
// fall through to Display
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case Alarm::Display: {
if (alarm->type() == Alarm::Display) {
data.action = KAAlarm::MESSAGE;
......@@ -4998,6 +5040,9 @@ bool KAEvent::convertKCalEvents(const Calendar::Ptr &calendar, int calendarVersi
case KAAlarm::FILE:
types += KAEventPrivate::FILE_TYPE;
// fall through to MESSAGE
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case KAAlarm::MESSAGE:
alarm->setDisplayAlarm(altxt);
break;
......@@ -5857,6 +5902,9 @@ static void setProcedureAlarm(const Alarm::Ptr &alarm, const QString &commandLin
break;
}
// fall through to default
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
default:
command += ch;
break;
......
......@@ -318,6 +318,9 @@ void KARecurrence::Private::fix()
// Convert an hourly recurrence to a minutely one
rrule->setRecurrenceType(RecurrenceRule::rMinutely);
rrule->setFrequency(rrule->frequency() * 60);
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
// fall through to rMinutely
case Recurrence::rMinutely:
case Recurrence::rDaily:
......@@ -491,6 +494,9 @@ void KARecurrence::Private::writeRecurrence(const KARecurrence *q, Recurrence &r
break;
}
// fall through to rWeekly
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case WEEKLY:
case MONTHLY_POS:
recur.defaultRRule(true)->setByDays(rrule->byDays());
......
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