mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-01-01 08:40:17 -05:00
Convert Q_FOREACH loops to C++11 for loops.
Q_FOREACH will de deprecated soon.
This commit is contained in:
parent
ad834f0f58
commit
fff9e7ac46
31 changed files with 202 additions and 143 deletions
|
|
@ -44,7 +44,8 @@ bool EntryAttributes::hasKey(const QString& key) const
|
|||
QList<QString> EntryAttributes::customKeys()
|
||||
{
|
||||
QList<QString> customKeys;
|
||||
Q_FOREACH (const QString& key, keys()) {
|
||||
const QList<QString> keyList = keys();
|
||||
for (const QString& key : keyList) {
|
||||
if (!isDefaultAttribute(key)) {
|
||||
customKeys.append(key);
|
||||
}
|
||||
|
|
@ -167,14 +168,16 @@ void EntryAttributes::copyCustomKeysFrom(const EntryAttributes* other)
|
|||
Q_EMIT aboutToBeReset();
|
||||
|
||||
// remove all non-default keys
|
||||
Q_FOREACH (const QString& key, keys()) {
|
||||
const QList<QString> keyList = keys();
|
||||
for (const QString& key : keyList) {
|
||||
if (!isDefaultAttribute(key)) {
|
||||
m_attributes.remove(key);
|
||||
m_protectedAttributes.remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
Q_FOREACH (const QString& key, other->keys()) {
|
||||
const QList<QString> otherKeyList = other->keys();
|
||||
for (const QString& key : otherKeyList) {
|
||||
if (!isDefaultAttribute(key)) {
|
||||
m_attributes.insert(key, other->value(key));
|
||||
if (other->isProtected(key)) {
|
||||
|
|
@ -194,7 +197,8 @@ bool EntryAttributes::areCustomKeysDifferent(const EntryAttributes* other)
|
|||
return true;
|
||||
}
|
||||
|
||||
Q_FOREACH (const QString& key, keys()) {
|
||||
const QList<QString> keyList = keys();
|
||||
for (const QString& key : keyList) {
|
||||
if (isDefaultAttribute(key)) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -239,7 +243,7 @@ void EntryAttributes::clear()
|
|||
m_attributes.clear();
|
||||
m_protectedAttributes.clear();
|
||||
|
||||
Q_FOREACH (const QString& key, DefaultAttributes) {
|
||||
for (const QString& key : DefaultAttributes) {
|
||||
m_attributes.insert(key, "");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue