Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 5ee60007 authored by Laurent Montel's avatar Laurent Montel 😁

Fix some warnings

parent 34bf69d0
......@@ -79,7 +79,7 @@ bool Aggregation::load(QDataStream &stream)
}
stream >> val;
mGrouping = (Grouping)val;
mGrouping = static_cast<Grouping>(val);
switch (mGrouping) {
case NoGrouping:
case GroupByDate:
......@@ -92,7 +92,6 @@ bool Aggregation::load(QDataStream &stream)
default:
// b0rken
return false;
break;
}
stream >> val; // Formerly contained group sorting
......@@ -124,7 +123,6 @@ bool Aggregation::load(QDataStream &stream)
default:
// b0rken
return false;
break;
}
stream >> val;
......@@ -138,7 +136,6 @@ bool Aggregation::load(QDataStream &stream)
default:
// b0rken
return false;
break;
}
stream >> val;
......@@ -154,7 +151,6 @@ bool Aggregation::load(QDataStream &stream)
default:
// b0rken
return false;
break;
}
stream >> val; // Formely contained message sorting
......@@ -171,7 +167,6 @@ bool Aggregation::load(QDataStream &stream)
default:
// b0rken
return false;
break;
}
return true;
......
......@@ -3490,7 +3490,6 @@ ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternalForJob(View
case ViewItemJobInterrupted:
// current job interrupted by timeout: propagate status to caller
return ViewItemJobInterrupted;
break;
case ViewItemJobCompleted:
// pass 3 has been completed
job->setCurrentPass(ViewItemJob::Pass4);
......@@ -3519,7 +3518,6 @@ ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternalForJob(View
case ViewItemJobInterrupted:
// current job interrupted by timeout: propagate status to caller
return ViewItemJobInterrupted;
break;
case ViewItemJobCompleted:
// pass 4 has been completed
job->setCurrentPass(ViewItemJob::Pass5);
......@@ -3969,7 +3967,7 @@ void ModelPrivate::viewItemJobStep()
// deal with selection below
break;
default:
qCWarning(MESSAGELIST_LOG) << "ERROR: Unrecognized pre-selection mode " << (int)mPreSelectionMode;
qCWarning(MESSAGELIST_LOG) << "ERROR: Unrecognized pre-selection mode " << static_cast<int>(mPreSelectionMode);
break;
}
......
......@@ -327,7 +327,6 @@ bool SortOrder::isValidMessageSorting(SortOrder::MessageSorting ms)
default:
// b0rken
return false;
break;
}
return true;
......
......@@ -818,9 +818,9 @@ void Theme::Column::save(QDataStream &stream) const
stream << mPixmapName;
stream << mVisibleByDefault;
stream << mIsSenderOrReceiver;
stream << (int)mMessageSorting;
stream << static_cast<int>(mMessageSorting);
stream << (int)mGroupHeaderRows.count();
stream << static_cast<int>(mGroupHeaderRows.count());
int cnt = mGroupHeaderRows.count();
......@@ -830,7 +830,7 @@ void Theme::Column::save(QDataStream &stream) const
}
cnt = mMessageRows.count();
stream << (int)cnt;
stream << static_cast<int>(cnt);
for (int i = 0; i < cnt; ++i) {
Row *row = mMessageRows.at(i);
......@@ -1147,7 +1147,7 @@ bool Theme::load(QDataStream &stream)
int val;
stream >> val;
mGroupHeaderBackgroundMode = (GroupHeaderBackgroundMode)val;
mGroupHeaderBackgroundMode = static_cast<GroupHeaderBackgroundMode>(val);
switch (mGroupHeaderBackgroundMode) {
case Transparent:
case AutoColor:
......@@ -1157,13 +1157,12 @@ bool Theme::load(QDataStream &stream)
default:
qCDebug(MESSAGELIST_LOG) << "Invalid theme group header background mode";
return false; // b0rken
break;
}
stream >> mGroupHeaderBackgroundColor;
stream >> val;
mGroupHeaderBackgroundStyle = (GroupHeaderBackgroundStyle)val;
mGroupHeaderBackgroundStyle = static_cast<GroupHeaderBackgroundStyle>(val);
switch (mGroupHeaderBackgroundStyle) {
case PlainRect:
case PlainJoinedRect:
......@@ -1178,7 +1177,6 @@ bool Theme::load(QDataStream &stream)
default:
qCDebug(MESSAGELIST_LOG) << "Invalid theme group header background style";
return false; // b0rken
break;
}
stream >> val;
......@@ -1191,7 +1189,6 @@ bool Theme::load(QDataStream &stream)
default:
qCDebug(MESSAGELIST_LOG) << "Invalid theme view header policy";
return false; // b0rken
break;
}
if (themeVersion >= gThemeMinimumVersionWithIconSizeField) {
......
......@@ -154,27 +154,27 @@ void AggregationEditor::commit()
mCurrentAggregation->setDescription(descriptionEdit()->toPlainText());
mCurrentAggregation->setGrouping(
(Aggregation::Grouping)ComboBoxUtils::getIntegerOptionComboValue(mGroupingCombo, 0)
static_cast<Aggregation::Grouping>(ComboBoxUtils::getIntegerOptionComboValue(mGroupingCombo, 0))
);
mCurrentAggregation->setGroupExpandPolicy(
(Aggregation::GroupExpandPolicy)ComboBoxUtils::getIntegerOptionComboValue(mGroupExpandPolicyCombo, 0)
static_cast<Aggregation::GroupExpandPolicy>(ComboBoxUtils::getIntegerOptionComboValue(mGroupExpandPolicyCombo, 0))
);
mCurrentAggregation->setThreading(
(Aggregation::Threading)ComboBoxUtils::getIntegerOptionComboValue(mThreadingCombo, 0)
static_cast<Aggregation::Threading>(ComboBoxUtils::getIntegerOptionComboValue(mThreadingCombo, 0))
);
mCurrentAggregation->setThreadLeader(
(Aggregation::ThreadLeader)ComboBoxUtils::getIntegerOptionComboValue(mThreadLeaderCombo, 0)
static_cast<Aggregation::ThreadLeader>(ComboBoxUtils::getIntegerOptionComboValue(mThreadLeaderCombo, 0))
);
mCurrentAggregation->setThreadExpandPolicy(
(Aggregation::ThreadExpandPolicy)ComboBoxUtils::getIntegerOptionComboValue(mThreadExpandPolicyCombo, 0)
static_cast<Aggregation::ThreadExpandPolicy>(ComboBoxUtils::getIntegerOptionComboValue(mThreadExpandPolicyCombo, 0))
);
mCurrentAggregation->setFillViewStrategy(
(Aggregation::FillViewStrategy)ComboBoxUtils::getIntegerOptionComboValue(mFillViewStrategyCombo, 0)
static_cast<Aggregation::FillViewStrategy>(ComboBoxUtils::getIntegerOptionComboValue(mFillViewStrategyCombo, 0))
);
}
......
......@@ -418,7 +418,7 @@ void Widget::viewDropEvent(QDropEvent *e)
action = DragCopy;
} else {
action = DragCancel;
int keybstate = QApplication::keyboardModifiers();
const auto keybstate = QApplication::keyboardModifiers();
if (keybstate & Qt::CTRL) {
action = DragCopy;
} else if (keybstate & Qt::SHIFT) {
......
......@@ -96,10 +96,10 @@ void BackOffModeManagerPrivate::load()
KConfigGroup grp = phishingurlKConfig.group(QStringLiteral("BackOffMode"));
isInOffMode = grp.readEntry("Enabled", false);
if (isInOffMode) {
const uint delay = grp.readEntry("Delay", 0);
const uint now = QDateTime::currentDateTimeUtc().toSecsSinceEpoch();
const qint64 delay = grp.readEntry("Delay", 0);
const qint64 now = QDateTime::currentDateTimeUtc().toSecsSinceEpoch();
if (delay > now) {
const int diff = (delay - now);
const qint64 diff = (delay - now);
updateTimer(diff);
} else {
//Disable mode.
......
......@@ -34,7 +34,7 @@ public:
~WebEngineManageScript();
void addScript(QWebEngineProfile *profile, const QString &source, const QString &scriptName, QWebEngineScript::InjectionPoint injectionPoint);
static qint32 scriptWordId()
static quint32 scriptWordId()
{
return QWebEngineScript::UserWorld + 1;
}
......
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