Commit f93e168e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor fix

parent 5dabe045
Pipeline #24601 passed with stage
in 33 minutes and 9 seconds
......@@ -683,9 +683,8 @@ QVector< MessageComposer::Composer * > ComposerViewBase::generateCryptoMessages(
}
}
QStringList recipients(mExpandedTo);
const QStringList recipients = mExpandedTo + mExpandedCc;
const QStringList bcc(mExpandedBcc);
recipients.append(mExpandedCc);
keyResolver->setPrimaryRecipients(recipients);
keyResolver->setSecondaryRecipients(bcc);
......
......@@ -70,17 +70,17 @@ public:
setText(1, mEmail);
}
KContacts::Addressee addressee() const
Q_REQUIRED_RESULT KContacts::Addressee addressee() const
{
return mAddressee;
}
QString email() const
Q_REQUIRED_RESULT QString email() const
{
return mEmail;
}
bool isTransient() const
Q_REQUIRED_RESULT bool isTransient() const
{
return mId == -1;
}
......@@ -90,7 +90,7 @@ public:
mId = id;
}
Akonadi::Item::Id id() const
Q_REQUIRED_RESULT Akonadi::Item::Id id() const
{
return mId;
}
......
......@@ -68,8 +68,6 @@ void RecipientLineEdit::keyPressEvent(QKeyEvent *ev)
RecipientLineNG::RecipientLineNG(QWidget *parent)
: MultiplyingLine(parent)
, mRecipientsCount(0)
, mModified(false)
, mData(new Recipient)
{
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
......
......@@ -136,8 +136,8 @@ private:
void slotAddRecipient(const QString &);
RecipientComboBox *mCombo = nullptr;
RecipientLineEdit *mEdit = nullptr;
int mRecipientsCount;
bool mModified;
int mRecipientsCount = 0;
bool mModified = false;
QSharedPointer<Recipient> mData;
};
}
......
......@@ -181,7 +181,7 @@ void RecipientsEditor::removeRecipient(const QString &recipient, Recipient::Type
MultiplyingLine *line = nullptr;
while (it.hasNext()) {
line = it.next();
RecipientLineNG *rec = qobject_cast< RecipientLineNG * >(line);
RecipientLineNG *rec = qobject_cast<RecipientLineNG *>(line);
if (rec) {
if ((rec->recipient()->email() == recipient)
&& (rec->recipientType() == type)) {
......@@ -212,7 +212,7 @@ void MessageComposer::RecipientsEditor::setRecentAddressConfig(KConfig *config)
if (config) {
MultiplyingLine *line;
foreach (line, lines()) {
RecipientLineNG *rec = qobject_cast< RecipientLineNG * >(line);
RecipientLineNG *rec = qobject_cast<RecipientLineNG *>(line);
if (rec) {
rec->setRecentAddressConfig(config);
}
......@@ -248,14 +248,14 @@ void RecipientsEditor::slotLineAdded(MultiplyingLine *line)
if (count > 0) {
if (count == 1) {
RecipientLineNG *last_rec = qobject_cast< RecipientLineNG * >(lines().constFirst());
RecipientLineNG *last_rec = qobject_cast<RecipientLineNG *>(lines().constFirst());
if (last_rec && (last_rec->recipientType() == Recipient::Bcc || last_rec->recipientType() == Recipient::ReplyTo)) {
rec->setRecipientType(Recipient::To);
} else {
rec->setRecipientType(Recipient::Cc);
}
} else {
RecipientLineNG *last_rec = qobject_cast< RecipientLineNG * >(lines().at(lines().count() - 2));
RecipientLineNG *last_rec = qobject_cast<RecipientLineNG *>(lines().at(lines().count() - 2));
if (last_rec) {
if (last_rec->recipientType() == Recipient::ReplyTo) {
rec->setRecipientType(Recipient::To);
......@@ -275,7 +275,7 @@ void RecipientsEditor::slotLineDeleted(int pos)
int firstCC = -1;
for (int i = pos, total = lines().count(); i < total; ++i) {
MultiplyingLine *line = lines().at(i);
RecipientLineNG *rec = qobject_cast< RecipientLineNG * >(line);
RecipientLineNG *rec = qobject_cast<RecipientLineNG *>(line);
if (rec) {
if (rec->recipientType() == Recipient::To) {
atLeastOneToLine = true;
......@@ -286,7 +286,7 @@ void RecipientsEditor::slotLineDeleted(int pos)
}
if (!atLeastOneToLine && (firstCC >= 0)) {
RecipientLineNG *firstCCLine = qobject_cast< RecipientLineNG * >(lines().at(firstCC));
RecipientLineNG *firstCCLine = qobject_cast<RecipientLineNG *>(lines().at(firstCC));
if (firstCCLine) {
firstCCLine->setRecipientType(Recipient::To);
}
......@@ -326,7 +326,7 @@ void RecipientsEditor::slotCalculateTotal()
int empty = 0;
MultiplyingLine *line = nullptr;
foreach (line, lines()) {
RecipientLineNG *rec = qobject_cast< RecipientLineNG * >(line);
RecipientLineNG *rec = qobject_cast<RecipientLineNG *>(line);
if (rec) {
if (rec->isEmpty()) {
++empty;
......@@ -361,7 +361,7 @@ void RecipientsEditor::slotCalculateTotal()
}
int count = 0;
foreach (line, lines()) {
RecipientLineNG *rec = qobject_cast< RecipientLineNG * >(line);
RecipientLineNG *rec = qobject_cast<RecipientLineNG *>(line);
if (rec) {
if (!rec->isEmpty()) {
count++;
......@@ -375,5 +375,5 @@ void RecipientsEditor::slotCalculateTotal()
RecipientLineNG *RecipientsEditor::activeLine() const
{
MultiplyingLine *line = MultiplyingLineEditor::activeLine();
return qobject_cast< RecipientLineNG * >(line);
return qobject_cast<RecipientLineNG *>(line);
}
......@@ -130,7 +130,7 @@ void RecipientsEditorSideWidget::updateTotalToolTip()
Recipient::List::ConstIterator it;
Recipient::List::ConstIterator end(recipients.constEnd());
for (it = recipients.constBegin(); it != end; ++it) {
QString emailLine = QLatin1String("&nbsp;&nbsp;") + (*it)->email().toHtmlEscaped() + QLatin1String("<br/>");
const QString emailLine = QLatin1String("&nbsp;&nbsp;") + (*it)->email().toHtmlEscaped() + QLatin1String("<br/>");
switch ((*it)->type()) {
case Recipient::To:
to += emailLine;
......
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