Commit 781ba0c5 authored by Lasath Fernando's avatar Lasath Fernando Committed by David Edmundson
Browse files

Made Conversation a metatype, so that it can be put in a QVariant directly.

parent 396966d9
...@@ -55,4 +55,6 @@ private: ...@@ -55,4 +55,6 @@ private:
ConversationPrivate *d; ConversationPrivate *d;
}; };
Q_DECLARE_METATYPE(Conversation*);
#endif // CONVERSATION_H #endif // CONVERSATION_H
...@@ -36,7 +36,7 @@ QVariant ConversationsModel::data ( const QModelIndex& index, int role ) const ...@@ -36,7 +36,7 @@ QVariant ConversationsModel::data ( const QModelIndex& index, int role ) const
QVariant result; QVariant result;
if(index.row() >= 0 && index.row() < d->conversations.count()) { if(index.row() >= 0 && index.row() < d->conversations.count()) {
Q_ASSERT(role == ConversationRole); Q_ASSERT(role == ConversationRole);
result = QVariant::fromValue<QObject*>(d->conversations[index.row()]); result = QVariant::fromValue<Conversation*>(d->conversations[index.row()]);
kDebug() << "returning value " << result; kDebug() << "returning value " << result;
} }
return result; return result;
......
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