Reorganize code.

Move KeyEdit::IsOurKey to Tools::IsOurKey.
This commit is contained in:
SET
2020-11-14 11:25:00 +01:00
parent bb4df1423a
commit 6ac7ea7c0f
5 changed files with 32 additions and 22 deletions

View File

@@ -104,3 +104,20 @@ bool Tools::KeyHasSecret(const WString& fpr)
}
return (!k.isNull());
}
bool Tools::IsFound(const WString& item, vector<WString>& items)
{
// std:find should be more aesthetic.
vector<WString> ::iterator it;
for (it = items.begin(); it != items.end(); it++)
{
if ((*it) == item)
return true;
}
return false;
}
bool Tools::IsOurKey(const WString& fpr, vector<WString>& ourPrivKeys)
{
return IsFound(fpr, ourPrivKeys);
}