]> git.sesse.net Git - vlc/commitdiff
Qt: menus, minor code reorg.
authorJean-Baptiste Kempf <jb@sasmira.jbkempf.com>
Thu, 19 Feb 2009 23:36:33 +0000 (00:36 +0100)
committerJean-Baptiste Kempf <jb@sasmira.jbkempf.com>
Thu, 19 Feb 2009 23:44:37 +0000 (00:44 +0100)
modules/gui/qt4/menus.cpp

index 960789fccf35fd722a90e0986758e3e795ce2c98..063dfae792256eb0e41e931da30617332a74af3e 100644 (file)
@@ -110,6 +110,26 @@ void addDPStaticEntry( QMenu *menu,
     action->setData( true );
 }
 
+/***
+ * Same for MIM
+ ***/
+void addMIMStaticEntry( intf_thread_t *p_intf,
+                        QMenu *menu,
+                        const QString text,
+                        const char *icon,
+                        const char *member )
+{
+    if( strlen( icon ) > 0 )
+    {
+        QAction *action = menu->addAction( text, THEMIM,  member );
+        action->setIcon( QIcon( icon ) );
+    }
+    else
+    {
+        menu->addAction( text, THEMIM, member );
+    }
+}
+
 /**
  * @brief Enable all static entries, disable the others
  * @param enable if false, disable all entries
@@ -144,24 +164,18 @@ int DeleteNonStaticEntries( QMenu *menu )
     return i_ret;
 }
 
-/***
- * Same for MIM
- ***/
-void addMIMStaticEntry( intf_thread_t *p_intf,
-                        QMenu *menu,
-                        const QString text,
-                        const char *icon,
-                        const char *member )
+/**
+ * \return QAction associated to psz_var variable
+ **/
+static QAction * FindActionWithVar( QMenu *menu, const char *psz_var )
 {
-    if( strlen( icon ) > 0 )
-    {
-        QAction *action = menu->addAction( text, THEMIM,  member );
-        action->setIcon( QIcon( icon ) );
-    }
-    else
+    QList< QAction* > actions = menu->actions();
+    for( int i = 0; i < actions.size(); ++i )
     {
-        menu->addAction( text, THEMIM, member );
+        if( actions[i]->data().toString() == psz_var )
+            return actions[i];
     }
+    return NULL;
 }
 
 /*****************************************************************************
@@ -225,17 +239,6 @@ static int AudioAutoMenuBuilder( aout_instance_t *p_object,
     return VLC_SUCCESS;
 }
 
-static QAction * FindActionWithVar( QMenu *menu, const char *psz_var )
-{
-    QList< QAction* > actions = menu->actions();
-    for( int i = 0; i < actions.size(); ++i )
-    {
-        if( actions[i]->data().toString() == psz_var )
-            return actions[i];
-    }
-    return NULL;
-}
-
 /*****************************************************************************
  * All normal menus
  * Simple Code