Commit dd566165 authored by Lasath Fernando's avatar Lasath Fernando Committed by David Edmundson

Changed implementations of QAbstractItemModel::data() to use QModelIndex::isValid().

parent 5f4c8418
......@@ -34,7 +34,7 @@ public:
QVariant ConversationsModel::data(const QModelIndex& index, int role) const
{
QVariant result;
if (index.row() >= 0 && index.row() < d->conversations.count()) {
if (index.isValid()) {
Q_ASSERT(role == ConversationRole);
result = QVariant::fromValue<Conversation*>(d->conversations[index.row()]);
kDebug() << "returning value " << result;
......
......@@ -180,7 +180,7 @@ QVariant MessagesModel::data(const QModelIndex& index, int role) const
{
QVariant result;
if (index.row() < d->messages.size()) {
if (index.isValid()) {
MessageItem* requestedData = &d->messages[index.row()];
switch (role) {
......
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