cleanup some warnings suppression

This commit is contained in:
Blue 2023-08-15 12:28:25 -03:00
parent 5fbb03fc46
commit 23ec80ccba
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
26 changed files with 630 additions and 924 deletions

View file

@ -16,6 +16,8 @@
#include "keys.h"
#include "shared/defines.h"
const QHash<int, QByteArray> Models::Keys::roles = {
{Label, "label"},
{FingerPrint, "fingerPrint"},
@ -28,13 +30,11 @@ Models::Keys::Keys(QObject* parent):
modified() {}
Models::Keys::~Keys() {
for (Shared::KeyInfo* key : keys) {
for (Shared::KeyInfo* key : keys)
delete key;
}
for (std::pair<const int, Shared::KeyInfo*>& pair: modified) {
for (std::pair<const int, Shared::KeyInfo*>& pair: modified)
delete pair.second;
}
}
std::deque<Shared::KeyInfo> Models::Keys::modifiedKeys() const {
@ -92,15 +92,15 @@ QVariant Models::Keys::data(const QModelIndex& index, int role) const {
}
int Models::Keys::rowCount(const QModelIndex& parent) const {
SHARED_UNUSED(parent);
return keys.size();
}
QHash<int, QByteArray> Models::Keys::roleNames() const {return roles;}
QModelIndex Models::Keys::index(int row, int column, const QModelIndex& parent) const {
if (!hasIndex(row, column, parent)) {
if (!hasIndex(row, column, parent))
return QModelIndex();
}
return createIndex(row, column, keys[row]);
}