Browse Source

Initialize member variables

adaptive-webui-19844
Chocobo1 2 years ago
parent
commit
73134d5f4d
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 1
      src/app/application.cpp
  2. 2
      src/app/application.h
  3. 1
      src/base/bittorrent/bandwidthscheduler.cpp
  4. 2
      src/base/bittorrent/bandwidthscheduler.h
  5. 3
      src/base/bittorrent/filterparserthread.cpp
  6. 2
      src/base/bittorrent/filterparserthread.h
  7. 2
      src/base/bittorrent/loadtorrentparams.h
  8. 3
      src/base/bittorrent/magneturi.cpp
  9. 2
      src/base/bittorrent/magneturi.h
  10. 6
      src/base/bittorrent/sessionimpl.h
  11. 6
      src/base/bittorrent/torrentcreatorthread.h
  12. 2
      src/base/bittorrent/torrentimpl.h
  13. 4
      src/base/http/requestparser.h
  14. 4
      src/base/http/types.h
  15. 12
      src/base/logger.h
  16. 2
      src/base/net/dnsupdater.cpp
  17. 4
      src/base/net/dnsupdater.h
  18. 2
      src/base/net/downloadmanager.h
  19. 6
      src/base/search/searchhandler.h
  20. 2
      src/base/search/searchpluginmanager.h
  21. 2
      src/gui/properties/speedplotview.h
  22. 7
      src/gui/search/searchsortmodel.cpp
  23. 8
      src/gui/search/searchsortmodel.h
  24. 2
      src/gui/torrenttagsdialog.h
  25. 2
      src/gui/transferlistfilters/categoryfiltermodel.h
  26. 2
      src/gui/tristatewidget.cpp
  27. 4
      src/gui/tristatewidget.h
  28. 2
      src/gui/uithemedialog.h
  29. 16
      src/webui/webapplication.h

1
src/app/application.cpp

@ -224,7 +224,6 @@ namespace @@ -224,7 +224,6 @@ namespace
Application::Application(int &argc, char **argv)
: BaseApplication(argc, argv)
, m_shutdownAct(ShutdownDialogAction::Exit)
, m_commandLineArgs(parseCommandLine(Application::arguments()))
, m_storeFileLoggerEnabled(FILELOGGER_SETTINGS_KEY(u"Enabled"_qs))
, m_storeFileLoggerBackup(FILELOGGER_SETTINGS_KEY(u"Backup"_qs))

2
src/app/application.h

@ -173,7 +173,7 @@ private: @@ -173,7 +173,7 @@ private:
ApplicationInstanceManager *m_instanceManager = nullptr;
QAtomicInt m_isCleanupRun;
bool m_isProcessingParamsAllowed = false;
ShutdownDialogAction m_shutdownAct;
ShutdownDialogAction m_shutdownAct = ShutdownDialogAction::Exit;
QBtCommandLineParameters m_commandLineArgs;
// FileLog

1
src/base/bittorrent/bandwidthscheduler.cpp

@ -41,7 +41,6 @@ using namespace std::chrono_literals; @@ -41,7 +41,6 @@ using namespace std::chrono_literals;
BandwidthScheduler::BandwidthScheduler(QObject *parent)
: QObject(parent)
, m_lastAlternative(false)
{
connect(&m_timer, &QTimer::timeout, this, &BandwidthScheduler::onTimeout);
}

2
src/base/bittorrent/bandwidthscheduler.h

@ -49,5 +49,5 @@ private: @@ -49,5 +49,5 @@ private:
void onTimeout();
QTimer m_timer;
bool m_lastAlternative;
bool m_lastAlternative = false;
};

3
src/base/bittorrent/filterparserthread.cpp

@ -89,7 +89,7 @@ namespace @@ -89,7 +89,7 @@ namespace
}
private:
lt::address_v4::bytes_type m_buf;
lt::address_v4::bytes_type m_buf {};
};
bool parseIPAddress(const char *data, lt::address &address)
@ -111,7 +111,6 @@ namespace @@ -111,7 +111,6 @@ namespace
FilterParserThread::FilterParserThread(QObject *parent)
: QThread(parent)
, m_abort(false)
{
}

2
src/base/bittorrent/filterparserthread.h

@ -62,7 +62,7 @@ private: @@ -62,7 +62,7 @@ private:
int getlineInStream(QDataStream &stream, std::string &name, char delim);
int parseP2BFilterFile();
bool m_abort;
bool m_abort = false;
Path m_filePath;
lt::ip_filter m_filter;
};

2
src/base/bittorrent/loadtorrentparams.h

@ -54,7 +54,7 @@ namespace BitTorrent @@ -54,7 +54,7 @@ namespace BitTorrent
bool firstLastPiecePriority = false;
bool hasFinishedStatus = false;
bool stopped = false;
Torrent::StopCondition stopCondition;
Torrent::StopCondition stopCondition = Torrent::StopCondition::None;
bool addToQueueTop = false; // only for new torrents

3
src/base/bittorrent/magneturi.cpp

@ -75,8 +75,7 @@ using namespace BitTorrent; @@ -75,8 +75,7 @@ using namespace BitTorrent;
const int magnetUriId = qRegisterMetaType<MagnetUri>();
MagnetUri::MagnetUri(const QString &source)
: m_valid(false)
, m_url(source)
: m_url(source)
{
if (source.isEmpty()) return;

2
src/base/bittorrent/magneturi.h

@ -54,7 +54,7 @@ namespace BitTorrent @@ -54,7 +54,7 @@ namespace BitTorrent
lt::add_torrent_params addTorrentParams() const;
private:
bool m_valid;
bool m_valid = false;
QString m_url;
InfoHash m_infoHash;
QString m_name;

6
src/base/bittorrent/sessionimpl.h

@ -482,15 +482,15 @@ namespace BitTorrent @@ -482,15 +482,15 @@ namespace BitTorrent
{
lt::torrent_handle torrentHandle;
Path path;
MoveStorageMode mode;
MoveStorageContext context;
MoveStorageMode mode {};
MoveStorageContext context {};
};
struct RemovingTorrentData
{
QString name;
Path pathToRemove;
DeleteOption deleteOption;
DeleteOption deleteOption {};
};
explicit SessionImpl(QObject *parent = nullptr);

6
src/base/bittorrent/torrentcreatorthread.h

@ -46,14 +46,14 @@ namespace BitTorrent @@ -46,14 +46,14 @@ namespace BitTorrent
struct TorrentCreatorParams
{
bool isPrivate;
bool isPrivate = false;
#ifdef QBT_USES_LIBTORRENT2
TorrentFormat torrentFormat;
TorrentFormat torrentFormat = TorrentFormat::Hybrid;
#else
bool isAlignmentOptimized;
int paddedFileSizeLimit;
#endif
int pieceSize;
int pieceSize = 0;
Path inputPath;
Path savePath;
QString comment;

2
src/base/bittorrent/torrentimpl.h

@ -84,7 +84,7 @@ namespace BitTorrent @@ -84,7 +84,7 @@ namespace BitTorrent
struct FileErrorInfo
{
lt::error_code error;
lt::operation_t operation;
lt::operation_t operation = lt::operation_t::unknown;
};
class TorrentImpl final : public Torrent

4
src/base/http/requestparser.h

@ -47,9 +47,9 @@ namespace Http @@ -47,9 +47,9 @@ namespace Http
struct ParseResult
{
// when `status != ParseStatus::OK`, `request` & `frameSize` are undefined
ParseStatus status;
ParseStatus status = ParseStatus::BadRequest;
Request request;
long frameSize; // http request frame size (bytes)
long frameSize = 0; // http request frame size (bytes)
};
static ParseResult parse(const QByteArray &data);

4
src/base/http/types.h

@ -79,10 +79,10 @@ namespace Http @@ -79,10 +79,10 @@ namespace Http
struct Environment
{
QHostAddress localAddress;
quint16 localPort;
quint16 localPort = 0;
QHostAddress clientAddress;
quint16 clientPort;
quint16 clientPort = 0;
};
struct UploadedFile

12
src/base/logger.h

@ -51,17 +51,17 @@ namespace Log @@ -51,17 +51,17 @@ namespace Log
struct Msg
{
int id;
MsgType type;
qint64 timestamp;
int id = -1;
MsgType type = ALL;
qint64 timestamp = -1;
QString message;
};
struct Peer
{
int id;
bool blocked;
qint64 timestamp;
int id = -1;
bool blocked = false;
qint64 timestamp = -1;
QString ip;
QString reason;
};

2
src/base/net/dnsupdater.cpp

@ -44,8 +44,6 @@ const std::chrono::seconds IP_CHECK_INTERVAL = 30min; @@ -44,8 +44,6 @@ const std::chrono::seconds IP_CHECK_INTERVAL = 30min;
DNSUpdater::DNSUpdater(QObject *parent)
: QObject(parent)
, m_state(OK)
, m_service(DNS::Service::None)
{
updateCredentials();

4
src/base/net/dnsupdater.h

@ -74,9 +74,9 @@ namespace Net @@ -74,9 +74,9 @@ namespace Net
QHostAddress m_lastIP;
QDateTime m_lastIPCheckTime;
QTimer m_ipCheckTimer;
int m_state;
int m_state = OK;
// Service creds
DNS::Service m_service;
DNS::Service m_service = DNS::Service::None;
QString m_domain;
QString m_username;
QString m_password;

2
src/base/net/downloadmanager.h

@ -103,7 +103,7 @@ namespace Net @@ -103,7 +103,7 @@ namespace Net
struct DownloadResult
{
QString url;
DownloadStatus status;
DownloadStatus status = DownloadStatus::Failed;
QString errorString;
QByteArray data;
Path filePath;

6
src/base/search/searchhandler.h

@ -42,9 +42,9 @@ struct SearchResult @@ -42,9 +42,9 @@ struct SearchResult
{
QString fileName;
QString fileUrl;
qlonglong fileSize;
qlonglong nbSeeders;
qlonglong nbLeechers;
qlonglong fileSize = 0;
qlonglong nbSeeders = 0;
qlonglong nbLeechers = 0;
QString siteUrl;
QString descrLink;
};

2
src/base/search/searchpluginmanager.h

@ -52,7 +52,7 @@ struct PluginInfo @@ -52,7 +52,7 @@ struct PluginInfo
QString url;
QStringList supportedCategories;
Path iconPath;
bool enabled;
bool enabled = false;
};
class SearchDownloadHandler;

2
src/gui/properties/speedplotview.h

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

7
src/gui/search/searchsortmodel.cpp

@ -32,13 +32,6 @@ @@ -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);

8
src/gui/search/searchsortmodel.h

@ -90,12 +90,12 @@ protected: @@ -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;
};

2
src/gui/torrenttagsdialog.h

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

2
src/gui/transferlistfilters/categoryfiltermodel.h

@ -72,6 +72,6 @@ private: @@ -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;
};

2
src/gui/tristatewidget.cpp

@ -38,8 +38,6 @@ @@ -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

4
src/gui/tristatewidget.h

@ -55,7 +55,7 @@ private: @@ -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;
};

2
src/gui/uithemedialog.h

@ -60,7 +60,7 @@ private: @@ -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;

16
src/webui/webapplication.h

@ -222,21 +222,21 @@ private: @@ -222,21 +222,21 @@ private:
bool m_translationFileLoaded = false;
AuthController *m_authController = nullptr;
bool m_isLocalAuthEnabled;
bool m_isAuthSubnetWhitelistEnabled;
bool m_isLocalAuthEnabled = false;
bool m_isAuthSubnetWhitelistEnabled = false;
QVector<Utils::Net::Subnet> m_authSubnetWhitelist;
int m_sessionTimeout;
int m_sessionTimeout = 0;
QString m_sessionCookieName;
// security related
QStringList m_domainList;
bool m_isCSRFProtectionEnabled;
bool m_isSecureCookieEnabled;
bool m_isHostHeaderValidationEnabled;
bool m_isHttpsEnabled;
bool m_isCSRFProtectionEnabled = true;
bool m_isSecureCookieEnabled = true;
bool m_isHostHeaderValidationEnabled = true;
bool m_isHttpsEnabled = false;
// Reverse proxy
bool m_isReverseProxySupportEnabled;
bool m_isReverseProxySupportEnabled = false;
QVector<Utils::Net::Subnet> m_trustedReverseProxyList;
QHostAddress m_clientAddress;

Loading…
Cancel
Save