keys: CompositeKey: Change Q_FOREACH to C++11 for()

* Use the C++11 range based loop as recommended from
  https://github.com/keepassxreboot/keepassxc/pull/119

Signed-off-by: Kyle Manna <kyle@kylemanna.com>
This commit is contained in:
Kyle Manna 2017-01-08 18:45:02 -08:00
parent d398d367c1
commit ef06165ea2

View File

@ -70,7 +70,7 @@ CompositeKey& CompositeKey::operator=(const CompositeKey& key)
for (const Key* subKey : asConst(key.m_keys)) {
addKey(*subKey);
}
Q_FOREACH (const ChallengeResponseKey* subKey, key.m_challengeResponseKeys) {
for (const ChallengeResponseKey* subKey : asConst(key.m_challengeResponseKeys)) {
addChallengeResponseKey(*subKey);
}
@ -160,7 +160,7 @@ bool CompositeKey::challenge(const QByteArray& seed, QByteArray& result) const
CryptoHash cryptoHash(CryptoHash::Sha256);
Q_FOREACH (ChallengeResponseKey* key, m_challengeResponseKeys) {
for (ChallengeResponseKey* key : m_challengeResponseKeys) {
/* If the device isn't present or fails, return an error */
if (key->challenge(seed) == false) {
return false;