forked from osmocom/wireshark
Qt: fix issue found by PVS Studio (V519)
The 'dp_ratio' variable is assigned values twice successively Change-Id: Iac3bcefe61c3fe2f628f046ee6f77377fe7dd775 Reviewed-on: https://code.wireshark.org/review/27598 Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
780087d996
commit
2fd5f93188
|
@ -1636,8 +1636,7 @@ void PacketList::drawNearOverlay()
|
|||
|
||||
if (!prefs.gui_packet_list_show_minimap) return;
|
||||
|
||||
qreal dp_ratio = 1.0;
|
||||
dp_ratio = overlay_sb_->devicePixelRatio();
|
||||
qreal dp_ratio = overlay_sb_->devicePixelRatio();
|
||||
int o_height = overlay_sb_->height() * dp_ratio;
|
||||
int o_rows = qMin(packet_list_model_->rowCount(), o_height);
|
||||
int o_width = (wsApp->fontMetrics().height() * 2 * dp_ratio) + 2; // 2ems + 1-pixel border on either side.
|
||||
|
@ -1706,8 +1705,7 @@ void PacketList::drawFarOverlay()
|
|||
if (!prefs.gui_packet_list_show_minimap) return;
|
||||
|
||||
QSize groove_size = overlay_sb_->grooveRect().size();
|
||||
qreal dp_ratio = 1.0;
|
||||
dp_ratio = overlay_sb_->devicePixelRatio();
|
||||
qreal dp_ratio = overlay_sb_->devicePixelRatio();
|
||||
groove_size *= dp_ratio;
|
||||
int o_width = groove_size.width();
|
||||
int o_height = groove_size.height();
|
||||
|
|
|
@ -105,8 +105,7 @@ void OverlayScrollBar::setNearOverlayImage(QImage &overlay_image, int packet_cou
|
|||
selected_pos_ = selected_pos;
|
||||
|
||||
if (old_width != packet_map_img_.width()) {
|
||||
qreal dp_ratio = 1.0;
|
||||
dp_ratio = devicePixelRatio();
|
||||
qreal dp_ratio = devicePixelRatio();
|
||||
|
||||
packet_map_width_ = packet_map_img_.width() / dp_ratio;
|
||||
|
||||
|
@ -117,8 +116,7 @@ void OverlayScrollBar::setNearOverlayImage(QImage &overlay_image, int packet_cou
|
|||
|
||||
void OverlayScrollBar::setMarkedPacketImage(QImage &mp_image)
|
||||
{
|
||||
qreal dp_ratio = 1.0;
|
||||
dp_ratio = devicePixelRatio();
|
||||
qreal dp_ratio = devicePixelRatio();
|
||||
|
||||
marked_packet_img_ = mp_image;
|
||||
marked_packet_width_ = mp_image.width() / dp_ratio;
|
||||
|
@ -146,9 +144,8 @@ void OverlayScrollBar::resizeEvent(QResizeEvent *event)
|
|||
|
||||
void OverlayScrollBar::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
qreal dp_ratio = 1.0;
|
||||
qreal dp_ratio = devicePixelRatio();
|
||||
QSize pm_size(packet_map_width_, geometry().height());
|
||||
dp_ratio = devicePixelRatio();
|
||||
pm_size *= dp_ratio;
|
||||
|
||||
QPainter painter(this);
|
||||
|
@ -200,8 +197,7 @@ bool OverlayScrollBar::eventFilter(QObject *watched, QEvent *event)
|
|||
|
||||
if (!marked_packet_img_.isNull()) {
|
||||
QRect groove_rect = grooveRect();
|
||||
qreal dp_ratio = 1.0;
|
||||
dp_ratio = devicePixelRatio();
|
||||
qreal dp_ratio = devicePixelRatio();
|
||||
groove_rect.setTopLeft(groove_rect.topLeft() * dp_ratio);
|
||||
groove_rect.setSize(groove_rect.size() * dp_ratio);
|
||||
|
||||
|
|
Loading…
Reference in New Issue