clang-tidy: use default member init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2025-05-29 17:06:35 -07:00
committed by Jari Sundell
parent 3ab38583b8
commit 897a6face2
67 changed files with 119 additions and 211 deletions
+1 -3
View File
@@ -34,9 +34,7 @@
namespace ui {
Download::Download(core::Download* d) :
m_download(d),
m_state(DISPLAY_MAX_SIZE),
m_focusDisplay(false) {
m_download(d) {
m_windowDownloadStatus = new WDownloadStatus(d);
m_windowDownloadStatus->set_bottom(true);
+2 -2
View File
@@ -110,10 +110,10 @@ private:
core::Download* m_download;
Display m_state;
Display m_state{DISPLAY_MAX_SIZE};
ElementBase* m_uiArray[DISPLAY_MAX_SIZE];
bool m_focusDisplay;
bool m_focusDisplay{};
WDownloadStatus* m_windowDownloadStatus;
};
+1 -3
View File
@@ -33,9 +33,7 @@
namespace ui {
DownloadList::DownloadList() :
m_state(DISPLAY_MAX_SIZE) {
DownloadList::DownloadList() {
m_uiArray[DISPLAY_DOWNLOAD] = NULL;
m_uiArray[DISPLAY_DOWNLOAD_LIST] = new ElementDownloadList();
m_uiArray[DISPLAY_LOG] = new ElementLogComplete(control->core()->log_complete());
+1 -1
View File
@@ -116,7 +116,7 @@ private:
void setup_keys();
void setup_input();
Display m_state;
Display m_state{DISPLAY_MAX_SIZE};
ElementBase* m_uiArray[DISPLAY_MAX_SIZE];
WLog* m_windowLog;
+3 -4
View File
@@ -50,8 +50,7 @@ class ElementBase {
public:
typedef std::function<void ()> slot_type;
ElementBase() : m_frame(NULL), m_focus(false) {}
virtual ~ElementBase() {}
virtual ~ElementBase() = default;
bool is_active() const { return m_frame != NULL; }
@@ -65,8 +64,8 @@ public:
void mark_dirty();
protected:
display::Frame* m_frame;
bool m_focus;
display::Frame* m_frame{};
bool m_focus{};
input::Bindings m_bindings;
slot_type m_slot_exit;
+1 -3
View File
@@ -48,9 +48,7 @@
namespace ui {
ElementChunksSeen::ElementChunksSeen(core::Download* d) :
m_download(d),
m_window(NULL),
m_focus(0) {
m_download(d) {
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
+2 -3
View File
@@ -68,10 +68,9 @@ private:
void receive_pageprev();
core::Download* m_download;
WChunksSeen* m_window;
WChunksSeen* m_window{};
unsigned int m_focus;
unsigned int m_focus{};
};
}
+1 -4
View File
@@ -18,10 +18,7 @@
namespace ui {
ElementDownloadList::ElementDownloadList() :
m_window(NULL),
m_view(NULL) {
ElementDownloadList::ElementDownloadList() {
receive_change_view("main");
if (m_view == NULL)
+2 -2
View File
@@ -50,8 +50,8 @@ public:
void toggle_layout();
private:
WDownloadList* m_window;
core::View* m_view;
WDownloadList* m_window{};
core::View* m_view{};
};
} // namespace ui
+2 -8
View File
@@ -54,14 +54,8 @@
namespace ui {
ElementFileList::ElementFileList(core::Download* d) :
m_download(d),
m_state(DISPLAY_MAX_SIZE),
m_window(NULL),
m_elementInfo(NULL),
m_selected(iterator(d->download()->file_list()->begin())),
m_collapsed(false) {
m_download(d),
m_selected(iterator(d->download()->file_list()->begin())) {
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_RIGHT] = m_bindings['F' - '@'] = std::bind(&ElementFileList::receive_select, this);
+5 -5
View File
@@ -92,13 +92,13 @@ private:
core::Download* m_download;
Display m_state;
WFileList* m_window;
ElementText* m_elementInfo;
Display m_state{DISPLAY_MAX_SIZE};
WFileList* m_window{};
ElementText* m_elementInfo{};
// Change to unsigned, please.
iterator m_selected;
bool m_collapsed;
bool m_collapsed{};
};
}
+1 -2
View File
@@ -15,8 +15,7 @@
namespace ui {
ElementLogComplete::ElementLogComplete(torrent::log_buffer* l) :
m_window(NULL),
m_log(l) {
m_log(l) {
unsigned int signal_index = torrent::main_thread::thread()->signal_bitfield()->add_signal(std::bind(&ElementLogComplete::received_update, this));
+1 -1
View File
@@ -63,7 +63,7 @@ public:
private:
void received_update();
WLogComplete* m_window;
WLogComplete* m_window{};
torrent::log_buffer* m_log;
};
+1 -2
View File
@@ -56,8 +56,7 @@
namespace ui {
ElementPeerList::ElementPeerList(core::Download* d) :
m_download(d),
m_state(DISPLAY_MAX_SIZE) {
m_download(d) {
m_listItr = m_list.end();
+1 -1
View File
@@ -85,7 +85,7 @@ private:
core::Download* m_download;
Display m_state;
Display m_state{DISPLAY_MAX_SIZE};
display::Window* m_windowList;
ElementText* m_elementInfo;
-4
View File
@@ -46,10 +46,6 @@
namespace ui {
ElementStringList::ElementStringList() :
m_window(NULL) {
}
void
ElementStringList::activate(display::Frame* frame, bool focus) {
if (is_active())
+1 -3
View File
@@ -56,8 +56,6 @@ public:
typedef display::WindowStringList WStringList;
typedef std::list<std::string> List;
ElementStringList();
void activate(display::Frame* frame, bool focus = true);
void disable();
@@ -101,7 +99,7 @@ public:
void next_screen();
private:
WStringList* m_window;
WStringList* m_window{};
List m_list;
};
+1 -3
View File
@@ -49,9 +49,7 @@
namespace ui {
ElementText::ElementText(rpc::target_type target) :
m_window(new WindowText(target)),
m_column(0),
m_columnWidth(0) {
m_window(new WindowText(target)) {
// Move bindings into a function that defines default bindings.
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
+2 -2
View File
@@ -102,8 +102,8 @@ public:
private:
WindowText* m_window;
unsigned int m_column;
extent_type m_columnWidth;
unsigned int m_column{};
extent_type m_columnWidth{};
};
struct text_element_wrapper {
+1 -3
View File
@@ -13,9 +13,7 @@
namespace ui {
ElementTrackerList::ElementTrackerList(core::Download* d) :
m_download(d),
m_window(NULL),
m_focus(0) {
m_download(d) {
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
+2 -2
View File
@@ -69,10 +69,10 @@ private:
void receive_cycle_group();
core::Download* m_download;
WTrackerList* m_window;
WTrackerList* m_window{};
// Change to unsigned, please.
unsigned int m_focus;
unsigned int m_focus{};
};
}
+1 -3
View File
@@ -48,9 +48,7 @@
namespace ui {
ElementTransferList::ElementTransferList(core::Download* d) :
m_download(d),
m_window(NULL),
m_focus(0) {
m_download(d) {
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
+2 -3
View File
@@ -68,10 +68,9 @@ private:
void receive_pageprev();
core::Download* m_download;
WTransferList* m_window;
WTransferList* m_window{};
unsigned int m_focus;
unsigned int m_focus{};
};
}