[vlc-devel] [PATCH 2/2] BROKEN HACK: Qt: make it compile

Rémi Denis-Courmont remi at remlab.net
Wed Jul 4 20:28:37 CEST 2012


This patch breaks the preferences dialog. Only for testing.
---
 .../gui/qt4/components/complete_preferences.cpp    |   24 +++++++++++---------
 modules/gui/qt4/components/controller.cpp          |    2 --
 modules/gui/qt4/dialogs/preferences.cpp            |    2 +-
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/modules/gui/qt4/components/complete_preferences.cpp b/modules/gui/qt4/components/complete_preferences.cpp
index 4c6658a..fc6da51 100644
--- a/modules/gui/qt4/components/complete_preferences.cpp
+++ b/modules/gui/qt4/components/complete_preferences.cpp
@@ -238,8 +238,8 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
         {
             /* Get the treeWidgetItem that correspond to the category */
             QTreeWidgetItem *cat_item = topLevelItem( i_cat_index );
-            PrefsItemData *data = cat_item->data( 0, Qt::UserRole ).
-                                             value<PrefsItemData *>();
+            PrefsItemData *data = (PrefsItemData *)
+                cat_item->data( 0, Qt::UserRole ).value<void *>();
 
             /* If we match the good category */
             if( data->i_object_id == i_category )
@@ -248,8 +248,8 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
                          i_sc_index++ )
                 {
                     subcat_item = cat_item->child( i_sc_index );
-                    PrefsItemData *sc_data = subcat_item->data(0, Qt::UserRole).
-                                                value<PrefsItemData *>();
+                    PrefsItemData *sc_data = (PrefsItemData *)
+                        subcat_item->data(0, Qt::UserRole).value<void *>();
                     if( sc_data && sc_data->i_object_id == i_subcategory )
                     {
                         b_found = true;
@@ -313,8 +313,9 @@ void PrefsTree::doAll( bool doclean )
             for( int i_module = 0 ; i_module < sc_item->childCount();
                      i_module++ )
             {
-                PrefsItemData *data = sc_item->child( i_module )->
-                               data( 0, Qt::UserRole).value<PrefsItemData *>();
+                PrefsItemData *data = (PrefsItemData *)
+                    sc_item->child( i_module )->data( 0, Qt::UserRole)
+                                                              .value<void *>();
                 if( data->panel && doclean )
                 {
                     delete data->panel;
@@ -323,8 +324,8 @@ void PrefsTree::doAll( bool doclean )
                 else if( data->panel )
                     data->panel->apply();
             }
-            PrefsItemData *data = sc_item->data( 0, Qt::UserRole).
-                                            value<PrefsItemData *>();
+            PrefsItemData *data = (PrefsItemData *)
+                sc_item->data( 0, Qt::UserRole ).value<void *>();
             if( data->panel && doclean )
             {
                 delete data->panel;
@@ -333,8 +334,8 @@ void PrefsTree::doAll( bool doclean )
             else if( data->panel )
                 data->panel->apply();
         }
-        PrefsItemData *data = cat_item->data( 0, Qt::UserRole).
-                                            value<PrefsItemData *>();
+        PrefsItemData *data = (PrefsItemData *)
+            cat_item->data( 0, Qt::UserRole).value<void *>();
         if( data->panel && doclean )
         {
             delete data->panel;
@@ -362,7 +363,8 @@ bool PrefsTree::filterItems( QTreeWidgetItem *item, const QString &text,
         }
     }
 
-    PrefsItemData *data = item->data( 0, Qt::UserRole ).value<PrefsItemData *>();
+    PrefsItemData *data = (PrefsItemData *)
+        item->data( 0, Qt::UserRole ).value<void *>();
 
     bool filtered = sub_filtered && !data->contains( text, cs );
     item->setExpanded( !sub_filtered );
diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index 774a3c7..75f94cd 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -824,10 +824,8 @@ void FullscreenControllerWidget::restoreFSC()
         updateFullwidthGeometry( targetScreen() );
     }
 
-#ifdef Q_WS_X11
     // Tell kwin that we do not want a shadow around the fscontroller
     setMask( QRegion( 0, 0, width(), height() ) );
-#endif
 }
 
 void FullscreenControllerWidget::centerFSC( int number )
diff --git a/modules/gui/qt4/dialogs/preferences.cpp b/modules/gui/qt4/dialogs/preferences.cpp
index d7fecf4..7639cf4 100644
--- a/modules/gui/qt4/dialogs/preferences.cpp
+++ b/modules/gui/qt4/dialogs/preferences.cpp
@@ -224,7 +224,7 @@ void PrefsDialog::changeSimplePanel( int number )
 void PrefsDialog::changeAdvPanel( QTreeWidgetItem *item )
 {
     if( item == NULL ) return;
-    PrefsItemData *data = item->data( 0, Qt::UserRole ).value<PrefsItemData*>();
+    PrefsItemData *data = (PrefsItemData *)item->data( 0, Qt::UserRole ).value<void *>();
 
     if( !data->panel )
     {
-- 
1.7.10.4




More information about the vlc-devel mailing list