Commit 55e5c30a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix clazy warning

parent a544041f
Pipeline #29651 passed with stage
in 49 minutes and 47 seconds
......@@ -167,7 +167,7 @@ QDate FollowUpReminderInfo::followUpReminderDate() const
return mFollowUpReminderDate;
}
void FollowUpReminderInfo::setFollowUpReminderDate(const QDate &followUpReminderDate)
void FollowUpReminderInfo::setFollowUpReminderDate(QDate followUpReminderDate)
{
mFollowUpReminderDate = followUpReminderDate;
}
......
......@@ -49,7 +49,7 @@ public:
Q_REQUIRED_RESULT QString to() const;
Q_REQUIRED_RESULT QDate followUpReminderDate() const;
void setFollowUpReminderDate(const QDate &followUpReminderDate);
void setFollowUpReminderDate(QDate followUpReminderDate);
void writeConfig(KConfigGroup &config, qint32 identifier);
......
......@@ -189,8 +189,6 @@ void UnifiedMailboxAgent::retrieveItems(const Akonadi::Collection &c)
return;
}
const auto lastSeenEvent = QDateTime::fromSecsSinceEpoch(c.remoteRevision().toLongLong());
const auto sources = unifiedBox->sourceCollections();
for (auto source : sources) {
auto fetch = new Akonadi::ItemFetchJob(Akonadi::Collection(source), this);
......
......@@ -139,10 +139,10 @@ void ConfigAgentDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
QPen pen = painter->pen();
QPalette::ColorGroup cg = (option.state & QStyle::State_Enabled) ? QPalette::Normal : QPalette::Disabled;
if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) {
cg = QPalette::Inactive;
}
// QPalette::ColorGroup cg = (option.state & QStyle::State_Enabled) ? QPalette::Normal : QPalette::Disabled;
// if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) {
// cg = QPalette::Inactive;
// }
QStyleOptionViewItem opt(option);
opt.showDecorationSelected = true;
......
......@@ -67,7 +67,7 @@ public: // mailserviceimpl
*/
virtual void send(int how) = 0;
virtual void addAttachmentsAndSend(const QList<QUrl> &urls, const QString &comment, int how) = 0;
virtual void addAttachment(const QList<AttachmentInfo> &url, bool showWarning) = 0;
virtual void addAttachment(const QVector<AttachmentInfo> &url, bool showWarning) = 0;
virtual void addAttachment(const QString &name, KMime::Headers::contentEncoding cte, const QString &charset, const QByteArray &data, const QByteArray &mimeType) = 0;
public: // kmcommand
virtual Q_REQUIRED_RESULT QString dbusObjectPath() const = 0;
......
......@@ -564,7 +564,7 @@ void KMComposerWin::insertSnippetInfo(const MailCommon::SnippetInfo &info)
const QUrl localUrl = QUrl::fromLocalFile(str);
AttachmentInfo info;
info.url = localUrl;
addAttachment(QList<AttachmentInfo>() << info, false);
addAttachment(QVector<AttachmentInfo>() << info, false);
}
});
job->start();
......@@ -651,7 +651,7 @@ void KMComposerWin::addAttachmentsAndSend(const QList<QUrl> &urls, const QString
send(how);
}
void KMComposerWin::addAttachment(const QList<KMail::Composer::AttachmentInfo> &infos, bool showWarning)
void KMComposerWin::addAttachment(const QVector<KMail::Composer::AttachmentInfo> &infos, bool showWarning)
{
QStringList lst;
for (const AttachmentInfo &info : infos) {
......@@ -2249,7 +2249,7 @@ bool KMComposerWin::insertFromMimeData(const QMimeData *source, bool forceAttach
if (items.isEmpty() && collections.isEmpty()) {
if (allLocalURLs || forceAttachment) {
QList<AttachmentInfo> infoList;
QVector<AttachmentInfo> infoList;
infoList.reserve(urlList.count());
for (const QUrl &url : urlList) {
AttachmentInfo info;
......@@ -2267,7 +2267,7 @@ bool KMComposerWin::insertFromMimeData(const QMimeData *source, bool forceAttach
if (selectedAction == addAsTextAction) {
insertUrls(source, urlList);
} else if (selectedAction == addAsAttachmentAction) {
QList<AttachmentInfo> infoList;
QVector<AttachmentInfo> infoList;
for (const QUrl &url : urlList) {
if (url.isValid()) {
AttachmentInfo info;
......
......@@ -145,7 +145,7 @@ public Q_SLOTS:
void addAttachmentsAndSend(const QList<QUrl> &urls, const QString &comment, int how) override;
void addAttachment(const QList<KMail::Composer::AttachmentInfo> &infos, bool showWarning) override;
void addAttachment(const QVector<KMail::Composer::AttachmentInfo> &infos, bool showWarning) override;
void addAttachment(const QString &name, KMime::Headers::contentEncoding cte, const QString &charset, const QByteArray &data, const QByteArray &mimeType) override;
......
......@@ -124,7 +124,7 @@ QDate CreateFollowupReminderOnExistingMessageJob::date() const
return mDate;
}
void CreateFollowupReminderOnExistingMessageJob::setDate(const QDate &date)
void CreateFollowupReminderOnExistingMessageJob::setDate(QDate date)
{
mDate = date;
}
......
......@@ -39,7 +39,7 @@ public:
void setCollection(const Akonadi::Collection &collection);
Q_REQUIRED_RESULT QDate date() const;
void setDate(const QDate &date);
void setDate(QDate date);
Q_REQUIRED_RESULT Akonadi::Item messageItem() const;
void setMessageItem(const Akonadi::Item &messageItem);
......
......@@ -66,7 +66,7 @@ bool DndFromArkJob::extract(const QMimeData *source)
QDBusConnection::sessionBus().call(message);
QDir dir(arkPath);
const QStringList list = dir.entryList(QDir::NoDotAndDotDot | QDir::Files);
QList<KMail::Composer::AttachmentInfo> infoList;
QVector<KMail::Composer::AttachmentInfo> infoList;
infoList.reserve(list.size());
for (int i = 0; i < list.size(); ++i) {
KMail::Composer::AttachmentInfo info;
......
......@@ -69,7 +69,7 @@ void NewMessageJob::slotOpenComposer()
//Add the attachment if we have one
if (!mAttachURL.isEmpty() && mAttachURL.isValid()) {
QList<KMail::Composer::AttachmentInfo> infoList;
QVector<KMail::Composer::AttachmentInfo> infoList;
KMail::Composer::AttachmentInfo info;
info.url = mAttachURL;
infoList.append(info);
......
......@@ -122,7 +122,7 @@ void OpenComposerJob::slotOpenComposer()
}
QList<QUrl> attachURLs = QUrl::fromStringList(mOpenComposerSettings.mAttachmentPaths);
QList<QUrl>::ConstIterator endAttachment(attachURLs.constEnd());
QList<KMail::Composer::AttachmentInfo> infoList;
QVector<KMail::Composer::AttachmentInfo> infoList;
for (QList<QUrl>::ConstIterator it = attachURLs.constBegin(); it != endAttachment; ++it) {
QMimeDatabase mimeDb;
if (mimeDb.mimeTypeForUrl(*it).name() == QLatin1String("inode/directory")) {
......
......@@ -795,7 +795,7 @@ void KMOpenMsgCommand::slotResult(KJob *job)
}
startOfMessage += 1; // the message starts after the '\n'
}
QList<KMime::Message::Ptr> listMessages;
QVector<KMime::Message::Ptr> listMessages;
// check for multiple messages in the file
bool multipleMessages = true;
......@@ -1874,7 +1874,7 @@ KMCommand::Result KMShareImageCommand::execute()
KMail::Composer *win = KMail::makeComposer(msg, false, false, KMail::Composer::New, id);
win->setFocusToSubject();
QList<KMail::Composer::AttachmentInfo> infoList;
QVector<KMail::Composer::AttachmentInfo> infoList;
KMail::Composer::AttachmentInfo info;
info.url = mUrl;
info.comment = i18n("Image");
......
......@@ -211,7 +211,7 @@ void KMReaderMainWin::showPreviousMessage()
updateButtons();
}
void KMReaderMainWin::showMessage(const QString &encoding, const QList<KMime::Message::Ptr> &message)
void KMReaderMainWin::showMessage(const QString &encoding, const QVector<KMime::Message::Ptr> &message)
{
if (message.isEmpty()) {
return;
......@@ -247,7 +247,7 @@ void KMReaderMainWin::showMessage(const QString &encoding, const KMime::Message:
if (!message) {
return;
}
const QList<KMime::Message::Ptr> lst{message};
const QVector<KMime::Message::Ptr> lst{message};
showMessage(encoding, lst);
}
......
......@@ -57,7 +57,7 @@ public:
*/
void showMessage(const QString &encoding, const Akonadi::Item &msg, const Akonadi::Collection &parentCollection = Akonadi::Collection());
void showMessage(const QString &encoding, const QList<KMime::Message::Ptr> &message);
void showMessage(const QString &encoding, const QVector<KMime::Message::Ptr> &message);
void showMessage(const QString &encoding, const KMime::Message::Ptr &message);
void showMessagePopup(const Akonadi::Item &msg, const QUrl &aUrl, const QUrl &imageUrl, const QPoint &aPoint, bool contactAlreadyExists, bool uniqueContactFound, const WebEngineViewer::WebHitTestResult &result);
void showAndActivateWindow();
......@@ -104,7 +104,7 @@ private:
void updateButtons();
void slotToggleMenubar(bool dontShowWarning);
QList<KMime::Message::Ptr> mListMessage;
QVector<KMime::Message::Ptr> mListMessage;
int mCurrentMessageIndex = 0;
Akonadi::Collection mParentCollection;
Akonadi::Item mMsg;
......
......@@ -456,7 +456,7 @@ void KMReaderWin::slotMailtoAddAddrBook()
Akonadi::AddEmailAddressJob *job = new Akonadi::AddEmailAddressJob(emailString, mMainWindow, this);
job->setInteractive(true);
connect(job, &Akonadi::AddEmailAddressJob::successMessage, this, [this](const QString &message) {
connect(job, &Akonadi::AddEmailAddressJob::successMessage, this, [](const QString &message) {
PimCommon::BroadcastStatus::instance()->setStatusMsg(message);
});
job->start();
......@@ -769,7 +769,7 @@ bool KMReaderWin::printSelectedText(bool preview)
void KMReaderWin::slotPrintComposeResult(KJob *job)
{
const bool preview = job->property("preview").toBool();
::MessageComposer::Composer *composer = dynamic_cast< ::MessageComposer::Composer * >(job);
::MessageComposer::Composer *composer = qobject_cast< ::MessageComposer::Composer * >(job);
Q_ASSERT(composer);
if (composer->error() == ::MessageComposer::Composer::NoError) {
Q_ASSERT(composer->resultMessages().size() == 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