]> git.sesse.net Git - vlc/commitdiff
Qt4: use constData and provide expansion safety for qtu() and qta()
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 14 Jan 2009 16:36:59 +0000 (18:36 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 14 Jan 2009 16:36:59 +0000 (18:36 +0200)
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/dialogs/bookmarks.cpp
modules/gui/qt4/qt4.hpp

index 501a6aa1cd4d8118e7e6b0288be027c33d5bc396..2a13748f23b9645c080f190b8488d3220dcb7de2 100644 (file)
@@ -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 );
index 0638523674904ef0bddb7da382767efd9c78ec1c..799e2690c5263f68d27dd1ce07da5eb50d74cf49 100644 (file)
@@ -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 );
     }
index 66283c858a87d6536564bbfebba2a5c4a2fa0821..591158d979c93c4d4657d2f5df085ea0af88541d 100644 (file)
@@ -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) )