mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Replace old for-loops with range-based for-loops
This commit is contained in:
parent
4876beabed
commit
4ac1601696
@ -121,8 +121,8 @@ QString imageReaderFilter()
|
||||
QStringList formatsStringList;
|
||||
|
||||
for (const QByteArray& format : formats) {
|
||||
for (int i = 0; i < format.size(); i++) {
|
||||
if (!QChar(format.at(i)).isLetterOrNumber()) {
|
||||
for (char codePoint : format) {
|
||||
if (!QChar(codePoint).isLetterOrNumber()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -146,8 +146,8 @@ void ApplicationSettingsWidget::loadSettings()
|
||||
|
||||
m_generalUi->languageComboBox->clear();
|
||||
QList<QPair<QString, QString>> languages = Translator::availableLanguages();
|
||||
for (int i = 0; i < languages.size(); i++) {
|
||||
m_generalUi->languageComboBox->addItem(languages[i].second, languages[i].first);
|
||||
for (const auto& language : languages) {
|
||||
m_generalUi->languageComboBox->addItem(language.second, language.first);
|
||||
}
|
||||
int defaultIndex = m_generalUi->languageComboBox->findData(config()->get("GUI/Language"));
|
||||
if (defaultIndex > 0) {
|
||||
|
@ -71,8 +71,7 @@ bool DialogyWidget::clickButton(QDialogButtonBox::StandardButton standardButton)
|
||||
}
|
||||
|
||||
QList<QDialogButtonBox*> buttonBoxes = findChildren<QDialogButtonBox*>();
|
||||
for (int i = 0; i < buttonBoxes.size(); ++i) {
|
||||
QDialogButtonBox* buttonBox = buttonBoxes.at(i);
|
||||
for (auto buttonBox : buttonBoxes) {
|
||||
pb = buttonBox->button(standardButton);
|
||||
if (pb && pb->isVisible() && pb->isEnabled()) {
|
||||
pb->click();
|
||||
|
@ -208,12 +208,12 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
|
||||
case Attachments: {
|
||||
// Display comma-separated list of attachments
|
||||
QList<QString> attachments = entry->attachments()->keys();
|
||||
for (int i = 0; i < attachments.size(); ++i) {
|
||||
for (const auto& attachment : attachments) {
|
||||
if (result.isEmpty()) {
|
||||
result.append(attachments.at(i));
|
||||
result.append(attachment);
|
||||
continue;
|
||||
}
|
||||
result.append(QString(", ") + attachments.at(i));
|
||||
result.append(QString(", ") + attachment);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user