[vlc-commits] commit: Qt: sprintf is deprecated (Francois Cartegnie )

git at videolan.org git at videolan.org
Sun Mar 28 23:14:05 CEST 2010


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Mar 11 17:01:16 2010 +0100| [cc28873a137884794da5c09c5ccfd7b21a07e2e7] | committer: Jean-Baptiste Kempf 

Qt: sprintf is deprecated

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/components/interface_widgets.cpp |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 81bafb3..c7f79ca 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -630,9 +630,10 @@ void TimeLabel::setDisplayPosition( float pos, int64_t t, int length )
     secstotimestr( psz_time, ( b_remainingTime && length ) ? length - time
                                                            : time );
 
-    QString timestr;
-    timestr.sprintf( " %s%s/%s ", (b_remainingTime && length) ? "-" : "",
-                     psz_time, ( !length && time ) ? "--:--" : psz_length );
+    QString timestr = QString( " %1%2/%3 " )
+            .arg( QString( (b_remainingTime && length) ? "-" : "" ) )
+            .arg( QString( psz_time ) )
+            .arg( QString( ( !length && time ) ? "--:--" : psz_length ) );
 
     setText( timestr );
 
@@ -651,9 +652,10 @@ void TimeLabel::setDisplayPosition( float pos )
     secstotimestr( psz_time,
                    ( b_remainingTime && cachedLength ?
                    cachedLength - time : time ) );
-    QString timestr;
-    timestr.sprintf( " %s%s/%s ", (b_remainingTime && cachedLength) ? "-" : "",
-                     psz_time, ( !cachedLength && time ) ? "--:--" : psz_length );
+    QString timestr = QString( " %1%2/%3 " )
+        .arg( QString( (b_remainingTime && cachedLength) ? "-" : "" ) )
+        .arg( QString( psz_time ) )
+        .arg( QString( ( !cachedLength && time ) ? "--:--" : psz_length ) );
 
     setText( timestr );
 }



More information about the vlc-commits mailing list