Commit 4b0b6986 authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Rolf Eike Beer

fix message after importing keys

The message was telling that no key was imported if the last column of the
IMPORT_RES line was 0, which gives the keys that were not imported or the
skipped v3 keys depending on the version of GnuPG. Change the logic to what
is was meant to show: say nothing was imported if _all_ fields are 0.

BUG:368950
FIXED-IN:17.08.3
parent b0cbbdd3
......@@ -118,20 +118,17 @@ KGpgImport::getImportMessage(const QStringList &log)
const QStringList rstr = str.mid(20).simplified().split(QLatin1Char(' '));
fine = (rstr.count() >= RESULT_PARTS_MIN);
bool syn = (rstr.count() >= RESULT_PARTS_MIN);
const int parts = qBound<int>(RESULT_PARTS_MIN, rstr.count(), RESULT_PARTS_MAX);
for (int i = parts - 1; (i >= 0) && fine; i--)
rcode[i] += rstr.at(i).toULong(&fine);
for (int i = std::min<int>(rstr.count(), RESULT_PARTS_MAX) - 1; (i >= 0) && syn; i--) {
rcode[i] += rstr.at(i).toULong(&syn);
fine |= (rcode[i] != 0);
}
if (!fine)
if (!syn)
return xi18nc("@info", "The import result string has an unsupported format in line %1.<nl/>Please see the detailed log for more information.", line);
}
for (int i = RESULT_PARTS_MAX - 1; i >= 0; i--)
fine = (rcode[i] != 0);
if (!fine)
return i18n("No key imported.<br />Please see the detailed log for more information.");
......
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