]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/extended_panels.cpp
Qt4 - playlist, Don't fetch name if you have title. Less memory used, I think.
[vlc] / modules / gui / qt4 / components / extended_panels.cpp
index f933aa23673f9216fd356afcb964ab13fdbb3359..02909de7c78650e218e643745d28d61300825e07 100644 (file)
@@ -21,6 +21,9 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include <QLabel>
 #include <QVariant>
@@ -105,12 +108,12 @@ ExtVideo::ExtVideo( intf_thread_t *_p_intf, QWidget *_parent ) :
         if( p_obj ) \
         { \
             vlc_object_release( p_obj ); \
-            if( checkbox ) checkbox->setCheckState( Qt::Checked ); \
+            if( checkbox ) checkbox->setChecked( true ); \
             else groupbox->setChecked( true ); \
         } \
         else \
         { \
-            if( checkbox ) checkbox->setCheckState( Qt::Unchecked ); \
+            if( checkbox ) checkbox->setChecked( false ); \
             else groupbox->setChecked( false ); \
         } \
     } \
@@ -212,7 +215,7 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, vlc_bool_t b_add )
 
     /* Please leave p_libvlc_global. This is where cached modules are
      * stored. We're not trying to find a module instance. */
-    module_t *p_obj = module_FindName( p_intf, psz_name );
+    module_t *p_obj = module_Find( p_intf, psz_name );
     if( !p_obj )
     {
         msg_Err( p_intf, "Unable to find filter module \"%s\n.", psz_name );
@@ -233,11 +236,11 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, vlc_bool_t b_add )
     }
     else
     {
-        vlc_object_release( p_obj );
+        module_Put( p_obj );
         msg_Err( p_intf, "Unknown video filter type." );
         return;
     }
-    vlc_object_release( p_obj );
+    module_Put( p_obj );
 
     psz_string = config_GetPsz( p_intf, psz_filter_type );
 
@@ -577,6 +580,12 @@ ExtV4l2::~ExtV4l2()
         delete box;
 }
 
+void ExtV4l2::showEvent( QShowEvent *event )
+{
+    QWidget::showEvent( event );
+    Refresh();
+}
+
 void ExtV4l2::Refresh( void )
 {
     vlc_object_t *p_obj = (vlc_object_t*)vlc_object_find_name( p_intf, "v4l2", FIND_ANYWHERE );
@@ -620,7 +629,7 @@ void ExtV4l2::Refresh( void )
                 case VLC_VAR_INTEGER:
                 {
                     QLabel *label = new QLabel( psz_label, box );
-                    QHBoxLayout *hlayout = new QHBoxLayout( box );
+                    QHBoxLayout *hlayout = new QHBoxLayout();
                     hlayout->addWidget( label );
                     int i_val = var_GetInteger( p_obj, psz_var );
                     if( i_type & VLC_VAR_HASCHOICE )
@@ -683,12 +692,20 @@ void ExtV4l2::Refresh( void )
                 }
                 case VLC_VAR_VOID:
                 {
-                    QPushButton *button = new QPushButton( psz_label, box );
-                    button->setObjectName( psz_var );
+                    if( i_type & VLC_VAR_ISCOMMAND )
+                    {
+                        QPushButton *button = new QPushButton( psz_label, box );
+                        button->setObjectName( psz_var );
 
-                    CONNECT( button, clicked( bool ), this,
-                             ValueChange( bool ) );
-                    layout->addWidget( button );
+                        CONNECT( button, clicked( bool ), this,
+                                 ValueChange( bool ) );
+                        layout->addWidget( button );
+                    }
+                    else
+                    {
+                        QLabel *label = new QLabel( psz_label, box );
+                        layout->addWidget( label );
+                    }
                     break;
                 }
                 default: