+ // This is a legacy config option. "RSA" and any unknown value set the algorithm to RSA; all other options are no longer supported by kleo (dsa, elg).
+ // So we just have to check whether the value is set to *anything*.
+ if (!config.readEntry("PGPKeyType", QString()).isEmpty()) {
+ for (auto i = 0; i < ui.keyAlgoCB->count(); ++i) {
+ if (ui.keyAlgoCB->itemData(i).toString().startsWith(u"rsa"_s)) {
+ ui.keyAlgoCB->setCurrentIndex(i);
+ break;
+ }
+ }
+ }
+
+ if (config.hasKey("RSAKeySizes")) {
+ for (const auto size : config.readEntry("RSAKeySizes", QList<int>())) {
+ if (size < 0) {
+ auto index = ui.keyAlgoCB->findData(u"rsa%1"_s.arg(std::abs(size)));