[vlc-devel] commit: Qt4: use constData and provide expansion safety for qtu() and qta() ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Jan 14 17:39:06 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Jan 14 18:36:59 2009 +0200| [1d2eb88885a47fabd102335ea01377292820a693] | committer: Rémi Denis-Courmont 

Qt4: use constData and provide expansion safety for qtu() and qta()

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

 modules/gui/qt4/components/preferences_widgets.cpp |    2 +-
 modules/gui/qt4/dialogs/bookmarks.cpp              |    4 ++--
 modules/gui/qt4/qt4.hpp                            |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 501a6aa..2a13748 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -434,7 +434,7 @@ void StringListConfigControl::actionRequested( int i_action )
     if(!p_module_config) return;
 
     vlc_value_t val;
-    val.psz_string =
+    val.psz_string = const_cast<char *>
         qtu( (combo->itemData( combo->currentIndex() ).toString() ) );
 
     p_module_config->ppf_action[i_action]( p_this, getName(), val, val, 0 );
diff --git a/modules/gui/qt4/dialogs/bookmarks.cpp b/modules/gui/qt4/dialogs/bookmarks.cpp
index 0638523..799e269 100644
--- a/modules/gui/qt4/dialogs/bookmarks.cpp
+++ b/modules/gui/qt4/dialogs/bookmarks.cpp
@@ -152,8 +152,8 @@ void BookmarksDialog::add()
 
     if( !input_Control( p_input, INPUT_GET_BOOKMARK, &bookmark ) )
     {
-        bookmark.psz_name = qtu( THEMIM->getIM()->getName() +
-                                 QString("_%1" ).arg( bookmarksList->topLevelItemCount() ) );
+        bookmark.psz_name = const_cast<char *>qtu( THEMIM->getIM()->getName() +
+                   QString("_%1" ).arg( bookmarksList->topLevelItemCount() ) );
 
         input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
     }
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index 66283c8..591158d 100644
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -84,8 +84,8 @@ struct intf_sys_t
 
 #define qfu( i ) QString::fromUtf8( i )
 #define qtr( i ) QString::fromUtf8( _(i) )
-#define qtu( i ) (i).toUtf8().data()
-#define qta( i ) (i).toAscii().data()
+#define qtu( i ) ((i).toUtf8().constData())
+#define qta( i ) ((i).toAscii().constData())
 
 #define CONNECT( a, b, c, d ) connect( a, SIGNAL( b ), c, SLOT(d) )
 #define BUTTONACT( b, a ) connect( b, SIGNAL( clicked() ), this, SLOT(a) )




More information about the vlc-devel mailing list