Unverified Commit 1af932cf authored by Andre Heinecke's avatar Andre Heinecke
Browse files

Move c++20 initializers out of for statement

This does not work with gcc 4.8 so let us avoid it as
the improvement is minimal.
parent 36cbbf74
Pipeline #213209 passed with stage
in 3 minutes and 28 seconds
......@@ -215,7 +215,8 @@ void SubKeysWidget::setKey(const GpgME::Key &key)
QByteArray(currentItem->data(0, Qt::UserRole).value<GpgME::Subkey>().fingerprint()) : QByteArray();
d->ui.subkeysTree->clear();
for (const auto subkeys = key.subkeys(); const auto &subkey : subkeys) {
const auto subkeys = key.subkeys();
for (const auto &subkey : subkeys) {
auto item = new QTreeWidgetItem;
item->setData(0, Qt::DisplayRole, Formatting::prettyID(subkey.keyID()));
item->setData(0, Qt::AccessibleTextRole, Formatting::accessibleHexID(subkey.keyID()));
......
......@@ -141,7 +141,8 @@ void Kleo::unsetDefaultButtons(const QDialogButtonBox *buttonBox)
if (!buttonBox) {
return;
}
for (const auto buttons = buttonBox->buttons(); auto button : buttons) {
const auto buttons = buttonBox->buttons();
for (auto button : buttons) {
if (auto pushButton = qobject_cast<QPushButton *>(button)) {
pushButton->setDefault(false);
}
......@@ -153,7 +154,8 @@ void Kleo::unsetAutoDefaultButtons(const QDialog *dialog)
if (!dialog) {
return;
}
for (const auto pushButtons = dialog->findChildren<QPushButton *>(); auto pushButton : pushButtons) {
const auto pushButtons = dialog->findChildren<QPushButton *>();
for (auto pushButton : pushButtons) {
pushButton->setAutoDefault(false);
}
}
Supports Markdown
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