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