aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorxiphon <xiphon@protonmail.com>2020-02-28 10:25:57 +0000
committerxiphon <xiphon@protonmail.com>2020-02-28 10:25:57 +0000
commit9deca92e0776a97e6364b6e6f36cc8a8718ea2cb (patch)
treea3edac30269f96de6fbd1e0360cde09c013cfdeb /src/model
parentb4a65c52cc51fede20b80be0bf9f0e816c9ef752 (diff)
downloadmonzero-gui-9deca92e0776a97e6364b6e6f36cc8a8718ea2cb.tar.gz
monzero-gui-9deca92e0776a97e6364b6e6f36cc8a8718ea2cb.tar.xz
monzero-gui-9deca92e0776a97e6364b6e6f36cc8a8718ea2cb.zip
fix multiple minor issues (c-style casts, default branch, etc.)
Diffstat (limited to 'src/model')
-rw-r--r--src/model/AddressBookModel.cpp2
-rw-r--r--src/model/SubaddressAccountModel.cpp2
-rw-r--r--src/model/SubaddressModel.cpp2
3 files changed, 4 insertions, 2 deletions
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<quint64>(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<quint64>(index.row()) >= m_subaddress->count())
return {};
QVariant result;