Initialize member variables

This commit is contained in:
Chocobo1
2023-05-07 15:16:32 +08:00
parent 29c05ed3e8
commit 73134d5f4d
29 changed files with 49 additions and 64 deletions

View File

@@ -139,5 +139,5 @@ private:
Averager *m_currentAverager {&m_averager5Min};
QMap<GraphID, GraphProperties> m_properties;
milliseconds m_currentMaxDuration;
milliseconds m_currentMaxDuration {0};
};

View File

@@ -32,13 +32,6 @@
SearchSortModel::SearchSortModel(QObject *parent)
: base(parent)
, m_isNameFilterEnabled(false)
, m_minSeeds(0)
, m_maxSeeds(-1)
, m_minLeeches(0)
, m_maxLeeches(-1)
, m_minSize(0)
, m_maxSize(-1)
{
setSortRole(UnderlyingDataRole);
setFilterRole(UnderlyingDataRole);

View File

@@ -90,12 +90,12 @@ protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
private:
bool m_isNameFilterEnabled;
bool m_isNameFilterEnabled = false;
QString m_searchTerm;
QStringList m_searchTermWords;
int m_minSeeds, m_maxSeeds;
int m_minLeeches, m_maxLeeches;
qint64 m_minSize, m_maxSize;
int m_minSeeds = 0, m_maxSeeds = -1;
int m_minLeeches = 0, m_maxLeeches = -1;
qint64 m_minSize = 0, m_maxSize = -1;
Utils::Compare::NaturalLessThan<Qt::CaseInsensitive> m_naturalLessThan;
};

View File

@@ -52,6 +52,6 @@ public:
private:
void addNewTag();
Ui::TorrentTagsDialog *m_ui;
Ui::TorrentTagsDialog *m_ui = nullptr;
SettingValue<QSize> m_storeDialogSize;
};

View File

@@ -72,6 +72,6 @@ private:
QModelIndex index(CategoryModelItem *item) const;
CategoryModelItem *findItem(const QString &fullName) const;
bool m_isSubcategoriesEnabled;
bool m_isSubcategoriesEnabled = false;
CategoryModelItem *m_rootItem = nullptr;
};

View File

@@ -38,8 +38,6 @@
TriStateWidget::TriStateWidget(const QString &text, QWidget *parent)
: QWidget {parent}
, m_closeOnInteraction {true}
, m_checkState {Qt::Unchecked}
, m_text {text}
{
setMouseTracking(true); // for visual effects via mouse navigation

View File

@@ -55,7 +55,7 @@ private:
void toggleCheckState();
bool m_closeOnInteraction;
Qt::CheckState m_checkState;
bool m_closeOnInteraction = true;
Qt::CheckState m_checkState = Qt::Unchecked;
const QString m_text;
};

View File

@@ -60,7 +60,7 @@ private:
bool storeColors();
bool storeIcons();
Ui::UIThemeDialog *m_ui;
Ui::UIThemeDialog *m_ui = nullptr;
SettingValue<QSize> m_storeDialogSize;
DefaultThemeSource m_defaultThemeSource;