summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/EventViewer/EventDelegate.cpp')
-rw-r--r--Swift/QtUI/EventViewer/EventDelegate.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Swift/QtUI/EventViewer/EventDelegate.cpp b/Swift/QtUI/EventViewer/EventDelegate.cpp
index 79b8854..9ecdd34 100644
--- a/Swift/QtUI/EventViewer/EventDelegate.cpp
+++ b/Swift/QtUI/EventViewer/EventDelegate.cpp
@@ -11,10 +11,11 @@
#include "Swift/Controllers/XMPPEvents/MessageEvent.h"
#include "Swift/Controllers/XMPPEvents/ErrorEvent.h"
#include "Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h"
+#include "Swift/Controllers/XMPPEvents/MUCInviteEvent.h"
namespace Swift {
-EventDelegate::EventDelegate() : QStyledItemDelegate(), messageDelegate_(QtEvent::SenderRole, Qt::DisplayRole, false), subscriptionDelegate_(QtEvent::SenderRole, Qt::DisplayRole, true), errorDelegate_(QtEvent::SenderRole, Qt::DisplayRole, true) {
+EventDelegate::EventDelegate() : QStyledItemDelegate(), messageDelegate_(QtEvent::SenderRole, Qt::DisplayRole, false), subscriptionDelegate_(QtEvent::SenderRole, Qt::DisplayRole, true), errorDelegate_(QtEvent::SenderRole, Qt::DisplayRole, true), mucInviteDelegate_(QtEvent::SenderRole, Qt::DisplayRole, false) {
}
@@ -27,6 +28,7 @@ QSize EventDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIn
case MessageEventType: return messageDelegate_.sizeHint(option, item);
case SubscriptionEventType: return subscriptionDelegate_.sizeHint(option, item);
case ErrorEventType: return errorDelegate_.sizeHint(option, item);
+ case MUCInviteEventType: return mucInviteDelegate_.sizeHint(option, item);
default: return QStyledItemDelegate::sizeHint(option, index);
}
}
@@ -41,6 +43,7 @@ void EventDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option,
case MessageEventType: messageDelegate_.paint(painter, option, item);break;
case SubscriptionEventType: subscriptionDelegate_.paint(painter, option, item);break;
case ErrorEventType: errorDelegate_.paint(painter, option, item);break;
+ case MUCInviteEventType: mucInviteDelegate_.paint(painter, option, item);break;
default: QStyledItemDelegate::paint(painter, option, index);
}
}
@@ -52,6 +55,8 @@ EventType EventDelegate::getEventType(boost::shared_ptr<StanzaEvent> event) cons
if (subscriptionEvent) return SubscriptionEventType;
boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(event);
if (errorEvent) return ErrorEventType;
+ boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event);
+ if (mucInviteEvent) return MUCInviteEventType;
//I don't know what this is.
assert(false);
return MessageEventType;