Commit a6536bca authored by Laurent Montel's avatar Laurent Montel 😁

Fix Bug 380297 - Recipients counter miscounts number of message recipients

FIXED-IN: 5.5.3
BUG: 380297
parent 10c8b83b
......@@ -233,6 +233,7 @@ QWidget *RecipientLineNG::tabOut() const
void RecipientLineNG::clear()
{
mRecipientsCount = 0;
mEdit->clear();
}
......
......@@ -320,15 +320,13 @@ bool RecipientsEditor::eventFilter(QObject *object, QEvent *event)
void RecipientsEditor::slotCalculateTotal()
{
int count = 0;
int empty = 0;
// Prevent endless recursion when splitting recipient
if (d->mSkipTotal) {
return;
}
MultiplyingLine *line;
int empty = 0;
MultiplyingLine *line = nullptr;
foreach (line, lines()) {
RecipientLineNG *rec = qobject_cast< RecipientLineNG * >(line);
if (rec) {
......@@ -349,7 +347,6 @@ void RecipientsEditor::slotCalculateTotal()
setFocusBottom(); // focus next empty entry
d->mSkipTotal = false;
}
count += recipientsCount;
}
}
}
......@@ -358,6 +355,15 @@ void RecipientsEditor::slotCalculateTotal()
if (empty == 0) {
addData();
}
int count = 0;
foreach (line, lines()) {
RecipientLineNG *rec = qobject_cast< RecipientLineNG * >(line);
if (rec) {
if (!rec->isEmpty()) {
count++;
}
}
}
// update the side widget
d->mSideWidget->setTotal(count, lines().count());
......
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