diff options
| author | Remko Tronçon <git@el-tramo.be> | 2013-04-19 17:39:38 (GMT) | 
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2013-04-19 17:39:38 (GMT) | 
| commit | 1c5ffce259097682408e25c52d6174e7652e9cfe (patch) | |
| tree | f85f1c22ef9f9e997a00c66520756d567cb774a9 /Swift/QtUI | |
| parent | 271208c8690c22544102ae30d9bb4b5189fc91cc (diff) | |
| download | swift-contrib-1c5ffce259097682408e25c52d6174e7652e9cfe.zip swift-contrib-1c5ffce259097682408e25c52d6174e7652e9cfe.tar.bz2 | |
Fixed compilation warning.
Change-Id: Iecf948cc4a2fb3a0f8fc967260b195f2e226b3a3
Diffstat (limited to 'Swift/QtUI')
| -rw-r--r-- | Swift/QtUI/EventViewer/EventDelegate.cpp | 34 | 
1 files changed, 22 insertions, 12 deletions
| 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<StanzaEvent> event) const {  	boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(event); -	if (messageEvent) return MessageEventType; +	if (messageEvent) { +		return MessageEventType; +	}  	boost::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(event); -	if (subscriptionEvent) return SubscriptionEventType; +	if (subscriptionEvent) { +		return SubscriptionEventType; +	}  	boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(event); -	if (errorEvent) return ErrorEventType; +	if (errorEvent) { +		return ErrorEventType; +	}  	boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event); -	if (mucInviteEvent) return MUCInviteEventType; +	if (mucInviteEvent) { +		return MUCInviteEventType; +	}  	//I don't know what this is.  	assert(false);  	return MessageEventType; | 
 Swift
 Swift