[vlc-devel] commit: [Qt] You need now Qt4.3... (Jean-Baptiste Kempf )

git version control git at videolan.org
Tue Dec 9 18:03:52 CET 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Dec  9 18:02:27 2008 +0100| [b2cd212401680dbed71b9eb71bbb80dbee2c9834] | committer: Jean-Baptiste Kempf 

[Qt] You need now Qt4.3...

Even lenny has it... (etch doesn't)
If you want to maintain a Qt4.2 version, you are welcome.

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

 configure.ac                                       |    2 +-
 modules/gui/qt4/components/interface_widgets.cpp   |    6 ------
 modules/gui/qt4/components/open_panels.cpp         |    8 --------
 .../gui/qt4/components/playlist/standardpanel.cpp  |    4 ----
 modules/gui/qt4/components/simple_preferences.cpp  |    2 --
 modules/gui/qt4/qt4.hpp                            |   10 ++++------
 6 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/configure.ac b/configure.ac
index ba63700..b01976c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4898,7 +4898,7 @@ AC_ARG_ENABLE(qt4,
   AS_IF([test "${SYS}" = "darwin"], [enable_qt4=no])
 ])
 AS_IF([test "${enable_qt4}" != "no"], [
-  PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.2.0], [
+  PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.3.0], [
     VLC_ADD_PLUGIN([qt4])
     AC_DEFINE([HAVE_QT4], 1, [Define to 1 if you have QT4 library.])
     ALIASES="${ALIASES} qvlc"
diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index d78ef8c..336bbc9 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -87,15 +87,9 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
     setAttribute( Qt::WA_PaintOnScreen, true );
 
     /* The core can ask through a callback to show the video. */
-#if HAS_QT43
     connect( this, SIGNAL(askVideoWidgetToShow( unsigned int, unsigned int)),
              this, SLOT(SetSizing(unsigned int, unsigned int )),
              Qt::BlockingQueuedConnection );
-#else
-#warning This is broken. Fix it with a QEventLoop with a processEvents ()
-    connect( this, SIGNAL(askVideoWidgetToShow( unsigned int, unsigned int)),
-             this, SLOT(SetSizing(unsigned int, unsigned int )) );
-#endif
 }
 
 void VideoWidget::paintEvent(QPaintEvent *ev)
diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index 3376c42..cb1ca1c 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -77,10 +77,8 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
     dialogBox->setFileMode( QFileDialog::ExistingFiles );
     dialogBox->setAcceptMode( QFileDialog::AcceptOpen );
-#if HAS_QT43
     dialogBox->restoreState(
             getSettings()->value( "file-dialog-state" ).toByteArray() );
-#endif
 
     /* We don't want to see a grip in the middle of the window, do we? */
     dialogBox->setSizeGripEnabled( false );
@@ -96,11 +94,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
     /* Ugly hacks to get the good Widget */
     //This lineEdit is the normal line in the fileDialog.
-#if HAS_QT43
     lineFileEdit = dialogBox->findChildren<QLineEdit*>()[0];
-#else
-    lineFileEdit = dialogBox->findChildren<QLineEdit*>()[1];
-#endif
     /* Make a list of QLabel inside the QFileDialog to access the good ones */
     QList<QLabel *> listLabel = dialogBox->findChildren<QLabel*>();
 
@@ -144,9 +138,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
 FileOpenPanel::~FileOpenPanel()
 {
-#if HAS_QT43
     getSettings()->setValue( "file-dialog-state", dialogBox->saveState() );
-#endif
 }
 
 /* Show a fileBrowser to select a subtitle */
diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index d0be2e9..8bb6156 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -77,14 +77,12 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
 
 
     getSettings()->beginGroup("Playlist");
-#if HAS_QT43
     if( getSettings()->contains( "headerState" ) )
     {
         view->header()->restoreState(
                 getSettings()->value( "headerState" ).toByteArray() );
     }
     else
-#endif
     {
         /* Configure the size of the header */
         view->header()->resizeSection( 0, 200 );
@@ -355,11 +353,9 @@ void StandardPLPanel::deleteSelection()
 
 StandardPLPanel::~StandardPLPanel()
 {
-#if HAS_QT43
     getSettings()->beginGroup("Playlist");
     getSettings()->setValue( "headerState", view->header()->saveState() );
     getSettings()->endGroup();
-#endif
 }
 
 
diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index 23c4bd7..3dd6f14 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -309,9 +309,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             optionWidgets.append( ui.outputModule );
             optionWidgets.append( ui.volNormBox );
             /*Little mofification of ui.volumeValue to compile with Qt < 4.3 */
-#if HAS_QT43
             ui.volumeValue->setButtonSymbols(QAbstractSpinBox::NoButtons);
-#endif
             optionWidgets.append( ui.volumeValue );
             updateAudioOptions( ui.outputModule->currentIndex() );
 
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index ef2a7f5..49a3b91 100644
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -35,7 +35,9 @@
 
 #include <QEvent>
 
-#define HAS_QT43 ( QT_VERSION >= 0x040300 )
+#if ( QT_VERSION < 0x040300 )
+# error Update your Qt
+#endif
 
 enum {
     QT_NORMAL_MODE = 0,
@@ -115,11 +117,7 @@ struct intf_sys_t
 #define TOGGLEV( x ) { if( x->isVisible() ) x->hide();          \
             else  x->show(); }
 
-#if HAS_QT43
-    #define setLayoutMargins( a, b, c, d, e) setContentsMargins( a, b, c, d )
-#else
-    #define setLayoutMargins( a, b, c, d, e) setMargin( e )
-#endif
+#define setLayoutMargins( a, b, c, d, e) setContentsMargins( a, b, c, d )
 
 #define getSettings() p_intf->p_sys->mainSettings
 




More information about the vlc-devel mailing list