]> git.sesse.net Git - vlc/commitdiff
Qt: sprintf is deprecated
authorFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 11 Mar 2010 16:01:16 +0000 (17:01 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 28 Mar 2010 20:12:17 +0000 (22:12 +0200)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/components/interface_widgets.cpp

index 81bafb3adafe472d6c09342d5fc086fcfa307047..c7f79cad0c6893bc4a7ebc2ec2beac3f8fc8532f 100644 (file)
@@ -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 );
 }