]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/qt4.cpp
Qt4 - New Simple Preferences look'n feel. Should work without too many segfaults...
[vlc] / modules / gui / qt4 / qt4.cpp
index 40883c39e1690cc133d39821a38eae7af0bacf42..c4800ee679ed23d7b517633449011fd397dfe629 100644 (file)
@@ -55,7 +55,7 @@ vlc_module_begin();
 
     add_submodule();
         set_description( "Dialogs provider" );
-        set_capability( "dialogs provider", 49 );
+        set_capability( "dialogs provider", 51 );
         add_bool( "qt-always-video", VLC_FALSE, NULL, "FIXME", "FIXME", VLC_TRUE );
         set_callbacks( OpenDialogs, Close );
 vlc_module_end();
@@ -68,6 +68,13 @@ static int Open( vlc_object_t *p_this )
 {
     intf_thread_t *p_intf = (intf_thread_t *)p_this;
     p_intf->pf_run = Run;
+#if defined HAVE_GETENV && defined Q_WS_X11
+    if( !getenv( "DISPLAY" ) )
+    {
+        msg_Err(p_intf, "no X server");
+        return VLC_EGENERIC;
+    }
+#endif
     p_intf->p_sys = (intf_sys_t *)malloc(sizeof( intf_sys_t ) );
     if( !p_intf->p_sys )
     {
@@ -75,13 +82,6 @@ static int Open( vlc_object_t *p_this )
         return VLC_ENOMEM;
     }
     memset( p_intf->p_sys, 0, sizeof( intf_sys_t ) );
-#ifdef HAVE_GETENV
-    if( !getenv( "DISPLAY" ) )
-    {
-        msg_Err(p_intf, "no X server");
-        return VLC_EGENERIC;
-    }
-#endif
 
     p_intf->p_sys->p_playlist = pl_Yield( p_intf );
     p_intf->p_sys->p_sub = msg_Subscribe( p_intf, MSG_QUEUE_NORMAL );
@@ -131,9 +131,7 @@ static void Init( intf_thread_t *p_intf )
     char *argv[] = { "" };
     int argc = 1;
     Q_INIT_RESOURCE( vlc );
-msg_Err(p_intf,"before Qapplication constructor");
     QApplication *app = new QApplication( argc, argv , true );
-    msg_Err(p_intf,"after constructoe");
     app->setWindowIcon( QIcon( QPixmap(vlc_xpm) ) );
     p_intf->p_sys->p_app = app;