Commit 349769c7 authored by Karel Slaný's avatar Karel Slaný

Merge branch 'fix-model-rowcount' into 'develop'

Fixed rowCount method in the models

See merge request !69
parents b6922f33 ad2d869a
......@@ -551,9 +551,8 @@ AccountListModel::AccountListModel(const AccountListModel &model,
int AccountListModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return !parent.isValid() ? m_userNames.size() : 0;
return m_userNames.size();
}
QHash<int, QByteArray> AccountListModel::roleNames(void) const
......
......@@ -111,9 +111,7 @@ FileListModel::FileListModel(const FileListModel &model, QObject *parent)
int FileListModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return m_files.size();
return !parent.isValid() ? m_files.size() : 0;
}
QHash<int, QByteArray> FileListModel::roleNames(void) const
......
......@@ -175,9 +175,7 @@ MessageListModel::MessageListModel(const MessageListModel &model,
int MessageListModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return m_messages.size();
return !parent.isValid() ? m_messages.size() : 0;
}
QHash<int, QByteArray> MessageListModel::roleNames(void) 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