From 02d906d3aed289a7d2fd80ff50364f54b1c535c0 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 23 Jun 2022 12:28:00 +0800 Subject: [PATCH] Initialize pointer to a default value --- src/app/applicationinstancemanager.h | 2 +- src/app/cmdoptions.cpp | 2 +- src/base/bittorrent/filterparserthread.cpp | 2 +- src/base/bittorrent/portforwarderimpl.h | 2 +- src/base/bittorrent/torrentimpl.h | 4 +-- src/base/bittorrent/tracker.h | 2 +- src/base/http/connection.h | 4 +-- src/base/http/server.cpp | 3 +-- src/base/http/server.h | 4 +-- src/base/net/geoipdatabase.cpp | 8 +----- src/base/net/geoipdatabase.h | 16 ++++++------ src/base/net/geoipmanager.cpp | 2 -- src/base/net/geoipmanager.h | 4 +-- src/base/net/smtp.cpp | 3 --- src/base/net/smtp.h | 10 ++++---- src/base/rss/rss_autodownloader.h | 6 ++--- src/base/rss/rss_session.h | 6 ++--- src/base/search/searchdownloadhandler.h | 4 +-- src/base/search/searchhandler.h | 6 ++--- src/base/utils/io.h | 4 +-- src/base/utils/random.cpp | 2 +- src/gui/aboutdialog.h | 2 +- src/gui/addnewtorrentdialog.h | 2 +- src/gui/autoexpandabledialog.h | 2 +- src/gui/banlistoptionsdialog.h | 6 ++--- src/gui/categoryfiltermodel.cpp | 6 ++--- src/gui/categoryfiltermodel.h | 2 +- src/gui/cookiesdialog.h | 4 +-- src/gui/deletionconfirmationdialog.h | 2 +- src/gui/downloadfromurldialog.h | 2 +- src/gui/executionlogwidget.h | 4 +-- src/gui/fspathedit.cpp | 12 ++++----- src/gui/fspathedit.h | 2 +- src/gui/fspathedit_p.h | 8 +++--- src/gui/ipsubnetwhitelistoptionsdialog.h | 6 ++--- src/gui/lineedit.h | 2 +- src/gui/mainwindow.h | 28 ++++++++++----------- src/gui/optionsdialog.h | 6 ++--- src/gui/powermanagement/powermanagement.h | 2 +- src/gui/previewselectdialog.h | 8 +++--- src/gui/properties/peersadditiondialog.h | 2 +- src/gui/properties/propertieswidget.cpp | 2 -- src/gui/properties/propertieswidget.h | 22 ++++++++-------- src/gui/properties/proplistdelegate.h | 2 +- src/gui/properties/proptabbar.cpp | 1 - src/gui/properties/proptabbar.h | 4 +-- src/gui/properties/speedwidget.h | 16 ++++++------ src/gui/properties/trackerlistwidget.h | 8 +++--- src/gui/properties/trackersadditiondialog.h | 4 +-- src/gui/rss/automatedrssdownloader.h | 6 ++--- src/gui/rss/feedlistwidget.h | 2 +- src/gui/rss/htmlbrowser.h | 4 +-- src/gui/rss/rsswidget.h | 6 ++--- src/gui/search/pluginselectdialog.h | 4 +-- src/gui/search/pluginsourcedialog.h | 2 +- src/gui/search/searchjobwidget.h | 10 ++++---- src/gui/search/searchwidget.cpp | 1 - src/gui/search/searchwidget.h | 6 ++--- src/gui/shutdownconfirmdialog.cpp | 1 - src/gui/shutdownconfirmdialog.h | 4 +-- src/gui/speedlimitdialog.h | 2 +- src/gui/stacktracedialog.h | 2 +- src/gui/statsdialog.h | 2 +- src/gui/statusbar.h | 10 ++++---- src/gui/torrentcategorydialog.h | 2 +- src/gui/torrentcontentfiltermodel.h | 2 +- src/gui/torrentcontentmodel.cpp | 4 +-- src/gui/torrentcontentmodelitem.cpp | 5 ---- src/gui/torrentcontentmodelitem.h | 12 ++++----- src/gui/torrentcreatordialog.h | 4 +-- src/gui/torrentoptionsdialog.h | 2 +- src/gui/trackerentriesdialog.h | 2 +- src/gui/transferlistfilterswidget.h | 10 ++++---- src/gui/transferlistwidget.h | 6 ++--- src/gui/tristateaction.h | 2 +- src/gui/watchedfolderoptionsdialog.h | 2 +- src/gui/watchedfoldersmodel.h | 2 +- 77 files changed, 178 insertions(+), 202 deletions(-) diff --git a/src/app/applicationinstancemanager.h b/src/app/applicationinstancemanager.h index 4a04fd1c7..236696911 100644 --- a/src/app/applicationinstancemanager.h +++ b/src/app/applicationinstancemanager.h @@ -51,6 +51,6 @@ signals: void messageReceived(const QString &message); private: - QtLocalPeer *m_peer; + QtLocalPeer *m_peer = nullptr; const bool m_isFirstInstance; }; diff --git a/src/app/cmdoptions.cpp b/src/app/cmdoptions.cpp index ef0bceb6d..6275224f1 100644 --- a/src/app/cmdoptions.cpp +++ b/src/app/cmdoptions.cpp @@ -97,7 +97,7 @@ namespace } private: - const char *m_name; + const char *m_name = nullptr; const char m_shortcut; }; diff --git a/src/base/bittorrent/filterparserthread.cpp b/src/base/bittorrent/filterparserthread.cpp index bdd8cf11f..eb599fa6b 100644 --- a/src/base/bittorrent/filterparserthread.cpp +++ b/src/base/bittorrent/filterparserthread.cpp @@ -48,7 +48,7 @@ namespace unsigned char octetIndex = 0; const char *octetStart = str; - char *endptr; + char *endptr = nullptr; for (; *str; ++str) { if (*str == '.') diff --git a/src/base/bittorrent/portforwarderimpl.h b/src/base/bittorrent/portforwarderimpl.h index f2574815b..5d04f86fe 100644 --- a/src/base/bittorrent/portforwarderimpl.h +++ b/src/base/bittorrent/portforwarderimpl.h @@ -58,6 +58,6 @@ private: void stop(); CachedSettingValue m_storeActive; - lt::session *m_provider; + lt::session *m_provider = nullptr; QHash> m_mappedPorts; }; diff --git a/src/base/bittorrent/torrentimpl.h b/src/base/bittorrent/torrentimpl.h index 80b297252..1f975072d 100644 --- a/src/base/bittorrent/torrentimpl.h +++ b/src/base/bittorrent/torrentimpl.h @@ -288,8 +288,8 @@ namespace BitTorrent nonstd::expected exportTorrent() const; - Session *const m_session; - lt::session *m_nativeSession; + Session *const m_session = nullptr; + lt::session *m_nativeSession = nullptr; lt::torrent_handle m_nativeHandle; mutable lt::torrent_status m_nativeStatus; TorrentState m_state = TorrentState::Unknown; diff --git a/src/base/bittorrent/tracker.h b/src/base/bittorrent/tracker.h index 6e502c075..bc9de5edc 100644 --- a/src/base/bittorrent/tracker.h +++ b/src/base/bittorrent/tracker.h @@ -103,7 +103,7 @@ namespace BitTorrent void unregisterPeer(const TrackerAnnounceRequest &announceReq); void prepareAnnounceResponse(const TrackerAnnounceRequest &announceReq); - Http::Server *m_server; + Http::Server *m_server = nullptr; Http::Request m_request; Http::Environment m_env; diff --git a/src/base/http/connection.h b/src/base/http/connection.h index 062f7bdb1..5b8f67a78 100644 --- a/src/base/http/connection.h +++ b/src/base/http/connection.h @@ -57,8 +57,8 @@ namespace Http void read(); void sendResponse(const Response &response) const; - QTcpSocket *m_socket; - IRequestHandler *m_requestHandler; + QTcpSocket *m_socket = nullptr; + IRequestHandler *m_requestHandler = nullptr; QByteArray m_receivedData; QElapsedTimer m_idleTimer; }; diff --git a/src/base/http/server.cpp b/src/base/http/server.cpp index e7395de61..f53e437d7 100644 --- a/src/base/http/server.cpp +++ b/src/base/http/server.cpp @@ -74,7 +74,6 @@ using namespace Http; Server::Server(IRequestHandler *requestHandler, QObject *parent) : QTcpServer(parent) , m_requestHandler(requestHandler) - , m_https(false) { setProxy(QNetworkProxy::NoProxy); @@ -91,7 +90,7 @@ void Server::incomingConnection(const qintptr socketDescriptor) { if (m_connections.size() >= CONNECTIONS_LIMIT) return; - QTcpSocket *serverSocket; + QTcpSocket *serverSocket = nullptr; if (m_https) serverSocket = new QSslSocket(this); else diff --git a/src/base/http/server.h b/src/base/http/server.h index 26efb6c28..57bed673f 100644 --- a/src/base/http/server.h +++ b/src/base/http/server.h @@ -58,10 +58,10 @@ namespace Http void incomingConnection(qintptr socketDescriptor) override; void removeConnection(Connection *connection); - IRequestHandler *m_requestHandler; + IRequestHandler *m_requestHandler = nullptr; QSet m_connections; // for tracking persistent connections - bool m_https; + bool m_https = false; QList m_certificates; QSslKey m_key; }; diff --git a/src/base/net/geoipdatabase.cpp b/src/base/net/geoipdatabase.cpp index 0379e83fa..c548e7c0b 100644 --- a/src/base/net/geoipdatabase.cpp +++ b/src/base/net/geoipdatabase.cpp @@ -76,13 +76,7 @@ struct DataFieldDescriptor }; GeoIPDatabase::GeoIPDatabase(const quint32 size) - : m_ipVersion(0) - , m_recordSize(0) - , m_nodeCount(0) - , m_nodeSize(0) - , m_indexSize(0) - , m_recordBytes(0) - , m_size(size) + : m_size(size) , m_data(new uchar[size]) { } diff --git a/src/base/net/geoipdatabase.h b/src/base/net/geoipdatabase.h index 3d9495c10..9e02fda7e 100644 --- a/src/base/net/geoipdatabase.h +++ b/src/base/net/geoipdatabase.h @@ -73,16 +73,16 @@ private: template QVariant readPlainValue(quint32 &offset, quint8 len) const; // Metadata - quint16 m_ipVersion; - quint16 m_recordSize; - quint32 m_nodeCount; - int m_nodeSize; - int m_indexSize; - int m_recordBytes; + quint16 m_ipVersion = 0; + quint16 m_recordSize = 0; + quint32 m_nodeCount = 0; + int m_nodeSize = 0; + int m_indexSize = 0; + int m_recordBytes = 0; QDateTime m_buildEpoch; QString m_dbType; // Search data mutable QHash m_countries; - quint32 m_size; - uchar *m_data; + quint32 m_size = 0; + uchar *m_data = nullptr; }; diff --git a/src/base/net/geoipmanager.cpp b/src/base/net/geoipmanager.cpp index 62e2d447d..caebdf97c 100644 --- a/src/base/net/geoipmanager.cpp +++ b/src/base/net/geoipmanager.cpp @@ -54,8 +54,6 @@ using namespace Net; GeoIPManager *GeoIPManager::m_instance = nullptr; GeoIPManager::GeoIPManager() - : m_enabled(false) - , m_geoIPDatabase(nullptr) { configure(); connect(Preferences::instance(), &Preferences::changed, this, &GeoIPManager::configure); diff --git a/src/base/net/geoipmanager.h b/src/base/net/geoipmanager.h index 69d238636..a5652d5f5 100644 --- a/src/base/net/geoipmanager.h +++ b/src/base/net/geoipmanager.h @@ -66,8 +66,8 @@ namespace Net void manageDatabaseUpdate(); void downloadDatabaseFile(); - bool m_enabled; - GeoIPDatabase *m_geoIPDatabase; + bool m_enabled = false; + GeoIPDatabase *m_geoIPDatabase = nullptr; static GeoIPManager *m_instance; }; diff --git a/src/base/net/smtp.cpp b/src/base/net/smtp.cpp index ab105e89e..4fd96f68a 100644 --- a/src/base/net/smtp.cpp +++ b/src/base/net/smtp.cpp @@ -103,9 +103,6 @@ using namespace Net; Smtp::Smtp(QObject *parent) : QObject(parent) - , m_state(Init) - , m_useSsl(false) - , m_authType(AuthPlain) { static bool needToRegisterMetaType = true; diff --git a/src/base/net/smtp.h b/src/base/net/smtp.h index 42ec689e1..28c7cadeb 100644 --- a/src/base/net/smtp.h +++ b/src/base/net/smtp.h @@ -103,18 +103,18 @@ namespace Net QByteArray m_message; #ifndef QT_NO_OPENSSL - QSslSocket *m_socket; + QSslSocket *m_socket = nullptr; #else - QTcpSocket *m_socket; + QTcpSocket *m_socket = nullptr; #endif QString m_from; QString m_rcpt; QString m_response; - int m_state; + int m_state = Init; QHash m_extensions; QByteArray m_buffer; - bool m_useSsl; - AuthType m_authType; + bool m_useSsl = false; + AuthType m_authType = AuthPlain; QString m_username; QString m_password; }; diff --git a/src/base/rss/rss_autodownloader.h b/src/base/rss/rss_autodownloader.h index 9813087d6..1b54f443e 100644 --- a/src/base/rss/rss_autodownloader.h +++ b/src/base/rss/rss_autodownloader.h @@ -136,9 +136,9 @@ namespace RSS SettingValue m_storeSmartEpisodeFilter; SettingValue m_storeDownloadRepacks; - QTimer *m_processingTimer; - QThread *m_ioThread; - AsyncFileStorage *m_fileStorage; + QTimer *m_processingTimer = nullptr; + QThread *m_ioThread = nullptr; + AsyncFileStorage *m_fileStorage = nullptr; QHash m_rules; QList> m_processingQueue; QHash> m_waitingJobs; diff --git a/src/base/rss/rss_session.h b/src/base/rss/rss_session.h index b69001206..cb7f9ac99 100644 --- a/src/base/rss/rss_session.h +++ b/src/base/rss/rss_session.h @@ -158,9 +158,9 @@ namespace RSS CachedSettingValue m_storeProcessingEnabled; CachedSettingValue m_storeRefreshInterval; CachedSettingValue m_storeMaxArticlesPerFeed; - QThread *m_workingThread; - AsyncFileStorage *m_confFileStorage; - AsyncFileStorage *m_dataFileStorage; + QThread *m_workingThread = nullptr; + AsyncFileStorage *m_confFileStorage = nullptr; + AsyncFileStorage *m_dataFileStorage = nullptr; QTimer m_refreshTimer; QHash m_itemsByPath; QHash m_feedsByUID; diff --git a/src/base/search/searchdownloadhandler.h b/src/base/search/searchdownloadhandler.h index adb9dc6f7..4fa51a43c 100644 --- a/src/base/search/searchdownloadhandler.h +++ b/src/base/search/searchdownloadhandler.h @@ -49,6 +49,6 @@ signals: private: void downloadProcessFinished(int exitcode); - SearchPluginManager *m_manager; - QProcess *m_downloadProcess; + SearchPluginManager *m_manager = nullptr; + QProcess *m_downloadProcess = nullptr; }; diff --git a/src/base/search/searchhandler.h b/src/base/search/searchhandler.h index 2f42b1bca..bda41fe89 100644 --- a/src/base/search/searchhandler.h +++ b/src/base/search/searchhandler.h @@ -83,9 +83,9 @@ private: const QString m_pattern; const QString m_category; const QStringList m_usedPlugins; - SearchPluginManager *m_manager; - QProcess *m_searchProcess; - QTimer *m_searchTimeout; + SearchPluginManager *m_manager = nullptr; + QProcess *m_searchProcess = nullptr; + QTimer *m_searchTimeout = nullptr; QByteArray m_searchResultLineTruncated; bool m_searchCancelled = false; QList m_results; diff --git a/src/base/utils/io.h b/src/base/utils/io.h index d0be5089a..06a2d71e1 100644 --- a/src/base/utils/io.h +++ b/src/base/utils/io.h @@ -76,9 +76,9 @@ namespace Utils::IO } private: - QFileDevice *m_device; + QFileDevice *m_device = nullptr; std::shared_ptr m_buffer; - int m_bufferSize; + int m_bufferSize = 0; }; nonstd::expected saveToFile(const Path &path, const QByteArray &data); diff --git a/src/base/utils/random.cpp b/src/base/utils/random.cpp index b4fc21756..3ca907665 100644 --- a/src/base/utils/random.cpp +++ b/src/base/utils/random.cpp @@ -125,7 +125,7 @@ namespace } private: - FILE *m_randDev; + FILE *m_randDev = nullptr; }; #endif } diff --git a/src/gui/aboutdialog.h b/src/gui/aboutdialog.h index 609f24992..2ac58617b 100644 --- a/src/gui/aboutdialog.h +++ b/src/gui/aboutdialog.h @@ -47,6 +47,6 @@ public: ~AboutDialog() override; private: - Ui::AboutDialog *m_ui; + Ui::AboutDialog *m_ui = nullptr; SettingValue m_storeDialogSize; }; diff --git a/src/gui/addnewtorrentdialog.h b/src/gui/addnewtorrentdialog.h index 747844f1b..3eeeb7624 100644 --- a/src/gui/addnewtorrentdialog.h +++ b/src/gui/addnewtorrentdialog.h @@ -115,7 +115,7 @@ private: void showEvent(QShowEvent *event) override; - Ui::AddNewTorrentDialog *m_ui; + Ui::AddNewTorrentDialog *m_ui = nullptr; TorrentContentFilterModel *m_contentModel = nullptr; PropListDelegate *m_contentDelegate = nullptr; BitTorrent::MagnetUri m_magnetURI; diff --git a/src/gui/autoexpandabledialog.h b/src/gui/autoexpandabledialog.h index db5d0ea5d..a77cf83bb 100644 --- a/src/gui/autoexpandabledialog.h +++ b/src/gui/autoexpandabledialog.h @@ -55,5 +55,5 @@ protected: void showEvent(QShowEvent *e) override; private: - Ui::AutoExpandableDialog *m_ui; + Ui::AutoExpandableDialog *m_ui = nullptr; }; diff --git a/src/gui/banlistoptionsdialog.h b/src/gui/banlistoptionsdialog.h index 54abffe6c..4f2c3a461 100644 --- a/src/gui/banlistoptionsdialog.h +++ b/src/gui/banlistoptionsdialog.h @@ -56,9 +56,9 @@ private slots: void on_txtIP_textChanged(const QString &ip); private: - Ui::BanListOptionsDialog *m_ui; + Ui::BanListOptionsDialog *m_ui = nullptr; SettingValue m_storeDialogSize; - QStringListModel *m_model; - QSortFilterProxyModel *m_sortFilter; + QStringListModel *m_model = nullptr; + QSortFilterProxyModel *m_sortFilter = nullptr; bool m_modified = false; }; diff --git a/src/gui/categoryfiltermodel.cpp b/src/gui/categoryfiltermodel.cpp index 36ab44ccc..5a054c49c 100644 --- a/src/gui/categoryfiltermodel.cpp +++ b/src/gui/categoryfiltermodel.cpp @@ -40,8 +40,6 @@ class CategoryModelItem { public: CategoryModelItem() - : m_parent(nullptr) - , m_torrentsCount(0) { } @@ -154,9 +152,9 @@ public: } private: - CategoryModelItem *m_parent; + CategoryModelItem *m_parent = nullptr; QString m_name; - int m_torrentsCount; + int m_torrentsCount = 0; QHash m_children; QStringList m_childUids; }; diff --git a/src/gui/categoryfiltermodel.h b/src/gui/categoryfiltermodel.h index 51f5859df..bade1f6ce 100644 --- a/src/gui/categoryfiltermodel.h +++ b/src/gui/categoryfiltermodel.h @@ -75,5 +75,5 @@ private: CategoryModelItem *findItem(const QString &fullName) const; bool m_isSubcategoriesEnabled; - CategoryModelItem *m_rootItem; + CategoryModelItem *m_rootItem = nullptr; }; diff --git a/src/gui/cookiesdialog.h b/src/gui/cookiesdialog.h index b70bbfc54..5b8b39ab7 100644 --- a/src/gui/cookiesdialog.h +++ b/src/gui/cookiesdialog.h @@ -56,8 +56,8 @@ private slots: void onButtonDeleteClicked(); private: - Ui::CookiesDialog *m_ui; - CookiesModel *m_cookiesModel; + Ui::CookiesDialog *m_ui = nullptr; + CookiesModel *m_cookiesModel = nullptr; SettingValue m_storeDialogSize; SettingValue m_storeViewState; diff --git a/src/gui/deletionconfirmationdialog.h b/src/gui/deletionconfirmationdialog.h index e65fe9a45..f93f1746b 100644 --- a/src/gui/deletionconfirmationdialog.h +++ b/src/gui/deletionconfirmationdialog.h @@ -53,5 +53,5 @@ private slots: void on_rememberBtn_clicked(); private: - Ui::DeletionConfirmationDialog *m_ui; + Ui::DeletionConfirmationDialog *m_ui = nullptr; }; diff --git a/src/gui/downloadfromurldialog.h b/src/gui/downloadfromurldialog.h index d6394313e..4687e2703 100644 --- a/src/gui/downloadfromurldialog.h +++ b/src/gui/downloadfromurldialog.h @@ -53,6 +53,6 @@ private slots: void downloadButtonClicked(); private: - Ui::DownloadFromURLDialog *m_ui; + Ui::DownloadFromURLDialog *m_ui = nullptr; SettingValue m_storeDialogSize; }; diff --git a/src/gui/executionlogwidget.h b/src/gui/executionlogwidget.h index 99e52ec61..b8c65b690 100644 --- a/src/gui/executionlogwidget.h +++ b/src/gui/executionlogwidget.h @@ -55,6 +55,6 @@ public: private: void displayContextMenu(const LogListView *view, const BaseLogModel *model) const; - Ui::ExecutionLogWidget *m_ui; - LogFilterModel *m_messageFilterModel; + Ui::ExecutionLogWidget *m_ui = nullptr; + LogFilterModel *m_messageFilterModel = nullptr; }; diff --git a/src/gui/fspathedit.cpp b/src/gui/fspathedit.cpp index 38724c767..a2c7b1491 100644 --- a/src/gui/fspathedit.cpp +++ b/src/gui/fspathedit.cpp @@ -46,8 +46,8 @@ namespace { struct TrStringWithComment { - const char *source; - const char *comment; + const char *source = nullptr; + const char *comment = nullptr; QString tr() const { @@ -76,15 +76,15 @@ class FileSystemPathEdit::FileSystemPathEditPrivate void browseActionTriggered(); QString dialogCaptionOrDefault() const; - FileSystemPathEdit *q_ptr; + FileSystemPathEdit *q_ptr = nullptr; std::unique_ptr m_editor; - QAction *m_browseAction; - QToolButton *m_browseBtn; + QAction *m_browseAction = nullptr; + QToolButton *m_browseBtn = nullptr; QString m_fileNameFilter; Mode m_mode; Path m_lastSignaledPath; QString m_dialogCaption; - Private::FileSystemPathValidator *m_validator; + Private::FileSystemPathValidator *m_validator = nullptr; }; FileSystemPathEdit::FileSystemPathEditPrivate::FileSystemPathEditPrivate( diff --git a/src/gui/fspathedit.h b/src/gui/fspathedit.h index 2f697544c..772714f47 100644 --- a/src/gui/fspathedit.h +++ b/src/gui/fspathedit.h @@ -111,7 +111,7 @@ private: QWidget *editWidgetImpl() const; - FileSystemPathEditPrivate *d_ptr; + FileSystemPathEditPrivate *d_ptr = nullptr; }; /// Widget which uses QLineEdit for path editing diff --git a/src/gui/fspathedit_p.h b/src/gui/fspathedit_p.h index 28c858852..3a512177d 100644 --- a/src/gui/fspathedit_p.h +++ b/src/gui/fspathedit_p.h @@ -138,11 +138,11 @@ namespace Private static QString warningText(FileSystemPathValidator::TestResult r); void showCompletionPopup(); - QFileSystemModel *m_completerModel; - QCompleter *m_completer; - QAction *m_browseAction; + QFileSystemModel *m_completerModel = nullptr; + QCompleter *m_completer = nullptr; + QAction *m_browseAction = nullptr; + QAction *m_warningAction = nullptr; QFileIconProvider m_iconProvider; - QAction *m_warningAction; }; class FileComboEdit final : public QComboBox, public FileEditorWithCompletion diff --git a/src/gui/ipsubnetwhitelistoptionsdialog.h b/src/gui/ipsubnetwhitelistoptionsdialog.h index e0cd412fc..2b9538ac7 100644 --- a/src/gui/ipsubnetwhitelistoptionsdialog.h +++ b/src/gui/ipsubnetwhitelistoptionsdialog.h @@ -56,10 +56,10 @@ private slots: void on_txtIPSubnet_textChanged(const QString &subnetStr); private: - Ui::IPSubnetWhitelistOptionsDialog *m_ui; + Ui::IPSubnetWhitelistOptionsDialog *m_ui = nullptr; SettingValue m_storeDialogSize; - QStringListModel *m_model; - QSortFilterProxyModel *m_sortFilter; + QStringListModel *m_model = nullptr; + QSortFilterProxyModel *m_sortFilter = nullptr; bool m_modified = false; }; diff --git a/src/gui/lineedit.h b/src/gui/lineedit.h index 856fcc569..03d72cf8d 100644 --- a/src/gui/lineedit.h +++ b/src/gui/lineedit.h @@ -26,5 +26,5 @@ protected: void keyPressEvent(QKeyEvent *event) override; private: - QToolButton *m_searchButton; + QToolButton *m_searchButton = nullptr; }; diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index de402ae2b..0d9c7e58f 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -219,9 +219,9 @@ private: void showStatusBar(bool show); void showFiltersSidebar(bool show); - Ui::MainWindow *m_ui; + Ui::MainWindow *m_ui = nullptr; - QFileSystemWatcher *m_executableWatcher; + QFileSystemWatcher *m_executableWatcher = nullptr; // GUI related bool m_posInitialized = false; QPointer m_tabs; @@ -237,27 +237,27 @@ private: #endif QPointer m_trayIconMenu; - TransferListWidget *m_transferListWidget; + TransferListWidget *m_transferListWidget = nullptr; TransferListFiltersWidget *m_transferListFiltersWidget = nullptr; - PropertiesWidget *m_propertiesWidget; - bool m_displaySpeedInTitle; + PropertiesWidget *m_propertiesWidget = nullptr; + bool m_displaySpeedInTitle = false; bool m_forceExit = false; - bool m_uiLocked; + bool m_uiLocked = false; bool m_unlockDlgShowing = false; - LineEdit *m_searchFilter; - QAction *m_searchFilterAction; + LineEdit *m_searchFilter = nullptr; + QAction *m_searchFilterAction = nullptr; // Widgets - QAction *m_queueSeparator; - QAction *m_queueSeparatorMenu; - QSplitter *m_splitter; + QAction *m_queueSeparator = nullptr; + QAction *m_queueSeparatorMenu = nullptr; + QSplitter *m_splitter = nullptr; QPointer m_searchWidget; QPointer m_rssWidget; QPointer m_executionLog; // Power Management - PowerManagement *m_pwr; - QTimer *m_preventTimer; + PowerManagement *m_pwr = nullptr; + QTimer *m_preventTimer = nullptr; bool m_hasPython = false; - QMenu *m_toolbarMenu; + QMenu *m_toolbarMenu = nullptr; SettingValue m_storeExecutionLogEnabled; SettingValue m_storeDownloadTrackerFavicon; diff --git a/src/gui/optionsdialog.h b/src/gui/optionsdialog.h index c15b0a3dd..b15dd434c 100644 --- a/src/gui/optionsdialog.h +++ b/src/gui/optionsdialog.h @@ -177,14 +177,14 @@ private: bool schedTimesOk(); - Ui::OptionsDialog *m_ui; + Ui::OptionsDialog *m_ui = nullptr; SettingValue m_storeDialogSize; SettingValue m_storeHSplitterSize; SettingValue m_storeLastViewedPage; - QPushButton *m_applyButton; + QPushButton *m_applyButton = nullptr; - AdvancedSettings *m_advancedSettings; + AdvancedSettings *m_advancedSettings = nullptr; bool m_refreshingIpFilter = false; }; diff --git a/src/gui/powermanagement/powermanagement.h b/src/gui/powermanagement/powermanagement.h index d817e2a24..0ef9fbfe4 100644 --- a/src/gui/powermanagement/powermanagement.h +++ b/src/gui/powermanagement/powermanagement.h @@ -58,7 +58,7 @@ private: bool m_busy = false; #if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) && defined(QT_DBUS_LIB) - PowerManagementInhibitor *m_inhibitor; + PowerManagementInhibitor *m_inhibitor = nullptr; #endif #ifdef Q_OS_MACOS IOPMAssertionID m_assertionID; diff --git a/src/gui/previewselectdialog.h b/src/gui/previewselectdialog.h index 010cb25d5..76a42bad7 100644 --- a/src/gui/previewselectdialog.h +++ b/src/gui/previewselectdialog.h @@ -78,10 +78,10 @@ private: void loadWindowState(); void saveWindowState(); - Ui::PreviewSelectDialog *m_ui; - QStandardItemModel *m_previewListModel; - PreviewListDelegate *m_listDelegate; - const BitTorrent::Torrent *m_torrent; + Ui::PreviewSelectDialog *m_ui = nullptr; + QStandardItemModel *m_previewListModel = nullptr; + PreviewListDelegate *m_listDelegate = nullptr; + const BitTorrent::Torrent *m_torrent = nullptr; bool m_headerStateInitialized = false; // Settings diff --git a/src/gui/properties/peersadditiondialog.h b/src/gui/properties/peersadditiondialog.h index 6033d31e8..a778ccb39 100644 --- a/src/gui/properties/peersadditiondialog.h +++ b/src/gui/properties/peersadditiondialog.h @@ -53,6 +53,6 @@ protected slots: void validateInput(); private: - Ui::PeersAdditionDialog *m_ui; + Ui::PeersAdditionDialog *m_ui = nullptr; QVector m_peersList; }; diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index a6c21caa4..8ff8a791f 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -73,8 +73,6 @@ PropertiesWidget::PropertiesWidget(QWidget *parent) : QWidget(parent) , m_ui(new Ui::PropertiesWidget()) - , m_torrent(nullptr) - , m_handleWidth(-1) { m_ui->setupUi(this); setAutoFillBackground(true); diff --git a/src/gui/properties/propertieswidget.h b/src/gui/properties/propertieswidget.h index 7f9a208b3..8dcff78f4 100644 --- a/src/gui/properties/propertieswidget.h +++ b/src/gui/properties/propertieswidget.h @@ -112,18 +112,18 @@ private: void openParentFolder(const QModelIndex &index) const; Path getFullPath(const QModelIndex &index) const; - Ui::PropertiesWidget *m_ui; - BitTorrent::Torrent *m_torrent; + Ui::PropertiesWidget *m_ui = nullptr; + BitTorrent::Torrent *m_torrent = nullptr; SlideState m_state; - TorrentContentFilterModel *m_propListModel; - PropListDelegate *m_propListDelegate; - PeerListWidget *m_peerList; - TrackerListWidget *m_trackerList; + TorrentContentFilterModel *m_propListModel = nullptr; + PropListDelegate *m_propListDelegate = nullptr; + PeerListWidget *m_peerList = nullptr; + TrackerListWidget *m_trackerList = nullptr; QWidget *m_speedWidget = nullptr; QList m_slideSizes; - DownloadedPiecesBar *m_downloadedPieces; - PieceAvailabilityBar *m_piecesAvailability; - PropTabBar *m_tabBar; - LineEdit *m_contentFilterLine; - int m_handleWidth; + DownloadedPiecesBar *m_downloadedPieces = nullptr; + PieceAvailabilityBar *m_piecesAvailability = nullptr; + PropTabBar *m_tabBar = nullptr; + LineEdit *m_contentFilterLine = nullptr; + int m_handleWidth = -1; }; diff --git a/src/gui/properties/proplistdelegate.h b/src/gui/properties/proplistdelegate.h index dca97146d..1db613224 100644 --- a/src/gui/properties/proplistdelegate.h +++ b/src/gui/properties/proplistdelegate.h @@ -69,6 +69,6 @@ signals: void filteredFilesChanged() const; private: - PropertiesWidget *m_properties; + PropertiesWidget *m_properties = nullptr; ProgressBarPainter m_progressBarPainter; }; diff --git a/src/gui/properties/proptabbar.cpp b/src/gui/properties/proptabbar.cpp index 200849ac0..aeb6f26a7 100644 --- a/src/gui/properties/proptabbar.cpp +++ b/src/gui/properties/proptabbar.cpp @@ -38,7 +38,6 @@ PropTabBar::PropTabBar(QWidget *parent) : QHBoxLayout(parent) - , m_currentIndex(-1) { setAlignment(Qt::AlignLeft | Qt::AlignCenter); setSpacing(3); diff --git a/src/gui/properties/proptabbar.h b/src/gui/properties/proptabbar.h index c68e1df1d..5bcc34851 100644 --- a/src/gui/properties/proptabbar.h +++ b/src/gui/properties/proptabbar.h @@ -60,6 +60,6 @@ public slots: void setCurrentIndex(int index); private: - QButtonGroup *m_btnGroup; - int m_currentIndex; + QButtonGroup *m_btnGroup = nullptr; + int m_currentIndex = -1; }; diff --git a/src/gui/properties/speedwidget.h b/src/gui/properties/speedwidget.h index 97d17192b..948077c18 100644 --- a/src/gui/properties/speedwidget.h +++ b/src/gui/properties/speedwidget.h @@ -49,7 +49,7 @@ public: void showPopup() override; private: - QMenu *m_menu; + QMenu *m_menu = nullptr; }; @@ -71,13 +71,13 @@ private: void loadSettings(); void saveSettings() const; - QVBoxLayout *m_layout; - QHBoxLayout *m_hlayout; - QLabel *m_periodLabel; - QComboBox *m_periodCombobox; - SpeedPlotView *m_plot; + QVBoxLayout *m_layout = nullptr; + QHBoxLayout *m_hlayout = nullptr; + QLabel *m_periodLabel = nullptr; + QComboBox *m_periodCombobox = nullptr; + SpeedPlotView *m_plot = nullptr; - ComboBoxMenuButton *m_graphsButton; - QMenu *m_graphsMenu; + ComboBoxMenuButton *m_graphsButton = nullptr; + QMenu *m_graphsMenu = nullptr; QList m_graphsMenuActions; }; diff --git a/src/gui/properties/trackerlistwidget.h b/src/gui/properties/trackerlistwidget.h index e2bdcb452..26c94a8db 100644 --- a/src/gui/properties/trackerlistwidget.h +++ b/src/gui/properties/trackerlistwidget.h @@ -91,9 +91,9 @@ private: static QStringList headerLabels(); - PropertiesWidget *m_properties; + PropertiesWidget *m_properties = nullptr; QHash m_trackerItems; - QTreeWidgetItem *m_DHTItem; - QTreeWidgetItem *m_PEXItem; - QTreeWidgetItem *m_LSDItem; + QTreeWidgetItem *m_DHTItem = nullptr; + QTreeWidgetItem *m_PEXItem = nullptr; + QTreeWidgetItem *m_LSDItem = nullptr; }; diff --git a/src/gui/properties/trackersadditiondialog.h b/src/gui/properties/trackersadditiondialog.h index b1ac9f773..90cf233ae 100644 --- a/src/gui/properties/trackersadditiondialog.h +++ b/src/gui/properties/trackersadditiondialog.h @@ -65,6 +65,6 @@ public slots: void torrentListDownloadFinished(const Net::DownloadResult &result); private: - Ui::TrackersAdditionDialog *m_ui; - BitTorrent::Torrent *const m_torrent; + Ui::TrackersAdditionDialog *m_ui = nullptr; + BitTorrent::Torrent *const m_torrent = nullptr; }; diff --git a/src/gui/rss/automatedrssdownloader.h b/src/gui/rss/automatedrssdownloader.h index 304f33b8b..b9f2dc7f8 100644 --- a/src/gui/rss/automatedrssdownloader.h +++ b/src/gui/rss/automatedrssdownloader.h @@ -101,12 +101,12 @@ private: const QString m_formatFilterJSON; const QString m_formatFilterLegacy; - Ui::AutomatedRssDownloader *m_ui; - QListWidgetItem *m_currentRuleItem; + Ui::AutomatedRssDownloader *m_ui = nullptr; + QListWidgetItem *m_currentRuleItem = nullptr; QSet> m_treeListEntries; RSS::AutoDownloadRule m_currentRule; QHash m_itemsByRuleName; - QRegularExpression *m_episodeRegex; + QRegularExpression *m_episodeRegex = nullptr; SettingValue m_storeDialogSize; SettingValue m_storeHSplitterSize; diff --git a/src/gui/rss/feedlistwidget.h b/src/gui/rss/feedlistwidget.h index 569011a8c..e1b603de5 100644 --- a/src/gui/rss/feedlistwidget.h +++ b/src/gui/rss/feedlistwidget.h @@ -71,5 +71,5 @@ private: void fill(QTreeWidgetItem *parent, RSS::Folder *rssParent); QHash m_rssToTreeItemMapping; - QTreeWidgetItem *m_unreadStickyItem; + QTreeWidgetItem *m_unreadStickyItem = nullptr; }; diff --git a/src/gui/rss/htmlbrowser.h b/src/gui/rss/htmlbrowser.h index 3fac84b11..b503f257a 100644 --- a/src/gui/rss/htmlbrowser.h +++ b/src/gui/rss/htmlbrowser.h @@ -47,8 +47,8 @@ public: QVariant loadResource(int type, const QUrl &name) override; protected: - QNetworkAccessManager *m_netManager; - QNetworkDiskCache *m_diskCache; + QNetworkAccessManager *m_netManager = nullptr; + QNetworkDiskCache *m_diskCache = nullptr; QHash m_activeRequests; protected slots: diff --git a/src/gui/rss/rsswidget.h b/src/gui/rss/rsswidget.h index 444044457..9d1f296a0 100644 --- a/src/gui/rss/rsswidget.h +++ b/src/gui/rss/rsswidget.h @@ -82,7 +82,7 @@ private slots: void handleUnreadCountChanged(); private: - Ui::RSSWidget *m_ui; - ArticleListWidget *m_articleListWidget; - FeedListWidget *m_feedListWidget; + Ui::RSSWidget *m_ui = nullptr; + ArticleListWidget *m_articleListWidget = nullptr; + FeedListWidget *m_feedListWidget = nullptr; }; diff --git a/src/gui/search/pluginselectdialog.h b/src/gui/search/pluginselectdialog.h index 1ff280a13..29df65a33 100644 --- a/src/gui/search/pluginselectdialog.h +++ b/src/gui/search/pluginselectdialog.h @@ -91,9 +91,9 @@ private: void finishAsyncOp(); void finishPluginUpdate(); - Ui::PluginSelectDialog *m_ui; + Ui::PluginSelectDialog *m_ui = nullptr; SettingValue m_storeDialogSize; - SearchPluginManager *m_pluginManager; + SearchPluginManager *m_pluginManager = nullptr; QStringList m_updatedPlugins; int m_asyncOps = 0; int m_pendingUpdates = 0; diff --git a/src/gui/search/pluginsourcedialog.h b/src/gui/search/pluginsourcedialog.h index d5d8a1695..e930fde3e 100644 --- a/src/gui/search/pluginsourcedialog.h +++ b/src/gui/search/pluginsourcedialog.h @@ -55,6 +55,6 @@ private slots: void on_urlButton_clicked(); private: - Ui::PluginSourceDialog *m_ui; + Ui::PluginSourceDialog *m_ui = nullptr; SettingValue m_storeDialogSize; }; diff --git a/src/gui/search/searchjobwidget.h b/src/gui/search/searchjobwidget.h index e4818a5df..46a608864 100644 --- a/src/gui/search/searchjobwidget.h +++ b/src/gui/search/searchjobwidget.h @@ -130,11 +130,11 @@ private: static QString statusText(Status st); - Ui::SearchJobWidget *m_ui; - SearchHandler *m_searchHandler; - QStandardItemModel *m_searchListModel; - SearchSortModel *m_proxyModel; - LineEdit *m_lineEditSearchResultsFilter; + Ui::SearchJobWidget *m_ui = nullptr; + SearchHandler *m_searchHandler = nullptr; + QStandardItemModel *m_searchListModel = nullptr; + SearchSortModel *m_proxyModel = nullptr; + LineEdit *m_lineEditSearchResultsFilter = nullptr; Status m_status = Status::Ongoing; bool m_noSearchResults = true; diff --git a/src/gui/search/searchwidget.cpp b/src/gui/search/searchwidget.cpp index 91d9a762c..4d19eba2e 100644 --- a/src/gui/search/searchwidget.cpp +++ b/src/gui/search/searchwidget.cpp @@ -87,7 +87,6 @@ SearchWidget::SearchWidget(MainWindow *mainWindow) : QWidget(mainWindow) , m_ui(new Ui::SearchWidget()) , m_mainWindow(mainWindow) - , m_isNewQueryString(false) { m_ui->setupUi(this); m_ui->tabWidget->tabBar()->installEventFilter(this); diff --git a/src/gui/search/searchwidget.h b/src/gui/search/searchwidget.h index fccd46dc7..e1e9bca18 100644 --- a/src/gui/search/searchwidget.h +++ b/src/gui/search/searchwidget.h @@ -78,10 +78,10 @@ private: QString selectedCategory() const; QString selectedPlugin() const; - Ui::SearchWidget *m_ui; + Ui::SearchWidget *m_ui = nullptr; QPointer m_currentSearchTab; // Selected tab QPointer m_activeSearchTab; // Tab with running search QList m_allTabs; // To store all tabs - MainWindow *m_mainWindow; - bool m_isNewQueryString; + MainWindow *m_mainWindow = nullptr; + bool m_isNewQueryString = false; }; diff --git a/src/gui/shutdownconfirmdialog.cpp b/src/gui/shutdownconfirmdialog.cpp index 99f1643fc..dd1f9ecb9 100644 --- a/src/gui/shutdownconfirmdialog.cpp +++ b/src/gui/shutdownconfirmdialog.cpp @@ -45,7 +45,6 @@ using namespace std::chrono_literals; ShutdownConfirmDialog::ShutdownConfirmDialog(QWidget *parent, const ShutdownDialogAction &action) : QDialog(parent) , m_ui(new Ui::ShutdownConfirmDialog) - , m_timeout(15) , m_action(action) { m_ui->setupUi(this); diff --git a/src/gui/shutdownconfirmdialog.h b/src/gui/shutdownconfirmdialog.h index b5d7f5d26..8211681b9 100644 --- a/src/gui/shutdownconfirmdialog.h +++ b/src/gui/shutdownconfirmdialog.h @@ -62,9 +62,9 @@ private: void updateText(); // Vars - Ui::ShutdownConfirmDialog *m_ui; + Ui::ShutdownConfirmDialog *m_ui = nullptr; QTimer m_timer; - int m_timeout; + int m_timeout = 15; ShutdownDialogAction m_action; QString m_msg; }; diff --git a/src/gui/speedlimitdialog.h b/src/gui/speedlimitdialog.h index e30e8ea0e..557114e60 100644 --- a/src/gui/speedlimitdialog.h +++ b/src/gui/speedlimitdialog.h @@ -50,7 +50,7 @@ public slots: void accept() override; private: - Ui::SpeedLimitDialog *m_ui; + Ui::SpeedLimitDialog *m_ui = nullptr; SettingValue m_storeDialogSize; struct { diff --git a/src/gui/stacktracedialog.h b/src/gui/stacktracedialog.h index 034dc948a..823b8ac8f 100644 --- a/src/gui/stacktracedialog.h +++ b/src/gui/stacktracedialog.h @@ -48,5 +48,5 @@ public: void setText(const QString &signalName, const QString &stacktrace); private: - Ui::StacktraceDialog *m_ui; + Ui::StacktraceDialog *m_ui = nullptr; }; diff --git a/src/gui/statsdialog.h b/src/gui/statsdialog.h index 4f0e890d9..bbb3deab0 100644 --- a/src/gui/statsdialog.h +++ b/src/gui/statsdialog.h @@ -50,6 +50,6 @@ private slots: void update(); private: - Ui::StatsDialog *m_ui; + Ui::StatsDialog *m_ui = nullptr; SettingValue m_storeDialogSize; }; diff --git a/src/gui/statusbar.h b/src/gui/statusbar.h index 3cdcae6ec..3d9354faf 100644 --- a/src/gui/statusbar.h +++ b/src/gui/statusbar.h @@ -64,9 +64,9 @@ private: void updateDHTNodesNumber(); void updateSpeedLabels(); - QPushButton *m_dlSpeedLbl; - QPushButton *m_upSpeedLbl; - QLabel *m_DHTLbl; - QPushButton *m_connecStatusLblIcon; - QPushButton *m_altSpeedsBtn; + QPushButton *m_dlSpeedLbl = nullptr; + QPushButton *m_upSpeedLbl = nullptr; + QLabel *m_DHTLbl = nullptr; + QPushButton *m_connecStatusLblIcon = nullptr; + QPushButton *m_altSpeedsBtn = nullptr; }; diff --git a/src/gui/torrentcategorydialog.h b/src/gui/torrentcategorydialog.h index 889226a2f..6a1e315a8 100644 --- a/src/gui/torrentcategorydialog.h +++ b/src/gui/torrentcategorydialog.h @@ -65,6 +65,6 @@ private slots: void useDownloadPathChanged(int index); private: - Ui::TorrentCategoryDialog *m_ui; + Ui::TorrentCategoryDialog *m_ui = nullptr; Path m_lastEnteredDownloadPath; }; diff --git a/src/gui/torrentcontentfiltermodel.h b/src/gui/torrentcontentfiltermodel.h index f475e1aee..a70bcab14 100644 --- a/src/gui/torrentcontentfiltermodel.h +++ b/src/gui/torrentcontentfiltermodel.h @@ -62,6 +62,6 @@ protected: private: bool hasFiltered(const QModelIndex &folder) const; - TorrentContentModel *m_model; + TorrentContentModel *m_model = nullptr; Utils::Compare::NaturalLessThan m_naturalLessThan; }; diff --git a/src/gui/torrentcontentmodel.cpp b/src/gui/torrentcontentmodel.cpp index 4663007e1..d0ce0371c 100644 --- a/src/gui/torrentcontentmodel.cpp +++ b/src/gui/torrentcontentmodel.cpp @@ -438,7 +438,7 @@ QModelIndex TorrentContentModel::index(int row, int column, const QModelIndex &p if (column >= TorrentContentModelItem::NB_COL) return {}; - TorrentContentModelFolder *parentItem; + TorrentContentModelFolder *parentItem = nullptr; if (!parent.isValid()) parentItem = m_rootItem; else @@ -475,7 +475,7 @@ int TorrentContentModel::rowCount(const QModelIndex &parent) const if (parent.column() > 0) return 0; - TorrentContentModelFolder *parentItem; + TorrentContentModelFolder *parentItem = nullptr; if (!parent.isValid()) parentItem = m_rootItem; else diff --git a/src/gui/torrentcontentmodelitem.cpp b/src/gui/torrentcontentmodelitem.cpp index ae14a2d60..2c2e00d3f 100644 --- a/src/gui/torrentcontentmodelitem.cpp +++ b/src/gui/torrentcontentmodelitem.cpp @@ -37,11 +37,6 @@ TorrentContentModelItem::TorrentContentModelItem(TorrentContentModelFolder *parent) : m_parentItem(parent) - , m_size(0) - , m_remaining(0) - , m_priority(BitTorrent::DownloadPriority::Normal) - , m_progress(0) - , m_availability(-1.) { } diff --git a/src/gui/torrentcontentmodelitem.h b/src/gui/torrentcontentmodelitem.h index 6cf1dadcb..27a33a4ad 100644 --- a/src/gui/torrentcontentmodelitem.h +++ b/src/gui/torrentcontentmodelitem.h @@ -84,14 +84,14 @@ public: int row() const; protected: - TorrentContentModelFolder *m_parentItem; + TorrentContentModelFolder *m_parentItem = nullptr; // Root item members QVector m_itemData; // Non-root item members QString m_name; - qulonglong m_size; - qulonglong m_remaining; - BitTorrent::DownloadPriority m_priority; - qreal m_progress; - qreal m_availability; + qulonglong m_size = 0; + qulonglong m_remaining = 0; + BitTorrent::DownloadPriority m_priority = BitTorrent::DownloadPriority::Normal; + qreal m_progress = 0; + qreal m_availability = -1; }; diff --git a/src/gui/torrentcreatordialog.h b/src/gui/torrentcreatordialog.h index 9b6228f49..4f032c2cf 100644 --- a/src/gui/torrentcreatordialog.h +++ b/src/gui/torrentcreatordialog.h @@ -74,8 +74,8 @@ private: int getPaddedFileSizeLimit() const; #endif - Ui::TorrentCreatorDialog *m_ui; - BitTorrent::TorrentCreatorThread *m_creatorThread; + Ui::TorrentCreatorDialog *m_ui = nullptr; + BitTorrent::TorrentCreatorThread *m_creatorThread = nullptr; // settings SettingValue m_storeDialogSize; diff --git a/src/gui/torrentoptionsdialog.h b/src/gui/torrentoptionsdialog.h index 0291fe9e9..3af01777f 100644 --- a/src/gui/torrentoptionsdialog.h +++ b/src/gui/torrentoptionsdialog.h @@ -75,7 +75,7 @@ private: int getSeedingTime() const; QVector m_torrentIDs; - Ui::TorrentOptionsDialog *m_ui; + Ui::TorrentOptionsDialog *m_ui = nullptr; SettingValue m_storeDialogSize; QStringList m_categories; QString m_currentCategoriesString; diff --git a/src/gui/trackerentriesdialog.h b/src/gui/trackerentriesdialog.h index f2380f205..b4882fe7b 100644 --- a/src/gui/trackerentriesdialog.h +++ b/src/gui/trackerentriesdialog.h @@ -59,6 +59,6 @@ private: void saveSettings(); void loadSettings(); - Ui::TrackerEntriesDialog *m_ui; + Ui::TrackerEntriesDialog *m_ui = nullptr; SettingValue m_storeDialogSize; }; diff --git a/src/gui/transferlistfilterswidget.h b/src/gui/transferlistfilterswidget.h index 9b78ab651..32c5ba6be 100644 --- a/src/gui/transferlistfilterswidget.h +++ b/src/gui/transferlistfilterswidget.h @@ -66,7 +66,7 @@ public slots: void toggleFilter(bool checked); protected: - TransferListWidget *transferList; + TransferListWidget *transferList = nullptr; private slots: virtual void showMenu() = 0; @@ -190,8 +190,8 @@ private: void toggleCategoryFilter(bool enabled); void toggleTagFilter(bool enabled); - TransferListWidget *m_transferList; - TrackerFiltersList *m_trackerFilters; - CategoryFilterWidget *m_categoryFilterWidget; - TagFilterWidget *m_tagFilterWidget; + TransferListWidget *m_transferList = nullptr; + TrackerFiltersList *m_trackerFilters = nullptr; + CategoryFilterWidget *m_categoryFilterWidget = nullptr; + TagFilterWidget *m_tagFilterWidget = nullptr; }; diff --git a/src/gui/transferlistwidget.h b/src/gui/transferlistwidget.h index c30e09c20..51caeee7d 100644 --- a/src/gui/transferlistwidget.h +++ b/src/gui/transferlistwidget.h @@ -131,7 +131,7 @@ private: QVector getVisibleTorrents() const; int visibleColumnsCount() const; - TransferListModel *m_listModel; - TransferListSortModel *m_sortFilterModel; - MainWindow *m_mainWindow; + TransferListModel *m_listModel = nullptr; + TransferListSortModel *m_sortFilterModel = nullptr; + MainWindow *m_mainWindow = nullptr; }; diff --git a/src/gui/tristateaction.h b/src/gui/tristateaction.h index 4c4ccb5a2..b442cd335 100644 --- a/src/gui/tristateaction.h +++ b/src/gui/tristateaction.h @@ -54,5 +54,5 @@ public: void setCloseOnInteraction(bool enabled); private: - TriStateWidget *m_triStateWidget; + TriStateWidget *m_triStateWidget = nullptr; }; diff --git a/src/gui/watchedfolderoptionsdialog.h b/src/gui/watchedfolderoptionsdialog.h index 4dacc8d6b..4292b5001 100644 --- a/src/gui/watchedfolderoptionsdialog.h +++ b/src/gui/watchedfolderoptionsdialog.h @@ -57,7 +57,7 @@ private: void onTMMChanged(int index); void onCategoryChanged(int index); - Ui::WatchedFolderOptionsDialog *m_ui; + Ui::WatchedFolderOptionsDialog *m_ui = nullptr; Path m_savePath; Path m_downloadPath; bool m_useDownloadPath = false; diff --git a/src/gui/watchedfoldersmodel.h b/src/gui/watchedfoldersmodel.h index 368fbd8cf..4ffd1778e 100644 --- a/src/gui/watchedfoldersmodel.h +++ b/src/gui/watchedfoldersmodel.h @@ -62,7 +62,7 @@ private: void onFolderSet(const Path &path, const TorrentFilesWatcher::WatchedFolderOptions &options); void onFolderRemoved(const Path &path); - TorrentFilesWatcher *m_fsWatcher; + TorrentFilesWatcher *m_fsWatcher = nullptr; PathList m_watchedFolders; QHash m_watchedFoldersOptions; QSet m_deletedFolders;