From 0dbdb73afb9de59463fcccd4f6f25aa6b9e0eb9d Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Wed, 1 Jul 2009 17:57:30 +0200 Subject: [PATCH] ifs instead of switches --- src/videoareawidget.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/videoareawidget.cpp b/src/videoareawidget.cpp index 00d1b6f..645fc65 100644 --- a/src/videoareawidget.cpp +++ b/src/videoareawidget.cpp @@ -25,22 +25,11 @@ void VideoAreaWidget::showLoading(Video *video) { } void VideoAreaWidget::mouseDoubleClickEvent(QMouseEvent *event) { - switch(event->button()) { - case Qt::LeftButton: + if (event->button() == Qt::LeftButton) emit doubleClicked(); - break; - case Qt::RightButton: - - break; - } } void VideoAreaWidget::mousePressEvent(QMouseEvent *event) { - switch(event->button()) { - case Qt::LeftButton: - break; - case Qt::RightButton: - emit rightClicked(); - break; - } + switch(event->button() == Qt::RightButton) + emit rightClicked(); } -- 2.39.5