From 9deca92e0776a97e6364b6e6f36cc8a8718ea2cb Mon Sep 17 00:00:00 2001 From: xiphon Date: Fri, 28 Feb 2020 10:25:57 +0000 Subject: fix multiple minor issues (c-style casts, default branch, etc.) --- src/model/AddressBookModel.cpp | 2 ++ src/model/SubaddressAccountModel.cpp | 2 +- src/model/SubaddressModel.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/model') diff --git a/src/model/AddressBookModel.cpp b/src/model/AddressBookModel.cpp index 98145bd1..d9086c34 100644 --- a/src/model/AddressBookModel.cpp +++ b/src/model/AddressBookModel.cpp @@ -71,6 +71,8 @@ QVariant AddressBookModel::data(const QModelIndex &index, int role) const // Qt doesnt support size_t overload type casting result.setValue(row.getRowId()); break; + default: + qCritical() << "Unimplemented role " << role; } }); if (!found) { diff --git a/src/model/SubaddressAccountModel.cpp b/src/model/SubaddressAccountModel.cpp index 51721b8b..e4bce411 100644 --- a/src/model/SubaddressAccountModel.cpp +++ b/src/model/SubaddressAccountModel.cpp @@ -53,7 +53,7 @@ int SubaddressAccountModel::rowCount(const QModelIndex &) const QVariant SubaddressAccountModel::data(const QModelIndex &index, int role) const { - if (!index.isValid() || index.row() < 0 || (unsigned)index.row() >= m_subaddressAccount->count()) + if (!index.isValid() || index.row() < 0 || static_cast(index.row()) >= m_subaddressAccount->count()) return {}; QVariant result; diff --git a/src/model/SubaddressModel.cpp b/src/model/SubaddressModel.cpp index 38168ecf..7d4c408c 100644 --- a/src/model/SubaddressModel.cpp +++ b/src/model/SubaddressModel.cpp @@ -54,7 +54,7 @@ int SubaddressModel::rowCount(const QModelIndex &) const QVariant SubaddressModel::data(const QModelIndex &index, int role) const { - if (!index.isValid() || index.row() < 0 || (unsigned)index.row() >= m_subaddress->count()) + if (!index.isValid() || index.row() < 0 || static_cast(index.row()) >= m_subaddress->count()) return {}; QVariant result; -- cgit v1.2.3