Browse Source

Merge pull request #10024 from Chocobo1/explicit

Mark constructors as explicit
adaptive-webui-19844
Mike Tzou 6 years ago committed by GitHub
parent
commit
4e8ab08425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 40
      src/app/cmdoptions.cpp
  2. 4
      src/app/cmdoptions.h
  3. 41
      src/base/bittorrent/infohash.cpp
  4. 6
      src/base/bittorrent/infohash.h
  5. 2
      src/base/bittorrent/private/statistics.h
  6. 38
      src/base/bittorrent/session.cpp
  7. 2
      src/base/bittorrent/torrenthandle.h
  8. 27
      src/base/bittorrent/trackerentry.cpp
  9. 9
      src/base/bittorrent/trackerentry.h
  10. 2
      src/base/net/private/geoipdatabase.h
  11. 6
      src/base/private/profile_p.h
  12. 2
      src/base/rss/rss_feed.cpp
  13. 2
      src/base/settingsstorage.cpp
  14. 4
      src/base/torrentfileguard.h
  15. 2
      src/gui/properties/proplistdelegate.h
  16. 2
      src/gui/properties/speedwidget.h
  17. 2
      src/gui/properties/trackerlistwidget.h
  18. 2
      src/gui/properties/trackersadditiondialog.cpp
  19. 2
      src/gui/torrentcontentmodelfolder.h
  20. 2
      src/gui/torrentcontentmodelitem.h

40
src/app/cmdoptions.cpp

@ -55,7 +55,7 @@ namespace
class Option class Option
{ {
protected: protected:
constexpr Option(const char *name, char shortcut = 0) explicit constexpr Option(const char *name, char shortcut = 0)
: m_name {name} : m_name {name}
, m_shortcut {shortcut} , m_shortcut {shortcut}
{ {
@ -102,7 +102,7 @@ namespace
class BoolOption : protected Option class BoolOption : protected Option
{ {
public: public:
constexpr BoolOption(const char *name, char shortcut = 0) explicit constexpr BoolOption(const char *name, char shortcut = 0)
: Option {name, shortcut} : Option {name, shortcut}
{ {
} }
@ -139,7 +139,7 @@ namespace
struct StringOption : protected Option struct StringOption : protected Option
{ {
public: public:
constexpr StringOption(const char *name) explicit constexpr StringOption(const char *name)
: Option {name, 0} : Option {name, 0}
{ {
} }
@ -186,7 +186,7 @@ namespace
class IntOption : protected StringOption class IntOption : protected StringOption
{ {
public: public:
constexpr IntOption(const char *name) explicit constexpr IntOption(const char *name)
: StringOption {name} : StringOption {name}
{ {
} }
@ -305,25 +305,25 @@ namespace
return o == s; return o == s;
} }
constexpr const BoolOption SHOW_HELP_OPTION = {"help", 'h'}; constexpr const BoolOption SHOW_HELP_OPTION {"help", 'h'};
constexpr const BoolOption SHOW_VERSION_OPTION = {"version", 'v'}; constexpr const BoolOption SHOW_VERSION_OPTION {"version", 'v'};
#ifdef DISABLE_GUI #ifdef DISABLE_GUI
constexpr const BoolOption DAEMON_OPTION = {"daemon", 'd'}; constexpr const BoolOption DAEMON_OPTION {"daemon", 'd'};
#else #else
constexpr const BoolOption NO_SPLASH_OPTION = {"no-splash"}; constexpr const BoolOption NO_SPLASH_OPTION {"no-splash"};
#endif #endif
constexpr const IntOption WEBUI_PORT_OPTION = {"webui-port"}; constexpr const IntOption WEBUI_PORT_OPTION {"webui-port"};
constexpr const StringOption PROFILE_OPTION = {"profile"}; constexpr const StringOption PROFILE_OPTION {"profile"};
constexpr const StringOption CONFIGURATION_OPTION = {"configuration"}; constexpr const StringOption CONFIGURATION_OPTION {"configuration"};
constexpr const BoolOption PORTABLE_OPTION = {"portable"}; constexpr const BoolOption PORTABLE_OPTION {"portable"};
constexpr const BoolOption RELATIVE_FASTRESUME = {"relative-fastresume"}; constexpr const BoolOption RELATIVE_FASTRESUME {"relative-fastresume"};
constexpr const StringOption SAVE_PATH_OPTION = {"save-path"}; constexpr const StringOption SAVE_PATH_OPTION {"save-path"};
constexpr const TriStateBoolOption PAUSED_OPTION = {"add-paused", true}; constexpr const TriStateBoolOption PAUSED_OPTION {"add-paused", true};
constexpr const BoolOption SKIP_HASH_CHECK_OPTION = {"skip-hash-check"}; constexpr const BoolOption SKIP_HASH_CHECK_OPTION {"skip-hash-check"};
constexpr const StringOption CATEGORY_OPTION = {"category"}; constexpr const StringOption CATEGORY_OPTION {"category"};
constexpr const BoolOption SEQUENTIAL_OPTION = {"sequential"}; constexpr const BoolOption SEQUENTIAL_OPTION {"sequential"};
constexpr const BoolOption FIRST_AND_LAST_OPTION = {"first-and-last"}; constexpr const BoolOption FIRST_AND_LAST_OPTION {"first-and-last"};
constexpr const TriStateBoolOption SKIP_DIALOG_OPTION = {"skip-dialog", true}; constexpr const TriStateBoolOption SKIP_DIALOG_OPTION {"skip-dialog", true};
} }
QBtCommandLineParameters::QBtCommandLineParameters(const QProcessEnvironment &env) QBtCommandLineParameters::QBtCommandLineParameters(const QProcessEnvironment &env)

4
src/app/cmdoptions.h

@ -56,14 +56,14 @@ struct QBtCommandLineParameters
QStringList torrents; QStringList torrents;
QString profileDir, configurationName, savePath, category, unknownParameter; QString profileDir, configurationName, savePath, category, unknownParameter;
QBtCommandLineParameters(const QProcessEnvironment&); explicit QBtCommandLineParameters(const QProcessEnvironment&);
QStringList paramList() const; QStringList paramList() const;
}; };
class CommandLineParameterError : public std::runtime_error class CommandLineParameterError : public std::runtime_error
{ {
public: public:
CommandLineParameterError(const QString &messageForUser); explicit CommandLineParameterError(const QString &messageForUser);
const QString &messageForUser() const; const QString &messageForUser() const;
private: private:

41
src/base/bittorrent/infohash.cpp

@ -28,6 +28,7 @@
#include "infohash.h" #include "infohash.h"
#include <QByteArray>
#include <QHash> #include <QHash>
using namespace BitTorrent; using namespace BitTorrent;
@ -41,29 +42,25 @@ InfoHash::InfoHash(const libtorrent::sha1_hash &nativeHash)
: m_valid(true) : m_valid(true)
, m_nativeHash(nativeHash) , m_nativeHash(nativeHash)
{ {
char out[(libtorrent::sha1_hash::size * 2) + 1]; const QByteArray raw = QByteArray::fromRawData(nativeHash.data(), libtorrent::sha1_hash::size);
libtorrent::to_hex(reinterpret_cast<const char*>(&m_nativeHash[0]), libtorrent::sha1_hash::size, out); m_hashString = QString::fromLatin1(raw.toHex());
m_hashString = QString(out);
} }
InfoHash::InfoHash(const QString &hashString) InfoHash::InfoHash(const QString &hashString)
: m_valid(false) : m_valid(false)
, m_hashString(hashString)
{ {
QByteArray raw = m_hashString.toLatin1(); if (hashString.size() != (libtorrent::sha1_hash::size * 2))
if (raw.size() == 40) return;
m_valid = libtorrent::from_hex(raw.constData(), 40, reinterpret_cast<char*>(&m_nativeHash[0]));
}
const QByteArray raw = QByteArray::fromHex(hashString.toLatin1());
if (raw.size() != libtorrent::sha1_hash::size) // QByteArray::fromHex() will skip over invalid characters
return;
InfoHash::InfoHash(const InfoHash &other) m_valid = true;
: m_valid(other.m_valid) m_hashString = hashString;
, m_nativeHash(other.m_nativeHash) m_nativeHash.assign(raw.constData());
, m_hashString(other.m_hashString)
{
} }
bool InfoHash::isValid() const bool InfoHash::isValid() const
{ {
return m_valid; return m_valid;
@ -74,25 +71,23 @@ InfoHash::operator libtorrent::sha1_hash() const
return m_nativeHash; return m_nativeHash;
} }
InfoHash::operator QString() const InfoHash::operator QString() const
{ {
return m_hashString; return m_hashString;
} }
bool BitTorrent::operator==(const InfoHash &left, const InfoHash &right)
bool InfoHash::operator==(const InfoHash &other) const
{ {
return (m_nativeHash == other.m_nativeHash); return (static_cast<libtorrent::sha1_hash>(left)
== static_cast<libtorrent::sha1_hash>(right));
} }
bool BitTorrent::operator!=(const InfoHash &left, const InfoHash &right)
bool InfoHash::operator!=(const InfoHash &other) const
{ {
return (m_nativeHash != other.m_nativeHash); return !(left == right);
} }
uint BitTorrent::qHash(const InfoHash &key, uint seed) uint BitTorrent::qHash(const InfoHash &key, const uint seed)
{ {
return qHash(static_cast<QString>(key), seed); return ::qHash(static_cast<QString>(key), seed);
} }

6
src/base/bittorrent/infohash.h

@ -40,14 +40,12 @@ namespace BitTorrent
InfoHash(); InfoHash();
InfoHash(const libtorrent::sha1_hash &nativeHash); InfoHash(const libtorrent::sha1_hash &nativeHash);
InfoHash(const QString &hashString); InfoHash(const QString &hashString);
InfoHash(const InfoHash &other); InfoHash(const InfoHash &other) = default;
bool isValid() const; bool isValid() const;
operator libtorrent::sha1_hash() const; operator libtorrent::sha1_hash() const;
operator QString() const; operator QString() const;
bool operator==(const InfoHash &other) const;
bool operator!=(const InfoHash &other) const;
private: private:
bool m_valid; bool m_valid;
@ -55,6 +53,8 @@ namespace BitTorrent
QString m_hashString; QString m_hashString;
}; };
bool operator==(const InfoHash &left, const InfoHash &right);
bool operator!=(const InfoHash &left, const InfoHash &right);
uint qHash(const InfoHash &key, uint seed); uint qHash(const InfoHash &key, uint seed);
} }

2
src/base/bittorrent/private/statistics.h

@ -15,7 +15,7 @@ class Statistics : public QObject
Q_DISABLE_COPY(Statistics) Q_DISABLE_COPY(Statistics)
public: public:
Statistics(BitTorrent::Session *session); explicit Statistics(BitTorrent::Session *session);
~Statistics(); ~Statistics();
quint64 getAlltimeDL() const; quint64 getAlltimeDL() const;

38
src/base/bittorrent/session.cpp

@ -1847,14 +1847,15 @@ void Session::handleDownloadFailed(const QString &url, const QString &reason)
void Session::handleRedirectedToMagnet(const QString &url, const QString &magnetUri) void Session::handleRedirectedToMagnet(const QString &url, const QString &magnetUri)
{ {
addTorrent_impl(m_downloadedTorrents.take(url), MagnetUri(magnetUri)); addTorrent_impl(CreateTorrentParams(m_downloadedTorrents.take(url)), MagnetUri(magnetUri));
} }
// Add to BitTorrent session the downloaded torrent file // Add to BitTorrent session the downloaded torrent file
void Session::handleDownloadFinished(const QString &url, const QByteArray &data) void Session::handleDownloadFinished(const QString &url, const QByteArray &data)
{ {
emit downloadFromUrlFinished(url); emit downloadFromUrlFinished(url);
addTorrent_impl(m_downloadedTorrents.take(url), MagnetUri(), TorrentInfo::load(data)); addTorrent_impl(CreateTorrentParams(m_downloadedTorrents.take(url))
, MagnetUri(), TorrentInfo::load(data));
} }
// Return the torrent handle, given its hash // Return the torrent handle, given its hash
@ -2094,7 +2095,7 @@ bool Session::addTorrent(QString source, const AddTorrentParams &params)
{ {
MagnetUri magnetUri(source); MagnetUri magnetUri(source);
if (magnetUri.isValid()) if (magnetUri.isValid())
return addTorrent_impl(params, magnetUri); return addTorrent_impl(CreateTorrentParams(params), magnetUri);
if (Utils::Misc::isUrl(source)) { if (Utils::Misc::isUrl(source)) {
LogMsg(tr("Downloading '%1', please wait...", "e.g: Downloading 'xxx.torrent', please wait...").arg(source)); LogMsg(tr("Downloading '%1', please wait...", "e.g: Downloading 'xxx.torrent', please wait...").arg(source));
@ -2110,7 +2111,8 @@ bool Session::addTorrent(QString source, const AddTorrentParams &params)
} }
TorrentFileGuard guard(source); TorrentFileGuard guard(source);
if (addTorrent_impl(params, MagnetUri(), TorrentInfo::loadFromFile(source))) { if (addTorrent_impl(CreateTorrentParams(params)
, MagnetUri(), TorrentInfo::loadFromFile(source))) {
guard.markAsAddedToSession(); guard.markAsAddedToSession();
return true; return true;
} }
@ -2122,7 +2124,7 @@ bool Session::addTorrent(const TorrentInfo &torrentInfo, const AddTorrentParams
{ {
if (!torrentInfo.isValid()) return false; if (!torrentInfo.isValid()) return false;
return addTorrent_impl(params, MagnetUri(), torrentInfo); return addTorrent_impl(CreateTorrentParams(params), MagnetUri(), torrentInfo);
} }
// Add a torrent to the BitTorrent session // Add a torrent to the BitTorrent session
@ -4280,23 +4282,27 @@ void Session::handleAddTorrentAlert(libt::add_torrent_alert *p)
void Session::handleTorrentRemovedAlert(libt::torrent_removed_alert *p) void Session::handleTorrentRemovedAlert(libt::torrent_removed_alert *p)
{ {
if (m_loadedMetadata.contains(p->info_hash)) const InfoHash infoHash {p->info_hash};
emit metadataLoaded(m_loadedMetadata.take(p->info_hash));
if (m_removingTorrents.contains(p->info_hash)) { if (m_loadedMetadata.contains(infoHash))
const RemovingTorrentData tmpRemovingTorrentData = m_removingTorrents[p->info_hash]; emit metadataLoaded(m_loadedMetadata.take(infoHash));
if (m_removingTorrents.contains(infoHash)) {
const RemovingTorrentData tmpRemovingTorrentData = m_removingTorrents[infoHash];
if (!tmpRemovingTorrentData.requestedFileDeletion) { if (!tmpRemovingTorrentData.requestedFileDeletion) {
LogMsg(tr("'%1' was removed from the transfer list.", "'xxx.avi' was removed...").arg(tmpRemovingTorrentData.name)); LogMsg(tr("'%1' was removed from the transfer list.", "'xxx.avi' was removed...").arg(tmpRemovingTorrentData.name));
m_removingTorrents.remove(p->info_hash); m_removingTorrents.remove(infoHash);
} }
} }
} }
void Session::handleTorrentDeletedAlert(libt::torrent_deleted_alert *p) void Session::handleTorrentDeletedAlert(libt::torrent_deleted_alert *p)
{ {
if (!m_removingTorrents.contains(p->info_hash)) const InfoHash infoHash {p->info_hash};
if (!m_removingTorrents.contains(infoHash))
return; return;
const RemovingTorrentData tmpRemovingTorrentData = m_removingTorrents.take(p->info_hash); const RemovingTorrentData tmpRemovingTorrentData = m_removingTorrents.take(infoHash);
Utils::Fs::smartRemoveEmptyFolderTree(tmpRemovingTorrentData.savePathToRemove); Utils::Fs::smartRemoveEmptyFolderTree(tmpRemovingTorrentData.savePathToRemove);
LogMsg(tr("'%1' was removed from the transfer list and hard disk.", "'xxx.avi' was removed...").arg(tmpRemovingTorrentData.name)); LogMsg(tr("'%1' was removed from the transfer list and hard disk.", "'xxx.avi' was removed...").arg(tmpRemovingTorrentData.name));
@ -4304,9 +4310,11 @@ void Session::handleTorrentDeletedAlert(libt::torrent_deleted_alert *p)
void Session::handleTorrentDeleteFailedAlert(libt::torrent_delete_failed_alert *p) void Session::handleTorrentDeleteFailedAlert(libt::torrent_delete_failed_alert *p)
{ {
if (!m_removingTorrents.contains(p->info_hash)) const InfoHash infoHash {p->info_hash};
if (!m_removingTorrents.contains(infoHash))
return; return;
const RemovingTorrentData tmpRemovingTorrentData = m_removingTorrents.take(p->info_hash); const RemovingTorrentData tmpRemovingTorrentData = m_removingTorrents.take(infoHash);
// libtorrent won't delete the directory if it contains files not listed in the torrent, // libtorrent won't delete the directory if it contains files not listed in the torrent,
// so we remove the directory ourselves // so we remove the directory ourselves
Utils::Fs::smartRemoveEmptyFolderTree(tmpRemovingTorrentData.savePathToRemove); Utils::Fs::smartRemoveEmptyFolderTree(tmpRemovingTorrentData.savePathToRemove);
@ -4318,7 +4326,7 @@ void Session::handleTorrentDeleteFailedAlert(libt::torrent_delete_failed_alert *
void Session::handleMetadataReceivedAlert(libt::metadata_received_alert *p) void Session::handleMetadataReceivedAlert(libt::metadata_received_alert *p)
{ {
InfoHash hash = p->handle.info_hash(); const InfoHash hash {p->handle.info_hash()};
if (m_loadedMetadata.contains(hash)) { if (m_loadedMetadata.contains(hash)) {
--m_extraLimit; --m_extraLimit;

2
src/base/bittorrent/torrenthandle.h

@ -113,7 +113,7 @@ namespace BitTorrent
int seedingTimeLimit; int seedingTimeLimit;
CreateTorrentParams(); CreateTorrentParams();
CreateTorrentParams(const AddTorrentParams &params); explicit CreateTorrentParams(const AddTorrentParams &params);
}; };
struct TrackerInfo struct TrackerInfo

27
src/base/bittorrent/trackerentry.cpp

@ -29,14 +29,12 @@
#include "trackerentry.h" #include "trackerentry.h"
#include <QString> #include <QString>
#include <QUrl>
#include "base/utils/misc.h"
#include "base/utils/string.h"
using namespace BitTorrent; using namespace BitTorrent;
TrackerEntry::TrackerEntry(const QString &url) TrackerEntry::TrackerEntry(const QString &url)
: m_nativeEntry(libtorrent::announce_entry(url.toStdString())) : m_nativeEntry(url.toStdString())
{ {
} }
@ -45,11 +43,6 @@ TrackerEntry::TrackerEntry(const libtorrent::announce_entry &nativeEntry)
{ {
} }
TrackerEntry::TrackerEntry(const TrackerEntry &other)
: m_nativeEntry(other.m_nativeEntry)
{
}
QString TrackerEntry::url() const QString TrackerEntry::url() const
{ {
return QString::fromStdString(m_nativeEntry.url); return QString::fromStdString(m_nativeEntry.url);
@ -74,23 +67,17 @@ TrackerEntry::Status TrackerEntry::status() const
return NotWorking; return NotWorking;
} }
void TrackerEntry::setTier(int value) void TrackerEntry::setTier(const int value)
{ {
m_nativeEntry.tier = value; m_nativeEntry.tier = value;
} }
TrackerEntry &TrackerEntry::operator=(const TrackerEntry &other) libtorrent::announce_entry TrackerEntry::nativeEntry() const
{
this->m_nativeEntry = other.m_nativeEntry;
return *this;
}
bool TrackerEntry::operator==(const TrackerEntry &other) const
{ {
return (QUrl(url()) == QUrl(other.url())); return m_nativeEntry;
} }
libtorrent::announce_entry TrackerEntry::nativeEntry() const bool BitTorrent::operator==(const TrackerEntry &left, const TrackerEntry &right)
{ {
return m_nativeEntry; return (QUrl(left.url()) == QUrl(right.url()));
} }

9
src/base/bittorrent/trackerentry.h

@ -52,21 +52,22 @@ namespace BitTorrent
TrackerEntry(const QString &url); TrackerEntry(const QString &url);
TrackerEntry(const libtorrent::announce_entry &nativeEntry); TrackerEntry(const libtorrent::announce_entry &nativeEntry);
TrackerEntry(const TrackerEntry &other); TrackerEntry(const TrackerEntry &other) = default;
TrackerEntry &operator=(const TrackerEntry &other) = default;
QString url() const; QString url() const;
int tier() const;
Status status() const; Status status() const;
int tier() const;
void setTier(int value); void setTier(int value);
TrackerEntry &operator=(const TrackerEntry &other);
bool operator==(const TrackerEntry &other) const;
libtorrent::announce_entry nativeEntry() const; libtorrent::announce_entry nativeEntry() const;
private: private:
libtorrent::announce_entry m_nativeEntry; libtorrent::announce_entry m_nativeEntry;
}; };
bool operator==(const TrackerEntry &left, const TrackerEntry &right);
} }
#endif // BITTORRENT_TRACKERENTRY_H #endif // BITTORRENT_TRACKERENTRY_H

2
src/base/net/private/geoipdatabase.h

@ -55,7 +55,7 @@ public:
QString lookup(const QHostAddress &hostAddr) const; QString lookup(const QHostAddress &hostAddr) const;
private: private:
GeoIPDatabase(quint32 size); explicit GeoIPDatabase(quint32 size);
bool parseMetadata(const QVariantHash &metadata, QString &error); bool parseMetadata(const QVariantHash &metadata, QString &error);
bool loadDB(QString &error) const; bool loadDB(QString &error) const;

6
src/base/private/profile_p.h

@ -55,7 +55,7 @@ namespace Private
QString profileName() const; QString profileName() const;
protected: protected:
Profile(const QString &configurationName); explicit Profile(const QString &configurationName);
QString configurationSuffix() const; QString configurationSuffix() const;
private: private:
@ -66,7 +66,7 @@ namespace Private
class DefaultProfile : public Profile class DefaultProfile : public Profile
{ {
public: public:
DefaultProfile(const QString &configurationName); explicit DefaultProfile(const QString &configurationName);
QString baseDirectory() const override; QString baseDirectory() const override;
QString cacheLocation() const override; QString cacheLocation() const override;
@ -124,7 +124,7 @@ namespace Private
class Converter : public PathConverter class Converter : public PathConverter
{ {
public: public:
Converter(const QString &basePath); explicit Converter(const QString &basePath);
QString toPortablePath(const QString &path) const override; QString toPortablePath(const QString &path) const override;
QString fromPortablePath(const QString &portablePath) const override; QString fromPortablePath(const QString &portablePath) const override;

2
src/base/rss/rss_feed.cpp

@ -131,7 +131,7 @@ void Feed::refresh()
// NOTE: Should we allow manually refreshing for disabled session? // NOTE: Should we allow manually refreshing for disabled session?
Net::DownloadHandler *handler = Net::DownloadManager::instance()->download({m_url}); Net::DownloadHandler *handler = Net::DownloadManager::instance()->download(m_url);
connect(handler connect(handler
, static_cast<void (Net::DownloadHandler::*)(const QString &, const QByteArray &)>(&Net::DownloadHandler::downloadFinished) , static_cast<void (Net::DownloadHandler::*)(const QString &, const QByteArray &)>(&Net::DownloadHandler::downloadFinished)
, this, &Feed::handleDownloadFinished); , this, &Feed::handleDownloadFinished);

2
src/base/settingsstorage.cpp

@ -46,7 +46,7 @@ namespace
class TransactionalSettings class TransactionalSettings
{ {
public: public:
TransactionalSettings(const QString &name) explicit TransactionalSettings(const QString &name)
: m_name(name) : m_name(name)
{ {
} }

4
src/base/torrentfileguard.h

@ -38,7 +38,7 @@ template <typename T> class CachedSettingValue;
class FileGuard class FileGuard
{ {
public: public:
FileGuard(const QString &path = QString()); explicit FileGuard(const QString &path = QString());
~FileGuard(); ~FileGuard();
/// Cancels or re-enables deferred file deletion /// Cancels or re-enables deferred file deletion
@ -56,7 +56,7 @@ class TorrentFileGuard : private FileGuard
Q_GADGET Q_GADGET
public: public:
TorrentFileGuard(const QString &path = QString()); explicit TorrentFileGuard(const QString &path = QString());
~TorrentFileGuard(); ~TorrentFileGuard();
/// marks the torrent file as loaded (added) into the BitTorrent::Session /// marks the torrent file as loaded (added) into the BitTorrent::Session

2
src/gui/properties/proplistdelegate.h

@ -53,7 +53,7 @@ class PropListDelegate : public QItemDelegate
Q_OBJECT Q_OBJECT
public: public:
PropListDelegate(PropertiesWidget *properties); explicit PropListDelegate(PropertiesWidget *properties);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
void setEditorData(QWidget *editor, const QModelIndex &index) const override; void setEditorData(QWidget *editor, const QModelIndex &index) const override;

2
src/gui/properties/speedwidget.h

@ -59,7 +59,7 @@ class SpeedWidget : public QWidget
Q_OBJECT Q_OBJECT
public: public:
SpeedWidget(PropertiesWidget *parent); explicit SpeedWidget(PropertiesWidget *parent);
~SpeedWidget(); ~SpeedWidget();
private slots: private slots:

2
src/gui/properties/trackerlistwidget.h

@ -63,7 +63,7 @@ public:
COL_COUNT COL_COUNT
}; };
TrackerListWidget(PropertiesWidget *properties); explicit TrackerListWidget(PropertiesWidget *properties);
~TrackerListWidget(); ~TrackerListWidget();
int visibleColumnsCount() const; int visibleColumnsCount() const;

2
src/gui/properties/trackersadditiondialog.cpp

@ -71,7 +71,7 @@ QStringList TrackersAdditionDialog::newTrackers() const
void TrackersAdditionDialog::on_uTorrentListButton_clicked() void TrackersAdditionDialog::on_uTorrentListButton_clicked()
{ {
m_ui->uTorrentListButton->setEnabled(false); m_ui->uTorrentListButton->setEnabled(false);
Net::DownloadHandler *handler = Net::DownloadManager::instance()->download({m_ui->lineEditListURL->text()}); Net::DownloadHandler *handler = Net::DownloadManager::instance()->download(m_ui->lineEditListURL->text());
connect(handler, static_cast<void (Net::DownloadHandler::*)(const QString &, const QByteArray &)>(&Net::DownloadHandler::downloadFinished) connect(handler, static_cast<void (Net::DownloadHandler::*)(const QString &, const QByteArray &)>(&Net::DownloadHandler::downloadFinished)
, this, &TrackersAdditionDialog::parseUTorrentList); , this, &TrackersAdditionDialog::parseUTorrentList);
connect(handler, &Net::DownloadHandler::downloadFailed, this, &TrackersAdditionDialog::getTrackerError); connect(handler, &Net::DownloadHandler::downloadFailed, this, &TrackersAdditionDialog::getTrackerError);

2
src/gui/torrentcontentmodelfolder.h

@ -39,7 +39,7 @@ public:
TorrentContentModelFolder(const QString &name, TorrentContentModelFolder *parent); TorrentContentModelFolder(const QString &name, TorrentContentModelFolder *parent);
// Invisible root item constructor // Invisible root item constructor
TorrentContentModelFolder(const QList<QVariant> &data); explicit TorrentContentModelFolder(const QList<QVariant> &data);
~TorrentContentModelFolder() override; ~TorrentContentModelFolder() override;

2
src/gui/torrentcontentmodelitem.h

@ -56,7 +56,7 @@ public:
FolderType FolderType
}; };
TorrentContentModelItem(TorrentContentModelFolder *parent); explicit TorrentContentModelItem(TorrentContentModelFolder *parent);
virtual ~TorrentContentModelItem(); virtual ~TorrentContentModelItem();
bool isRootItem() const; bool isRootItem() const;

Loading…
Cancel
Save