From 1c5ffce259097682408e25c52d6174e7652e9cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Fri, 19 Apr 2013 19:39:38 +0200 Subject: Fixed compilation warning. Change-Id: Iecf948cc4a2fb3a0f8fc967260b195f2e226b3a3 diff --git a/Swift/QtUI/EventViewer/EventDelegate.cpp b/Swift/QtUI/EventViewer/EventDelegate.cpp index fdb1866..c0904b3 100644 --- a/Swift/QtUI/EventViewer/EventDelegate.cpp +++ b/Swift/QtUI/EventViewer/EventDelegate.cpp @@ -25,11 +25,13 @@ QSize EventDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIn return QStyledItemDelegate::sizeHint(option, index); } switch (getEventType(item->getEvent())) { - 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); + 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); } + assert(false); + return QSize(); } void EventDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const { @@ -39,22 +41,30 @@ void EventDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, return; } switch (getEventType(item->getEvent())) { - 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; + 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; } } EventType EventDelegate::getEventType(boost::shared_ptr event) const { boost::shared_ptr messageEvent = boost::dynamic_pointer_cast(event); - if (messageEvent) return MessageEventType; + if (messageEvent) { + return MessageEventType; + } boost::shared_ptr subscriptionEvent = boost::dynamic_pointer_cast(event); - if (subscriptionEvent) return SubscriptionEventType; + if (subscriptionEvent) { + return SubscriptionEventType; + } boost::shared_ptr errorEvent = boost::dynamic_pointer_cast(event); - if (errorEvent) return ErrorEventType; + if (errorEvent) { + return ErrorEventType; + } boost::shared_ptr mucInviteEvent = boost::dynamic_pointer_cast(event); - if (mucInviteEvent) return MUCInviteEventType; + if (mucInviteEvent) { + return MUCInviteEventType; + } //I don't know what this is. assert(false); return MessageEventType; -- cgit v0.10.2-6-g49f6