Browse Source

Use default constructor, destructor

adaptive-webui-19844
Chocobo1 2 years ago
parent
commit
8219b1f695
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 2
      src/base/bittorrent/torrentimpl.cpp
  2. 6
      src/base/bittorrent/torrentinfo.cpp
  3. 2
      src/base/bittorrent/torrentinfo.h
  4. 2
      src/base/http/irequesthandler.h
  5. 4
      src/base/http/requestparser.cpp
  6. 2
      src/base/http/requestparser.h
  7. 2
      src/base/iconprovider.cpp
  8. 2
      src/base/iconprovider.h
  9. 7
      src/base/rss/rss_autodownloadrule.cpp
  10. 4
      src/base/rss/rss_autodownloadrule.h
  11. 2
      src/base/rss/rss_folder.h
  12. 2
      src/base/rss/rss_item.cpp
  13. 2
      src/base/rss/rss_item.h
  14. 4
      src/gui/powermanagement/powermanagement.cpp
  15. 2
      src/gui/powermanagement/powermanagement.h
  16. 4
      src/gui/powermanagement/powermanagement_x11.cpp
  17. 2
      src/gui/powermanagement/powermanagement_x11.h
  18. 4
      src/gui/rss/htmlbrowser.cpp
  19. 2
      src/gui/rss/htmlbrowser.h
  20. 4
      src/gui/transferlistfilters/categoryfiltermodel.cpp

2
src/base/bittorrent/torrentimpl.cpp

@ -338,7 +338,7 @@ TorrentImpl::TorrentImpl(SessionImpl *session, lt::session *nativeSession
// == END UPGRADE CODE == // == END UPGRADE CODE ==
} }
TorrentImpl::~TorrentImpl() {} TorrentImpl::~TorrentImpl() = default;
bool TorrentImpl::isValid() const bool TorrentImpl::isValid() const
{ {

6
src/base/bittorrent/torrentinfo.cpp

@ -66,12 +66,6 @@ TorrentInfo::TorrentInfo(const lt::torrent_info &nativeInfo)
} }
} }
TorrentInfo::TorrentInfo(const TorrentInfo &other)
: m_nativeInfo {other.m_nativeInfo}
, m_nativeIndexes {other.m_nativeIndexes}
{
}
TorrentInfo &TorrentInfo::operator=(const TorrentInfo &other) TorrentInfo &TorrentInfo::operator=(const TorrentInfo &other)
{ {
if (this != &other) if (this != &other)

2
src/base/bittorrent/torrentinfo.h

@ -54,7 +54,7 @@ namespace BitTorrent
public: public:
TorrentInfo() = default; TorrentInfo() = default;
TorrentInfo(const TorrentInfo &other); TorrentInfo(const TorrentInfo &other) = default;
explicit TorrentInfo(const lt::torrent_info &nativeInfo); explicit TorrentInfo(const lt::torrent_info &nativeInfo);

2
src/base/http/irequesthandler.h

@ -37,7 +37,7 @@ namespace Http
class IRequestHandler class IRequestHandler
{ {
public: public:
virtual ~IRequestHandler() {} virtual ~IRequestHandler() = default;
virtual Response processRequest(const Request &request, const Environment &env) = 0; virtual Response processRequest(const Request &request, const Environment &env) = 0;
}; };
} }

4
src/base/http/requestparser.cpp

@ -75,10 +75,6 @@ namespace
} }
} }
RequestParser::RequestParser()
{
}
RequestParser::ParseResult RequestParser::parse(const QByteArray &data) RequestParser::ParseResult RequestParser::parse(const QByteArray &data)
{ {
// Warning! Header names are converted to lowercase // Warning! Header names are converted to lowercase

2
src/base/http/requestparser.h

@ -57,7 +57,7 @@ namespace Http
static const long MAX_CONTENT_SIZE = 64 * 1024 * 1024; // 64 MB static const long MAX_CONTENT_SIZE = 64 * 1024 * 1024; // 64 MB
private: private:
RequestParser(); RequestParser() = default;
ParseResult doParse(const QByteArray &data); ParseResult doParse(const QByteArray &data);
bool parseStartLines(QStringView data); bool parseStartLines(QStringView data);

2
src/base/iconprovider.cpp

@ -36,8 +36,6 @@ IconProvider::IconProvider(QObject *parent)
{ {
} }
IconProvider::~IconProvider() {}
void IconProvider::initInstance() void IconProvider::initInstance()
{ {
if (!m_instance) if (!m_instance)

2
src/base/iconprovider.h

@ -48,7 +48,7 @@ public:
protected: protected:
explicit IconProvider(QObject *parent = nullptr); explicit IconProvider(QObject *parent = nullptr);
~IconProvider(); ~IconProvider() = default;
static IconProvider *m_instance; static IconProvider *m_instance;
}; };

7
src/base/rss/rss_autodownloadrule.cpp

@ -208,12 +208,9 @@ AutoDownloadRule::AutoDownloadRule(const QString &name)
setName(name); setName(name);
} }
AutoDownloadRule::AutoDownloadRule(const AutoDownloadRule &other) AutoDownloadRule::AutoDownloadRule(const AutoDownloadRule &other) = default;
: m_dataPtr(other.m_dataPtr)
{
}
AutoDownloadRule::~AutoDownloadRule() {} AutoDownloadRule::~AutoDownloadRule() = default;
QRegularExpression AutoDownloadRule::cachedRegex(const QString &expression, const bool isRegex) const QRegularExpression AutoDownloadRule::cachedRegex(const QString &expression, const bool isRegex) const
{ {

4
src/base/rss/rss_autodownloadrule.h

@ -49,7 +49,7 @@ namespace RSS
class AutoDownloadRule class AutoDownloadRule
{ {
public: public:
explicit AutoDownloadRule(const QString &name = u""_qs); explicit AutoDownloadRule(const QString &name = {});
AutoDownloadRule(const AutoDownloadRule &other); AutoDownloadRule(const AutoDownloadRule &other);
~AutoDownloadRule(); ~AutoDownloadRule();
@ -96,7 +96,7 @@ namespace RSS
friend bool operator==(const AutoDownloadRule &left, const AutoDownloadRule &right); friend bool operator==(const AutoDownloadRule &left, const AutoDownloadRule &right);
QJsonObject toJsonObject() const; QJsonObject toJsonObject() const;
static AutoDownloadRule fromJsonObject(const QJsonObject &jsonObj, const QString &name = u""_qs); static AutoDownloadRule fromJsonObject(const QJsonObject &jsonObj, const QString &name = {});
QVariantHash toLegacyDict() const; QVariantHash toLegacyDict() const;
static AutoDownloadRule fromLegacyDict(const QVariantHash &dict); static AutoDownloadRule fromLegacyDict(const QVariantHash &dict);

2
src/base/rss/rss_folder.h

@ -46,7 +46,7 @@ namespace RSS
friend class Session; friend class Session;
explicit Folder(const QString &path = u""_qs); explicit Folder(const QString &path = {});
~Folder() override; ~Folder() override;
public: public:

2
src/base/rss/rss_item.cpp

@ -45,8 +45,6 @@ Item::Item(const QString &path)
{ {
} }
Item::~Item() {}
void Item::setPath(const QString &path) void Item::setPath(const QString &path)
{ {
if (path != m_path) if (path != m_path)

2
src/base/rss/rss_item.h

@ -76,7 +76,7 @@ namespace RSS
protected: protected:
explicit Item(const QString &path); explicit Item(const QString &path);
~Item() override; ~Item() override = default;
virtual void cleanup() = 0; virtual void cleanup() = 0;

4
src/gui/powermanagement/powermanagement.cpp

@ -50,10 +50,6 @@ PowerManagement::PowerManagement(QObject *parent)
#endif #endif
} }
PowerManagement::~PowerManagement()
{
}
void PowerManagement::setActivityState(const bool busy) void PowerManagement::setActivityState(const bool busy)
{ {
if (busy) if (busy)

2
src/gui/powermanagement/powermanagement.h

@ -47,7 +47,7 @@ class PowerManagement : public QObject
public: public:
PowerManagement(QObject *parent = nullptr); PowerManagement(QObject *parent = nullptr);
virtual ~PowerManagement(); virtual ~PowerManagement() = default;
void setActivityState(bool busy); void setActivityState(bool busy);

4
src/gui/powermanagement/powermanagement_x11.cpp

@ -51,10 +51,6 @@ PowerManagementInhibitor::PowerManagementInhibitor(QObject *parent)
m_useGSM = false; m_useGSM = false;
} }
PowerManagementInhibitor::~PowerManagementInhibitor()
{
}
void PowerManagementInhibitor::requestIdle() void PowerManagementInhibitor::requestIdle()
{ {
m_intendedState = Idle; m_intendedState = Idle;

2
src/gui/powermanagement/powermanagement_x11.h

@ -39,7 +39,7 @@ class PowerManagementInhibitor : public QObject
public: public:
PowerManagementInhibitor(QObject *parent = nullptr); PowerManagementInhibitor(QObject *parent = nullptr);
virtual ~PowerManagementInhibitor(); virtual ~PowerManagementInhibitor() = default;
void requestIdle(); void requestIdle();
void requestBusy(); void requestBusy();

4
src/gui/rss/htmlbrowser.cpp

@ -54,10 +54,6 @@ HtmlBrowser::HtmlBrowser(QWidget *parent)
connect(m_netManager, &QNetworkAccessManager::finished, this, &HtmlBrowser::resourceLoaded); connect(m_netManager, &QNetworkAccessManager::finished, this, &HtmlBrowser::resourceLoaded);
} }
HtmlBrowser::~HtmlBrowser()
{
}
QVariant HtmlBrowser::loadResource(int type, const QUrl &name) QVariant HtmlBrowser::loadResource(int type, const QUrl &name)
{ {
if (type == QTextDocument::ImageResource) if (type == QTextDocument::ImageResource)

2
src/gui/rss/htmlbrowser.h

@ -42,7 +42,7 @@ class HtmlBrowser final : public QTextBrowser
public: public:
explicit HtmlBrowser(QWidget* parent = nullptr); explicit HtmlBrowser(QWidget* parent = nullptr);
~HtmlBrowser(); ~HtmlBrowser() = default;
QVariant loadResource(int type, const QUrl &name) override; QVariant loadResource(int type, const QUrl &name) override;

4
src/gui/transferlistfilters/categoryfiltermodel.cpp

@ -38,9 +38,7 @@
class CategoryModelItem class CategoryModelItem
{ {
public: public:
CategoryModelItem() CategoryModelItem() = default;
{
}
CategoryModelItem(CategoryModelItem *parent, QString categoryName, int torrentsCount = 0) CategoryModelItem(CategoryModelItem *parent, QString categoryName, int torrentsCount = 0)
: m_parent(nullptr) : m_parent(nullptr)

Loading…
Cancel
Save