From: Steve Lhomme Date: Wed, 18 Dec 2024 10:57:05 +0000 (+0100) Subject: qt: use QString::setNum() rather than QString::sprintf() X-Git-Tag: archive/raspbian/3.0.21-6+rpi1^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a3dd4a50a1fef9b767b3245ca811bc7029c72ae4;p=vlc.git qt: use QString::setNum() rather than QString::sprintf() It's deprecated and one of the replacement suggested in the doc [^1]. QString::asprint() might be the more logical choice, but it's also not recommended [^2]. [^1] https://doc.qt.io/qt-5/qstring-obsolete.html#sprintf [^2] https://doc.qt.io/qt-5/qstring.html#asprintf Gbp-Pq: Name 0121-qt-use-QString-setNum-rather-than-QString-sprintf.patch --- diff --git a/modules/gui/qt/menus.cpp b/modules/gui/qt/menus.cpp index 70a475fb..a689b4cf 100644 --- a/modules/gui/qt/menus.cpp +++ b/modules/gui/qt/menus.cpp @@ -1438,7 +1438,7 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var, case VLC_VAR_FLOAT: var_Get( p_object, psz_var, &val ); if( CURTEXT ) menutext = qfue( CURTEXT ); - else menutext.sprintf( "%.2f", CURVAL.f_float ); + else menutext.setNum(CURVAL.f_float, 'f', 2); CreateAndConnect( submenu, psz_var, menutext, "", RADIO_OR_COMMAND, p_object, CURVAL, i_type, CURVAL.f_float == val.f_float );