mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-26 15:59:50 -05:00
Use Q_FOREACH instead of QListIterator.
This commit is contained in:
parent
cd41727583
commit
924130e0fe
@ -129,9 +129,7 @@ void KeePass2XmlWriter::writeCustomIcons()
|
||||
{
|
||||
m_xml.writeStartElement("CustomIcons");
|
||||
|
||||
QListIterator<Uuid> i(m_meta->customIconsOrder());
|
||||
while (i.hasNext()) {
|
||||
Uuid uuid = i.next();
|
||||
Q_FOREACH (const Uuid& uuid, m_meta->customIconsOrder()) {
|
||||
writeIcon(uuid, m_meta->customIcon(uuid));
|
||||
}
|
||||
|
||||
|
@ -351,9 +351,7 @@ bool DatabaseWidget::canDeleteCurrentGoup()
|
||||
void DatabaseWidget::truncateHistories()
|
||||
{
|
||||
QList<Entry*> allEntries = m_db->rootGroup()->entriesRecursive(false);
|
||||
QListIterator<Entry*> i(allEntries);
|
||||
while (i.hasNext()) {
|
||||
Entry* entry = i.next();
|
||||
Q_FOREACH (Entry* entry, allEntries) {
|
||||
entry->truncateHistory();
|
||||
}
|
||||
}
|
||||
|
@ -459,18 +459,14 @@ void EditEntryWidget::removeCustomIcon()
|
||||
int iconUsedCount = 0;
|
||||
|
||||
QList<Entry*> allEntries = m_database->rootGroup()->entriesRecursive(true);
|
||||
QListIterator<Entry*> iEntries(allEntries);
|
||||
while (iEntries.hasNext()) {
|
||||
Entry* entry = iEntries.next();
|
||||
Q_FOREACH (const Entry* entry, allEntries) {
|
||||
if (iconUuid == entry->iconUuid() && entry != m_entry) {
|
||||
iconUsedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
QList<const Group*> allGroups = m_database->rootGroup()->groupsRecursive(true);
|
||||
QListIterator<const Group*> iGroups(allGroups);
|
||||
while (iGroups.hasNext()) {
|
||||
const Group* group = iGroups.next();
|
||||
Q_FOREACH (const Group* group, allGroups) {
|
||||
if (iconUuid == group->iconUuid()) {
|
||||
iconUsedCount++;
|
||||
}
|
||||
|
@ -75,9 +75,7 @@ void EntryModel::setEntries(const QList<Entry*>& entries)
|
||||
m_allGroups = entries.at(0)->group()->database()->rootGroup()->groupsRecursive(true);
|
||||
}
|
||||
|
||||
QListIterator<const Group*> iGroups(m_allGroups);
|
||||
while (iGroups.hasNext()) {
|
||||
const Group* group = iGroups.next();
|
||||
Q_FOREACH (const Group* group, m_allGroups) {
|
||||
makeConnections(group);
|
||||
}
|
||||
|
||||
@ -248,9 +246,7 @@ void EntryModel::severConnections()
|
||||
disconnect(m_group, 0, this, 0);
|
||||
}
|
||||
|
||||
QListIterator<const Group*> i(m_allGroups);
|
||||
while (i.hasNext()) {
|
||||
const Group* group = i.next();
|
||||
Q_FOREACH (const Group* group, m_allGroups) {
|
||||
disconnect(group, 0, this, 0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user