Commit 7d95a5ba authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some clazy warning

parent 255473f2
......@@ -26,6 +26,7 @@ namespace MailCommon
class SelectThunderbirdFilterFilesWidget;
class SelectThunderbirdFilterFilesDialog : public QDialog
{
Q_OBJECT
public:
explicit SelectThunderbirdFilterFilesDialog(const QString &defaultSettingPath, QWidget *parent);
~SelectThunderbirdFilterFilesDialog();
......
......@@ -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();
}
......
......@@ -23,6 +23,7 @@ namespace MailCommon
class MailFilter;
class KMFilterAccountList : public QTreeWidget
{
Q_OBJECT
public:
explicit KMFilterAccountList(QWidget *parent);
~KMFilterAccountList();
......
......@@ -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());
}
}
......
......@@ -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);
}
......
......@@ -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.
......
......@@ -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();
}
......
......@@ -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);
......
......@@ -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);
}
......
Supports Markdown
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