[vlc-commits] Qt: regroup systray connect to a central place

Jean-Baptiste Kempf git at videolan.org
Mon Sep 26 01:44:32 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Sep 26 01:42:41 2011 +0200| [734fe5c6ccb1db542298ab883f5410e919c4c4af] | committer: Jean-Baptiste Kempf

Qt: regroup systray connect to a central place

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

 modules/gui/qt4/main_interface.cpp |   37 +++++++++++------------------------
 1 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index ade5b4e..47be473 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * main_interface.cpp : Main interface
  ****************************************************************************
- * Copyright (C) 2006-2010 VideoLAN and AUTHORS
+ * Copyright (C) 2006-2011 VideoLAN and AUTHORS
  * $Id$
  *
  * Authors: Clément Stenac <zorglub at videolan.org>
@@ -174,9 +174,10 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
      *********************************/
     initSystray();
 
-    /************************************************************
-     * Connect the input manager to the GUI elements it manages *
-     ************************************************************/
+    /*************************************************************
+     * Connect the input manager to the GUI elements it manages  *
+     * Beware initSystray did some connects on input manager too *
+     *************************************************************/
     /**
      * Connects on nameChanged()
      * Those connects are different because options can impeach them to trigger.
@@ -184,33 +185,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     /* Main Interface statusbar */
     CONNECT( THEMIM->getIM(), nameChanged( const QString& ),
              this, setName( const QString& ) );
-    /* and systray */
-#ifndef HAVE_MAEMO
-    if( sysTray )
-    {
-        CONNECT( THEMIM->getIM(), nameChanged( const QString& ),
-                 this, updateSystrayTooltipName( const QString& ) );
-    }
-#endif
     /* and title of the Main Interface*/
     if( var_InheritBool( p_intf, "qt-name-in-title" ) )
     {
         CONNECT( THEMIM->getIM(), nameChanged( const QString& ),
                  this, setVLCWindowsTitle( const QString& ) );
     }
-
-    /**
-     * CONNECTS on PLAY_STATUS
-     **/
-    /* Status on the systray */
-#ifndef HAVE_MAEMO
-    if( sysTray )
-    {
-        CONNECT( THEMIM->getIM(), playingStatusChanged( int ),
-                 this, updateSystrayTooltipStatus( int ) );
-    }
-#endif
-
     /* END CONNECTS ON IM */
 
     /* VideoWidget connects for asynchronous calls */
@@ -997,6 +977,13 @@ void MainInterface::createSystray()
 
     CONNECT( sysTray, activated( QSystemTrayIcon::ActivationReason ),
              this, handleSystrayClick( QSystemTrayIcon::ActivationReason ) );
+
+    /* Connects on nameChanged() */
+    CONNECT( THEMIM->getIM(), nameChanged( const QString& ),
+             this, updateSystrayTooltipName( const QString& ) );
+    /* Connect PLAY_STATUS on the systray */
+    CONNECT( THEMIM->getIM(), playingStatusChanged( int ),
+             this, updateSystrayTooltipStatus( int ) );
 }
 
 /**



More information about the vlc-commits mailing list