[vlc-commits] Revert "Qt: handle special mouse buttons"

Francois Cartegnie git at videolan.org
Fri Mar 2 12:09:52 CET 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Mar  2 12:08:45 2012 +0100| [251eeba2e07bf8579a3e6c1b03011bbab19854fe] | committer: Francois Cartegnie

Revert "Qt: handle special mouse buttons"

This reverts commit e3511f67bc3ea374382359ed92b6d4312282f7a9.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=251eeba2e07bf8579a3e6c1b03011bbab19854fe
---

 modules/gui/qt4/components/preferences_widgets.cpp |    8 --------
 modules/gui/qt4/components/preferences_widgets.hpp |    1 -
 modules/gui/qt4/main_interface.cpp                 |   12 ------------
 modules/gui/qt4/main_interface.hpp                 |    1 -
 modules/gui/qt4/util/customwidgets.cpp             |   20 --------------------
 modules/gui/qt4/util/customwidgets.hpp             |    1 -
 6 files changed, 0 insertions(+), 43 deletions(-)

diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 6eb66d4..59bda1a 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -1614,11 +1614,3 @@ void KeyInputDialog::wheelEvent( QWheelEvent *e )
     keyValue = i_vlck;
 }
 
-void KeyInputDialog::mousePressEvent( QMouseEvent *e )
-{
-    int i_vlck = qtMouseEventToVLCKey( e );
-    selected->setText( qtr( "Key: " ) + VLCKeyToString( i_vlck ) );
-    checkForConflicts( i_vlck );
-    keyValue = i_vlck;
-}
-
diff --git a/modules/gui/qt4/components/preferences_widgets.hpp b/modules/gui/qt4/components/preferences_widgets.hpp
index 78686f8..485210a 100644
--- a/modules/gui/qt4/components/preferences_widgets.hpp
+++ b/modules/gui/qt4/components/preferences_widgets.hpp
@@ -485,7 +485,6 @@ private:
     void checkForConflicts( int i_vlckey );
     void keyPressEvent( QKeyEvent *);
     void wheelEvent( QWheelEvent *);
-    void mousePressEvent( QMouseEvent * );
     bool b_global;
 };
 #endif
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index e0a8562..091a99b 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -1314,18 +1314,6 @@ void MainInterface::wheelEvent( QWheelEvent *e )
     e->accept();
 }
 
-void MainInterface::mousePressEvent( QMouseEvent *e )
-{
-    int i_vlckey = qtMouseEventToVLCKey( e );
-    if( i_vlckey > 0 )
-    {
-        var_SetInteger( p_intf->p_libvlc, "key-pressed", i_vlckey );
-        e->accept();
-    }
-    else
-        e->ignore();
-}
-
 void MainInterface::closeEvent( QCloseEvent *e )
 {
 //  hide();
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index 39c0de5..3567c4a 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -101,7 +101,6 @@ protected:
     virtual void closeEvent( QCloseEvent *);
     virtual void keyPressEvent( QKeyEvent *);
     virtual void wheelEvent( QWheelEvent * );
-    virtual void mousePressEvent( QMouseEvent * );
 
 private:
     /* Main Widgets Creation */
diff --git a/modules/gui/qt4/util/customwidgets.cpp b/modules/gui/qt4/util/customwidgets.cpp
index fce8555..16c6563 100644
--- a/modules/gui/qt4/util/customwidgets.cpp
+++ b/modules/gui/qt4/util/customwidgets.cpp
@@ -286,26 +286,6 @@ int qtWheelEventToVLCKey( QWheelEvent *e )
     return i_vlck;
 }
 
-int qtMouseEventToVLCKey( QMouseEvent *e )
-{
-    int i_vlck = 0;
-    switch( e->button() )
-    {
-    case Qt::MidButton:
-        i_vlck |= KEY_MOUSEBUTTON_MID;
-        break;
-    case Qt::XButton1:
-        i_vlck |= KEY_MOUSEBUTTON_X1;
-        break;
-    case Qt::XButton2:
-        i_vlck |= KEY_MOUSEBUTTON_X2;
-    default:
-        break;
-    }
-    if ( i_vlck > 0 ) i_vlck |= qtKeyModifiersToVLC( e );
-    return i_vlck;
-}
-
 QString VLCKeyToString( unsigned val )
 {
     char *base = vlc_keycode2str (val);
diff --git a/modules/gui/qt4/util/customwidgets.hpp b/modules/gui/qt4/util/customwidgets.hpp
index ac0d5fc..8f8fb3e 100644
--- a/modules/gui/qt4/util/customwidgets.hpp
+++ b/modules/gui/qt4/util/customwidgets.hpp
@@ -179,7 +179,6 @@ class QInputEvent;
 int qtKeyModifiersToVLC( QInputEvent* e );
 int qtEventToVLCKey( QKeyEvent *e );
 int qtWheelEventToVLCKey( QWheelEvent *e );
-int qtMouseEventToVLCKey( QMouseEvent *e );
 QString VLCKeyToString( unsigned val );
 
 #endif



More information about the vlc-commits mailing list