summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-14 21:55:42 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-14 21:55:42 (GMT)
commit7d95a5ba45da8d82b2a52bb7919240787acf6c8c (patch)
treed03b05dc16c3528ed1a95274f03b40411af0f8fb
parent255473f20374e5c510c06f8250c6d22427b98d09 (diff)
Fix some clazy warningv16.11.80
-rw-r--r--src/filter/dialog/selectthunderbirdfilterfilesdialog.h1
-rw-r--r--src/filter/filteractions/filteractionwidget.cpp8
-rw-r--r--src/filter/kmfilteraccountlist.h1
-rw-r--r--src/job/backupjob.cpp2
-rw-r--r--src/mdn/mdnstateattribute.cpp6
-rw-r--r--src/mdn/mdnstateattribute.h4
-rw-r--r--src/search/searchpatternedit.cpp6
-rw-r--r--src/search/searchrule/searchrulenumerical.cpp4
-rw-r--r--src/search/widgethandler/headersrulerwidgethandler.cpp4
9 files changed, 19 insertions, 17 deletions
diff --git a/src/filter/dialog/selectthunderbirdfilterfilesdialog.h b/src/filter/dialog/selectthunderbirdfilterfilesdialog.h
index 0ce2ff5..1966624 100644
--- a/src/filter/dialog/selectthunderbirdfilterfilesdialog.h
+++ b/src/filter/dialog/selectthunderbirdfilterfilesdialog.h
@@ -26,6 +26,7 @@ namespace MailCommon
class SelectThunderbirdFilterFilesWidget;
class SelectThunderbirdFilterFilesDialog : public QDialog
{
+ Q_OBJECT
public:
explicit SelectThunderbirdFilterFilesDialog(const QString &defaultSettingPath, QWidget *parent);
~SelectThunderbirdFilterFilesDialog();
diff --git a/src/filter/filteractions/filteractionwidget.cpp b/src/filter/filteractions/filteractionwidget.cpp
index 7131528..2e33f62 100644
--- a/src/filter/filteractions/filteractionwidget.cpp
+++ b/src/filter/filteractions/filteractionwidget.cpp
@@ -305,13 +305,13 @@ void FilterActionWidgetLister::setActionList(QList<FilterAction *> *list)
static_cast<QWidget *>(parent())->setEnabled(true);
if (!widgets().isEmpty()) { // move this below next 'if'?
- widgets().first()->blockSignals(true);
+ widgets().constFirst()->blockSignals(true);
}
if (list->isEmpty()) {
slotClear();
- connectWidget(widgets().first(), 0);
- widgets().first()->blockSignals(false);
+ connectWidget(widgets().constFirst(), 0);
+ widgets().constFirst()->blockSignals(false);
return;
}
@@ -337,7 +337,7 @@ void FilterActionWidgetLister::setActionList(QList<FilterAction *> *list)
(aIt != aEnd && wIt != wEnd); ++aIt, ++wIt) {
connectWidget((*wIt), (*aIt));
}
- widgets().first()->blockSignals(false);
+ widgets().constFirst()->blockSignals(false);
updateAddRemoveButton();
}
diff --git a/src/filter/kmfilteraccountlist.h b/src/filter/kmfilteraccountlist.h
index 018642f..be6295b 100644
--- a/src/filter/kmfilteraccountlist.h
+++ b/src/filter/kmfilteraccountlist.h
@@ -23,6 +23,7 @@ namespace MailCommon
class MailFilter;
class KMFilterAccountList : public QTreeWidget
{
+ Q_OBJECT
public:
explicit KMFilterAccountList(QWidget *parent);
~KMFilterAccountList();
diff --git a/src/job/backupjob.cpp b/src/job/backupjob.cpp
index 89cc1e1..9a66b7d 100644
--- a/src/job/backupjob.cpp
+++ b/src/job/backupjob.cpp
@@ -291,7 +291,7 @@ void BackupJob::itemFetchJobResult(KJob *job)
Akonadi::ItemFetchJob *fetchJob = dynamic_cast<Akonadi::ItemFetchJob *>(job);
Q_ASSERT(fetchJob);
Q_ASSERT(fetchJob->items().size() == 1);
- processMessage(fetchJob->items().first());
+ processMessage(fetchJob->items().constFirst());
}
}
diff --git a/src/mdn/mdnstateattribute.cpp b/src/mdn/mdnstateattribute.cpp
index 523f46d..5be42a2 100644
--- a/src/mdn/mdnstateattribute.cpp
+++ b/src/mdn/mdnstateattribute.cpp
@@ -54,7 +54,7 @@ public:
return state;
}
- QByteArray stateToData(const MDNSentState &state)
+ QByteArray stateToData(MDNSentState state)
{
QByteArray data = "U"; // Unknown
@@ -76,7 +76,7 @@ public:
QByteArray mSentState;
};
-MDNStateAttribute::MDNStateAttribute(const MDNSentState &state)
+MDNStateAttribute::MDNStateAttribute(MDNSentState state)
: d(new Private)
{
d->mSentState = d->stateToData(state);
@@ -114,7 +114,7 @@ void MDNStateAttribute::deserialize(const QByteArray &data)
d->mSentState = data;
}
-void MDNStateAttribute::setMDNState(const MDNSentState &state)
+void MDNStateAttribute::setMDNState(MDNSentState state)
{
d->mSentState = d->stateToData(state);
}
diff --git a/src/mdn/mdnstateattribute.h b/src/mdn/mdnstateattribute.h
index d288fad..5bfa527 100644
--- a/src/mdn/mdnstateattribute.h
+++ b/src/mdn/mdnstateattribute.h
@@ -63,7 +63,7 @@ public:
*
* @param state The state the attribute will have.
*/
- explicit MDNStateAttribute(const MDNSentState &state = MDNStateUnknown);
+ explicit MDNStateAttribute(MDNSentState state = MDNStateUnknown);
/**
* Creates a new MDN state attribute.
@@ -100,7 +100,7 @@ public:
/**
* Sets the MDN @p state.
*/
- void setMDNState(const MDNSentState &state);
+ void setMDNState(MDNSentState state);
/**
* Returns the MDN state.
diff --git a/src/search/searchpatternedit.cpp b/src/search/searchpatternedit.cpp
index 3ab20d1..eaf3ae9 100644
--- a/src/search/searchpatternedit.cpp
+++ b/src/search/searchpatternedit.cpp
@@ -450,12 +450,12 @@ void SearchRuleWidgetLister::setRuleList(QList<SearchRule::Ptr> *aList)
mRuleList = aList;
if (!widgets().isEmpty()) { // move this below next 'if'?
- widgets().first()->blockSignals(true);
+ widgets().constFirst()->blockSignals(true);
}
if (aList->isEmpty()) {
slotClear();
- widgets().first()->blockSignals(false);
+ widgets().constFirst()->blockSignals(false);
return;
}
@@ -486,7 +486,7 @@ void SearchRuleWidgetLister::setRuleList(QList<SearchRule::Ptr> *aList)
}
Q_ASSERT(!widgets().isEmpty());
- widgets().first()->blockSignals(false);
+ widgets().constFirst()->blockSignals(false);
updateAddRemoveButton();
}
diff --git a/src/search/searchrule/searchrulenumerical.cpp b/src/search/searchrule/searchrulenumerical.cpp
index 32d50a6..78c045f 100644
--- a/src/search/searchrule/searchrulenumerical.cpp
+++ b/src/search/searchrule/searchrulenumerical.cpp
@@ -72,8 +72,8 @@ bool SearchRuleNumerical::matches(const Akonadi::Item &item) const
}
bool rc = matchesInternal(numericalValue, numericalMsgContents, msgContents);
if (FilterLog::instance()->isLogging()) {
- QString msg = (rc ? "<font color=#00FF00>1 = </font>"
- : "<font color=#FF0000>0 = </font>");
+ QString msg = (rc ? QStringLiteral("<font color=#00FF00>1 = </font>")
+ : QStringLiteral("<font color=#FF0000>0 = </font>"));
msg += FilterLog::recode(asString());
msg += " ( <i>" + QString::number(numericalMsgContents) + "</i> )";
FilterLog::instance()->add(msg, FilterLog::RuleResult);
diff --git a/src/search/widgethandler/headersrulerwidgethandler.cpp b/src/search/widgethandler/headersrulerwidgethandler.cpp
index 50ecb44..e816549 100644
--- a/src/search/widgethandler/headersrulerwidgethandler.cpp
+++ b/src/search/widgethandler/headersrulerwidgethandler.cpp
@@ -155,9 +155,9 @@ QString HeadersRuleWidgetHandler::value(const QByteArray &field,
}
SearchRule::Function func = currentFunction(functionStack);
if (func == SearchRule::FuncIsInAddressbook) {
- return "is in address book"; // just a non-empty dummy value
+ return QStringLiteral("is in address book"); // just a non-empty dummy value
} else if (func == SearchRule::FuncIsNotInAddressbook) {
- return "is not in address book"; // just a non-empty dummy value
+ return QStringLiteral("is not in address book"); // just a non-empty dummy value
} else {
return currentValue(valueStack, func);
}