]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/mvc/treeview.cpp
Bump copyright years.
[toast/confclerk.git] / src / mvc / treeview.cpp
index b4510ce3cb9eb517940821e0ea6e9c67055c1827..dfce255bd924b85018bf6cad944d17b8c0bf1c3a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Ixonos Plc.
- * Copyright (C) 2011-2015 Philipp Spitzer, gregor herrmann, Stefan Stahl
+ * Copyright (C) 2011-2024 Philipp Spitzer, gregor herrmann, Stefan Stahl
  *
  * This file is part of ConfClerk.
  *
@@ -44,7 +44,7 @@ void TreeView::mouseReleaseEvent(QMouseEvent *aEvent)
     QPoint point = aEvent->pos();
 
     // test whether we have handled the mouse event
-    if(!testForControlClicked(index,point))
+    if(!testForControlClicked(index, point, aEvent->button()))
     {
         // pass the event to the Base class, so item clicks/events are handled correctly
         QTreeView::mouseReleaseEvent(aEvent);
@@ -52,7 +52,7 @@ void TreeView::mouseReleaseEvent(QMouseEvent *aEvent)
 }
 
 // returns bool if some Control was clicked
-bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint)
+bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint, Qt::MouseButton button)
 {
     bool handled = false;
 
@@ -72,7 +72,7 @@ bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aP
                 Event event = Event::getById(aIndex.data().toInt(),confId);
 
                 QList<Event> conflicts = Event::conflictEvents(event.id(),Conference::activeConference());
-                event.cycleFavourite();
+                event.cycleFavourite(button == Qt::RightButton);
                 event.update("favourite");
 
                 // event has became 'favourite' and so 'conflicts' list may have changed