forked from osmocom/wireshark
Use int_to_qstring in a few more places.
Change-Id: Id324fe21f436a233088d106553db2ed6f6e410ac Reviewed-on: https://code.wireshark.org/review/9899 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
parent
5fa57ecb67
commit
fda29e1c95
|
@ -29,6 +29,7 @@
|
|||
#include "ui/decode_as_utils.h"
|
||||
#include "ui/utf8_entities.h"
|
||||
|
||||
#include "qt_ui_utils.h"
|
||||
#include "wireshark_application.h"
|
||||
|
||||
#include <QComboBox>
|
||||
|
@ -135,7 +136,7 @@ QString DecodeAsDialog::entryString(const gchar *table_name, gpointer value)
|
|||
g_assert_not_reached();
|
||||
break;
|
||||
}
|
||||
entry_str = QString("0x%1").arg(num_val, width, 16, QChar('0'));
|
||||
entry_str = QString("%1").arg(int_to_qstring(num_val, width, 16));
|
||||
break;
|
||||
|
||||
case BASE_OCT:
|
||||
|
|
|
@ -216,7 +216,7 @@ void DisplayFilterExpressionDialog::fillEnumIntValues(const _value_string *vals,
|
|||
|
||||
for (int i = 0; vals[i].strptr != NULL; i++) {
|
||||
QListWidgetItem *eli = new QListWidgetItem(vals[i].strptr, ui->enumListWidget);
|
||||
eli->setData(Qt::UserRole, int_to_qstring(vals[i].value, base));
|
||||
eli->setData(Qt::UserRole, int_to_qstring(vals[i].value, 0, base));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ void DisplayFilterExpressionDialog::fillEnumInt64Values(const _val64_string *val
|
|||
|
||||
for (int i = 0; vals64[i].strptr != NULL; i++) {
|
||||
QListWidgetItem *eli = new QListWidgetItem(vals64[i].strptr, ui->enumListWidget);
|
||||
eli->setData(Qt::UserRole, int_to_qstring(vals64[i].value, base));
|
||||
eli->setData(Qt::UserRole, int_to_qstring(vals64[i].value, 0, base));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ QByteArray gstring_free_to_qbytearray(GString *glib_gstring)
|
|||
return qt_ba;
|
||||
}
|
||||
|
||||
const QString int_to_qstring(qint64 value, int base, int field_width)
|
||||
const QString int_to_qstring(qint64 value, int field_width, int base)
|
||||
{
|
||||
// Qt deprecated QString::sprintf in Qt 5.0, then added ::asprintf in
|
||||
// Qt 5.5. Rather than navigate a maze of QT_VERSION_CHECKs, just use
|
||||
|
|
|
@ -82,13 +82,13 @@ QByteArray gstring_free_to_qbytearray(GString *glib_gstring);
|
|||
/** Convert an integer to a formatted string representation.
|
||||
*
|
||||
* @param value The integer to format.
|
||||
* @param base Number base between 2 and 36 (limited by QString::arg).
|
||||
* @param field_width Width of the output, not including any base prefix.
|
||||
* Output will be zero-padded.
|
||||
* @param base Number base between 2 and 36 (limited by QString::arg).
|
||||
*
|
||||
* @return A QString representation of the integer
|
||||
*/
|
||||
const QString int_to_qstring(qint64 value, int base = 10, int field_width = 0);
|
||||
const QString int_to_qstring(qint64 value, int field_width = 0, int base = 10);
|
||||
|
||||
/** Convert an address to a QString using address_to_str().
|
||||
*
|
||||
|
|
|
@ -942,8 +942,8 @@ void RtpAnalysisDialog::updateStatistics()
|
|||
.arg(port_dst_fwd_);
|
||||
stats_tables += "<h4>Forward</h4>\n";
|
||||
stats_tables += "<p><table>\n";
|
||||
stats_tables += QString("<tr><th align=\"left\">SSRC</th><td>0x%1</tr>")
|
||||
.arg(ssrc_fwd_, 8, 16, QChar('0'));
|
||||
stats_tables += QString("<tr><th align=\"left\">SSRC</th><td>%1</tr>")
|
||||
.arg(int_to_qstring(ssrc_fwd_, 8, 16));
|
||||
stats_tables += QString("<tr><th align=\"left\">Max Delta</th><td>%1 ms @ %2</td></tr>")
|
||||
.arg(fwd_statinfo_.max_delta, 0, 'f', 2)
|
||||
.arg(fwd_statinfo_.max_nr);
|
||||
|
@ -971,8 +971,8 @@ void RtpAnalysisDialog::updateStatistics()
|
|||
|
||||
stats_tables += "<h4>Reverse</h4>\n";
|
||||
stats_tables += "<p><table>\n";
|
||||
stats_tables += QString("<tr><th align=\"left\">SSRC</th><td>0x%1</tr>")
|
||||
.arg(ssrc_fwd_, 8, 16, QChar('0'));
|
||||
stats_tables += QString("<tr><th align=\"left\">SSRC</th><td>%1</tr>")
|
||||
.arg(int_to_qstring(ssrc_fwd_, 8, 16));
|
||||
stats_tables += QString("<tr><th align=\"left\">Max Delta</th><td>%1 ms @ %2</td></tr>")
|
||||
.arg(rev_statinfo_.max_delta, 0, 'f', 2)
|
||||
.arg(rev_statinfo_.max_nr);
|
||||
|
|
Loading…
Reference in New Issue