[vlc-devel] commit: Qt: re-enable services dicovery and fix them (Jean-Philippe Andre )

git version control git at videolan.org
Thu Jan 22 20:19:08 CET 2009


vlc | branch: master | Jean-Philippe Andre <jpeg at via.ecp.fr> | Thu Jan 22 20:17:16 2009 +0100| [be84b46a573e5717204c0ac8d1a012a6c1140265] | committer: Jean-Philippe Andre 

Qt: re-enable services dicovery and fix them

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

 modules/gui/qt4/dialogs_provider.cpp |    3 ++-
 modules/gui/qt4/menus.cpp            |   10 ++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index e2bacb3..6ead882 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -641,11 +641,12 @@ void DialogsProvider::menuUpdateAction( QObject *data )
 
 void DialogsProvider::SDMenuAction( QString data )
 {
-    const char *psz_sd = qtu( data );
+    char *psz_sd = strdup( qtu( data ) );
     if( !playlist_IsServicesDiscoveryLoaded( THEPL, psz_sd ) )
         playlist_ServicesDiscoveryAdd( THEPL, psz_sd );
     else
         playlist_ServicesDiscoveryRemove( THEPL, psz_sd );
+    free( psz_sd );
 }
 
 /**
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 5c45aba..8ca30a4 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -398,14 +398,16 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
                             bool with_intf )
 {
     QMenu *menu = new QMenu( current );
+    QAction *act;
     if( mi )
     {
-        QAction *act=
-            menu->addAction( QIcon( ":/playlist_menu" ), qtr( "Play&list..." ),
-                    mi, SLOT( togglePlaylist() ), qtr( "Ctrl+L" ) );
+        act = menu->addAction( QIcon( ":/playlist_menu" ),
+                               qtr( "Play&list..." ), mi,
+                               SLOT( togglePlaylist() ), qtr( "Ctrl+L" ) );
         act->setData( "_static_" );
     }
-    menu->addMenu( SDMenu( p_intf ) );
+    act = menu->addMenu( SDMenu( p_intf ) );
+    act->setData( "_static_" );
     /*menu->addSeparator();
     menu->addAction( qtr( "Undock from Interface" ), mi,
                      SLOT( undockPlaylist() ), qtr( "Ctrl+U" ) );*/




More information about the vlc-devel mailing list