Verified Commit b120b8cf authored by Andre Heinecke's avatar Andre Heinecke
Browse files

Remove "default" indicator for adv. key sizes

It's a bit complicated what kleopatra uses as the default
key size as this was only configurable in kleopatra but
nowadays can be configured in GnuPG and we also have
ECC which could also be default. So rather then to
show a wrong default indicator we do not indicate default
anymore.

GnuPG-Bug-Id: T4988
parent a2c9a76b
Pipeline #26489 passed with stage
in 13 minutes and 26 seconds
...@@ -1823,14 +1823,14 @@ static void fill_combobox(QComboBox &cb, const QList<int> &sizes, const QStringL ...@@ -1823,14 +1823,14 @@ static void fill_combobox(QComboBox &cb, const QList<int> &sizes, const QStringL
{ {
cb.clear(); cb.clear();
for (int i = 0, end = sizes.size(); i != end; ++i) { for (int i = 0, end = sizes.size(); i != end; ++i) {
const int size = std::abs(sizes[i]);
/* As we respect the defaults configurable in GnuPG, and we also have configurable
* defaults in Kleopatra its difficult to print out "default" here. To avoid confusion
* about that its better not to show any default indication. */
cb.addItem(i < labels.size() && !labels[i].trimmed().isEmpty() cb.addItem(i < labels.size() && !labels[i].trimmed().isEmpty()
? sizes[i] < 0 ? i18ncp("%2: some admin-supplied text, %1: key size in bits", "%2 (1 bit)", "%2 (%1 bits)", size, labels[i].trimmed())
? i18ncp("%2: some admin-supplied text, %1: key size in bits", "%2 (1 bit; default)", "%2 (%1 bits; default)", -sizes[i], labels[i].trimmed()) : i18ncp("%1: key size in bits", "1 bit", "%1 bits", size),
: i18ncp("%2: some admin-supplied text, %1: key size in bits", "%2 (1 bit)", "%2 (%1 bits)", sizes[i], labels[i].trimmed()) size);
: sizes[i] < 0
? i18ncp("%1: key size in bits", "1 bit (default)", "%1 bits (default)", -sizes[i])
: i18ncp("%1: key size in bits", "1 bit", "%1 bits", sizes[i]),
std::abs(sizes[i]));
if (sizes[i] < 0) { if (sizes[i] < 0) {
cb.setCurrentIndex(cb.count() - 1); cb.setCurrentIndex(cb.count() - 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