summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-02-12 13:51:32 +0100
committerLaurent Montel <[email protected]>2018-02-12 13:51:32 +0100
commit5ee600070bf836dc1779372b9fa0618535b268bf (patch)
tree29c9f31204728760b2cfc9c3fd1ce9b861332eae
parent34bf69d01f413cfa011d4d0ba7d758b42621d2cb (diff)
Fix some warnings
-rw-r--r--messagelist/src/core/aggregation.cpp7
-rw-r--r--messagelist/src/core/model.cpp4
-rw-r--r--messagelist/src/core/sortorder.cpp1
-rw-r--r--messagelist/src/core/theme.cpp13
-rw-r--r--messagelist/src/utils/aggregationeditor.cpp12
-rw-r--r--messagelist/src/widget.cpp2
-rw-r--r--webengineviewer/src/checkphishingurl/backoffmodemanager.cpp6
-rw-r--r--webengineviewer/src/webenginemanagescript.h2
8 files changed, 18 insertions, 29 deletions
diff --git a/messagelist/src/core/aggregation.cpp b/messagelist/src/core/aggregation.cpp
index c248f07..55fe583 100644
--- a/messagelist/src/core/aggregation.cpp
+++ b/messagelist/src/core/aggregation.cpp
@@ -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;
diff --git a/messagelist/src/core/model.cpp b/messagelist/src/core/model.cpp
index f58fa99..d0262d1 100644
--- a/messagelist/src/core/model.cpp
+++ b/messagelist/src/core/model.cpp
@@ -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;
}
diff --git a/messagelist/src/core/sortorder.cpp b/messagelist/src/core/sortorder.cpp
index 4e62556..d76efcd 100644
--- a/messagelist/src/core/sortorder.cpp
+++ b/messagelist/src/core/sortorder.cpp
@@ -327,7 +327,6 @@ bool SortOrder::isValidMessageSorting(SortOrder::MessageSorting ms)
default:
// b0rken
return false;
- break;
}
return true;
diff --git a/messagelist/src/core/theme.cpp b/messagelist/src/core/theme.cpp
index ed494dd..7f5223e 100644
--- a/messagelist/src/core/theme.cpp
+++ b/messagelist/src/core/theme.cpp
@@ -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) {
diff --git a/messagelist/src/utils/aggregationeditor.cpp b/messagelist/src/utils/aggregationeditor.cpp
index cbe9b90..632192b 100644
--- a/messagelist/src/utils/aggregationeditor.cpp
+++ b/messagelist/src/utils/aggregationeditor.cpp
@@ -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))
);
}
diff --git a/messagelist/src/widget.cpp b/messagelist/src/widget.cpp
index 87a87ce..aab6218 100644
--- a/messagelist/src/widget.cpp
+++ b/messagelist/src/widget.cpp
@@ -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) {
diff --git a/webengineviewer/src/checkphishingurl/backoffmodemanager.cpp b/webengineviewer/src/checkphishingurl/backoffmodemanager.cpp
index f6d019b..d677e98 100644
--- a/webengineviewer/src/checkphishingurl/backoffmodemanager.cpp
+++ b/webengineviewer/src/checkphishingurl/backoffmodemanager.cpp
@@ -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.
diff --git a/webengineviewer/src/webenginemanagescript.h b/webengineviewer/src/webenginemanagescript.h
index e7a39ff..a490cad 100644
--- a/webengineviewer/src/webenginemanagescript.h
+++ b/webengineviewer/src/webenginemanagescript.h
@@ -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;
}