[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/libs/plasma/widgets
From:       Christopher Blauvelt <cblauvelt () gmail ! com>
Date:       2008-01-10 23:29:07
Message-ID: 1200007747.153204.32590.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 759629 by cblauvelt:

Use mouseDoubleClickEvent instead of a custom implementation.



 M  +5 -7      icon.cpp  
 M  +7 -6      icon.h  
 M  +0 -2      icon_p.h  


--- trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon.cpp #759628:759629
@@ -1016,13 +1016,6 @@
     if (!handled) {
         if (boundingRect().contains(event->pos())) {
             emit clicked();
-
-            if (qApp && d->lastClicked.isValid() && d->lastClicked.elapsed() < \
                qApp->doubleClickInterval()) {
-                emit doubleClicked();
-                d->lastClicked = QTime();
-            } else {
-                d->lastClicked.restart();
-            }
         }
         emit pressed(false);
     }
@@ -1030,6 +1023,11 @@
     update();
 }
 
+void Icon::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
+{
+    emit doubleClicked();
+}
+
 void Icon::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
 {
     foreach (IconAction *action, d->cornerActions) {
--- trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon.h #759628:759629
@@ -209,18 +209,18 @@
 
 Q_SIGNALS:
     /**
-     * Indicates when the icon has been pressed.
-     */
+    * Indicates when the icon has been pressed.
+    */
     void pressed(bool down);
 
     /**
-     * Indicates when the icon has been clicked.
-     */
+    * Indicates when the icon has been clicked.
+    */
     void clicked();
 
     /**
-     * Indicates when the icon has been double clicked.
-     */
+    * Indicates when the icon has been double-clicked
+    */
     void doubleClicked();
 
 protected:
@@ -228,6 +228,7 @@
     void mousePressEvent(QGraphicsSceneMouseEvent *event);
     void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
     void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
 
     void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
     void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
--- trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon_p.h #759628:759629
@@ -23,7 +23,6 @@
 #define ICON_P_H
 
 #include <QtCore/QEvent>
-#include <QtCore/QTime>
 #include <QtGui/QApplication>
 #include <QtGui/QIcon>
 #include <QtGui/QStyleOptionGraphicsItem>
@@ -170,7 +169,6 @@
     QColor shadowColor;
     QSizeF iconSize;
     QIcon icon;
-    QTime lastClicked;
     IconStates states;
     Qt::Orientation orientation;
     int numDisplayLines;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic