SHARE
TWEET

Untitled

a guest Jan 21st, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/modules/gui/qt4/components/info_panels.cpp b/modules/gui/qt4/components/info_panels.cpp
  2. index 849c7cd..b670c80 100644
  3. --- a/modules/gui/qt4/components/info_panels.cpp
  4. +++ b/modules/gui/qt4/components/info_panels.cpp
  5. @@ -572,11 +572,13 @@ void InputStatsPanel::update( input_item_t *p_item )
  6.      assert( p_item );
  7.      vlc_mutex_lock( &p_item->p_stats->lock );
  8.  
  9. +#undef sprintf
  10.  #define UPDATE_INT( widget, calc... ) \
  11.      { widget->setText( 1, QString::number( (qulonglong)calc ) ); }
  12.  
  13.  #define UPDATE_FLOAT( widget, format, calc... ) \
  14. -    { QString str; widget->setText( 1 , str.sprintf( format, ## calc ) );  }
  15. +    { char str[40]; snprintf(str, sizeof(str), format, ##calc); widget->setText(1, str); }
  16. +    //{ QString str; widget->setText( 1 , str.sprintf( format, ## calc ) );  }
  17.  
  18.      UPDATE_INT( read_media_stat, (p_item->p_stats->i_read_bytes / 1024 ) );
  19.      UPDATE_FLOAT( input_bitrate_stat,  "%6.0f", (float)(p_item->p_stats->f_input_bitrate *  8000  ));
  20. diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
  21. index b79dcb5..2c02133 100644
  22. --- a/modules/gui/qt4/components/simple_preferences.cpp
  23. +++ b/modules/gui/qt4/components/simple_preferences.cpp
  24. @@ -887,7 +887,7 @@ void SPrefsPanel::assoDialog()
  25.  
  26.      if( S_OK == CoCreateInstance( &clsid_IApplication2,
  27.                  NULL, CLSCTX_INPROC_SERVER,
  28. -                &IID_IApplicationAssociationRegistrationUI,
  29. +                IID_IApplicationAssociationRegistrationUI,
  30.                  (void **)&p_appassoc) )
  31.      {
  32.          if(S_OK == p_appassoc->vt->LaunchAdvancedAssociationUI(p_appassoc, L"VLC" ) )
  33. diff --git a/modules/gui/qt4/dialogs/bookmarks.cpp b/modules/gui/qt4/dialogs/bookmarks.cpp
  34. index fa0ccd0..e02c0f4 100644
  35. --- a/modules/gui/qt4/dialogs/bookmarks.cpp
  36. +++ b/modules/gui/qt4/dialogs/bookmarks.cpp
  37. @@ -130,8 +130,10 @@ void BookmarksDialog::update()
  38.          int hour = total / (60*60);
  39.          int min = (total - hour*60*60) / 60;
  40.          int sec = total - hour*60*60 - min*60;
  41. -        QString str;
  42. -        row << str.sprintf("%02d:%02d:%02d", hour, min, sec );
  43. +        char str[40];
  44. +        snprintf(str, sizeof(str), "%02d:%02d:%02d", hour, min, sec );
  45. +        //QString str;
  46. +        row << str; //str.sprintf("%02d:%02d:%02d", hour, min, sec );
  47.          QTreeWidgetItem *item = new QTreeWidgetItem( bookmarksList, row );
  48.          item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable |
  49.                          Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
  50. diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
  51. index 3c2b403..1ace3bf 100644
  52. --- a/modules/gui/qt4/menus.cpp
  53. +++ b/modules/gui/qt4/menus.cpp
  54. @@ -1409,7 +1409,12 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
  55.              case VLC_VAR_FLOAT:
  56.                  var_Get( p_object, psz_var, &val );
  57.                  if( CURTEXT ) menutext = qfu( CURTEXT );
  58. -                else menutext.sprintf( "%.2f", CURVAL.f_float );
  59. +                else {
  60. +                    char str[40];
  61. +                    snprintf(str, sizeof(str), "%.2f", CURVAL.f_float);
  62. +                    menutext = qfu(str);
  63. +                }
  64. +                //else menutext.sprintf( "%.2f", CURVAL.f_float );
  65.                  CreateAndConnect( submenu, psz_var, menutext, "", RADIO_OR_COMMAND,
  66.                          p_object, CURVAL, i_type,
  67.                          CURVAL.f_float == val.f_float );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top