Skip to content

Commit a929c52

Browse files
committed
Fix modernize-use-default-member-init clang-tidy warnings
1 parent bb8b80a commit a929c52

File tree

6 files changed

+20
-39
lines changed

6 files changed

+20
-39
lines changed

qml/components/blockclockdial.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@
1313
#include <QtGlobal>
1414

1515
BlockClockDial::BlockClockDial(QQuickItem *parent)
16-
: QQuickPaintedItem(parent)
17-
, m_time_ratio_list{0.0}
18-
, m_pen_width{4}
19-
, m_scale{5/12}
20-
, m_background_color{QColor("#2D2D2D")}
21-
, m_confirmation_colors{QList<QColor>{}}
22-
, m_time_tick_color{QColor("#000000")}
23-
, m_animation_timer{QTimer(this)}
16+
: QQuickPaintedItem(parent)
2417
{
2518
m_animation_timer.setTimerType(Qt::PreciseTimer);
2619
m_animation_timer.setInterval(16);

qml/components/blockclockdial.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,20 @@ public Q_SLOTS:
6868
qreal incrementAnimatingMaxAngle(qreal angle);
6969
qreal getTargetAnimationAngle();
7070

71-
QVariantList m_time_ratio_list;
71+
QVariantList m_time_ratio_list{0.0};
7272
double m_verification_progress;
7373
bool m_is_connected;
7474
bool m_is_synced;
7575
bool m_is_paused;
76-
qreal m_pen_width;
77-
qreal m_scale;
78-
QColor m_background_color;
76+
qreal m_pen_width{4};
77+
qreal m_scale{5/12};
78+
QColor m_background_color{"#2D2D2D"};
7979
QConicalGradient m_connecting_gradient;
8080
qreal m_connecting_start_angle = 90;
8181
const qreal m_connecting_end_angle = -180;
82-
QList<QColor> m_confirmation_colors;
83-
QColor m_time_tick_color;
84-
QTimer m_animation_timer;
82+
QList<QColor> m_confirmation_colors{};
83+
QColor m_time_tick_color{"#000000"};
84+
QTimer m_animation_timer{this};
8585
QTimer m_delay_timer;
8686
qreal m_animating_max_angle = 0;
8787
};

qml/controls/linegraph.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@
1616

1717
LineGraph::LineGraph(QQuickItem *parent)
1818
: QQuickPaintedItem(parent)
19-
, m_background_color{QColor("#2D2D2D")}
20-
, m_border_color{QColor("#000000")}
21-
, m_fill_color{QColor("#000000")}
22-
, m_fill_gradient{QLinearGradient(0, 0, 0, 0)}
23-
, m_line_color{QColor("#000000")}
24-
, m_marker_line_color{("#000000")}
25-
, m_max_samples{0}
26-
, m_max_value{0}
2719
{
2820
setFillColor(m_background_color);
2921
}

qml/controls/linegraph.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ class LineGraph : public QQuickPaintedItem
5353
void paintTraffic(QPainter * painter);
5454
void setupGradient(QPainterPath * painter);
5555

56-
QColor m_background_color;
57-
QColor m_border_color;
58-
QColor m_fill_color;
59-
QLinearGradient m_fill_gradient;
60-
QColor m_line_color;
61-
QColor m_marker_line_color;
62-
int m_max_samples;
63-
float m_max_value;
56+
QColor m_background_color{"#2D2D2D"};
57+
QColor m_border_color{"#000000"};
58+
QColor m_fill_color{"#000000"};
59+
QLinearGradient m_fill_gradient{0, 0, 0, 0};
60+
QColor m_line_color{"#000000"};
61+
QColor m_marker_line_color{"#000000"};
62+
int m_max_samples{0};
63+
float m_max_value{0};
6464
QQueue<float> m_value_list;
6565
};
6666

qml/models/networktraffictower.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212

1313
NetworkTrafficTower::NetworkTrafficTower(NodeModel& node)
1414
: m_node{node}
15-
, m_total_bytes_received{0.0f}
16-
, m_total_bytes_sent{0.0f}
17-
, m_max_received_rate_bps{0.0f}
18-
, m_max_sent_rate_bps{0.0f}
1915
{
2016
QTimer* timer = new QTimer();
2117
connect(timer, &QTimer::timeout, this, &NetworkTrafficTower::updateTrafficStats);

qml/models/networktraffictower.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ public Q_SLOTS:
5454

5555
NodeModel& m_node;
5656
int m_filter_window_size;
57-
float m_total_bytes_received;
58-
float m_total_bytes_sent;
59-
float m_max_received_rate_bps;
60-
float m_max_sent_rate_bps;
57+
float m_total_bytes_received{0.0f};
58+
float m_total_bytes_sent{0.0f};
59+
float m_max_received_rate_bps{0.0f};
60+
float m_max_sent_rate_bps{0.0f};
6161
QQueue<float> m_received_rate_list;
6262
QQueue<float> m_smoothed_received_rate_list;
6363
QQueue<float> m_sent_rate_list;

0 commit comments

Comments
 (0)