diff --git a/CMakeLists.txt b/CMakeLists.txt index 537d8d7..7e56aa0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,6 @@ include(ECMQtDeclareLoggingCategory) include(ECMAddTests) include(ECMCoverageOption) - set(PIM_VERSION "5.4.40") set(MAILCOMMON_LIB_VERSION ${PIM_VERSION}) set(AKONADIMIME_LIB_VERSION "5.4.40") diff --git a/src/widgets/favoritecollectionwidget.cpp b/src/widgets/favoritecollectionwidget.cpp index 72b3340..3f7a56d 100644 --- a/src/widgets/favoritecollectionwidget.cpp +++ b/src/widgets/favoritecollectionwidget.cpp @@ -30,6 +30,7 @@ #include #include +#include using namespace MailCommon; @@ -68,6 +69,14 @@ FavoriteCollectionWidget::~FavoriteCollectionWidget() delete d; } +void FavoriteCollectionWidget::mousePressEvent(QMouseEvent *e) +{ + const bool buttonPressedIsMiddle = (e->button() == Qt::MidButton); + Q_EMIT prefereCreateNewTab(buttonPressedIsMiddle); + Akonadi::EntityListView::mousePressEvent(e); +} + + void FavoriteCollectionWidget::updateMode() { switch (viewMode()) { diff --git a/src/widgets/favoritecollectionwidget.h b/src/widgets/favoritecollectionwidget.h index dac2749..1e62824 100644 --- a/src/widgets/favoritecollectionwidget.h +++ b/src/widgets/favoritecollectionwidget.h @@ -50,6 +50,10 @@ protected Q_SLOTS: protected: void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; +Q_SIGNALS: + void prefereCreateNewTab(bool); + private: void createMenu(KActionCollection *ac); class Private;