Commit 94a3424d authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Remove redundant code

parent 7de6fbd5
......@@ -71,7 +71,7 @@ QVariant TransactionModel::data(const QModelIndex &index, int role) const
if (!index.isValid())
return QVariant();
Transaction *trans = transactionFromIndex(index);
Transaction *trans = m_transactions[index.row()];
switch (role) {
case TransactionRoleRole:
return trans->role();
......@@ -112,16 +112,6 @@ QVariant TransactionModel::data(const QModelIndex &index, int role) const
return QVariant();
}
Transaction *TransactionModel::transactionFromIndex(const QModelIndex &index) const
{
Transaction *trans = nullptr;
if (index.isValid() && index.row() < m_transactions.size())
trans = m_transactions.at(index.row());
return trans;
}
Transaction *TransactionModel::transactionFromResource(AbstractResource *resource) const
{
Transaction *ret = nullptr;
......
......@@ -51,7 +51,6 @@ public:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QHash<int, QByteArray> roleNames() const override;
Transaction *transactionFromIndex(const QModelIndex &index) const;
Q_SCRIPTABLE Transaction *transactionFromResource(AbstractResource *resource) const;
QModelIndex indexOf(Transaction *trans) const;
QModelIndex indexOf(AbstractResource *res) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment