Skip to content

Commit

Permalink
Fix warning counter (open-eid#1071)
Browse files Browse the repository at this point in the history
IB-7399

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored May 20, 2022
1 parent 0975701 commit 0c48246
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions client/widgets/ContainerPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ void ContainerPage::transition(DigiDoc* container)
QMap<ria::qdigidoc4::WarningType, int> errors;
setHeader(container->fileName());
auto addError = [&errors](const SignatureItem* item) {
auto counter = errors.value(item->getError());
errors[item->getError()] = counter++;
int counter = errors.value(item->getError());
errors[item->getError()] = ++counter;
};

if(!container->timestamps().isEmpty())
Expand All @@ -341,12 +341,8 @@ void ContainerPage::transition(DigiDoc* container)
ui->rightPane->addWidget(item);
}

if(!errors.isEmpty())
{
QMap<ria::qdigidoc4::WarningType, int>::const_iterator i;
for (i = errors.constBegin(); i != errors.constEnd(); ++i)
emit warning(WarningText(i.key(), i.value()));
}
for(auto i = errors.constBegin(); i != errors.constEnd(); ++i)
emit warning(WarningText(i.key(), i.value()));
if(container->fileName().endsWith(QStringLiteral("ddoc"), Qt::CaseInsensitive))
emit warning(UnsupportedDDocWarning);

Expand Down

0 comments on commit 0c48246

Please sign in to comment.