mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-27 07:00:04 +08:00
Drop superfluous const
This commit is contained in:
parent
15de7aed9a
commit
5f00d42a49
@ -55,8 +55,8 @@ protected:
|
||||
void run() override;
|
||||
|
||||
private:
|
||||
int findAndNullDelimiter(char *const data, char delimiter, int start, int end, bool reverse = false);
|
||||
int trim(char *const data, int start, int end);
|
||||
int findAndNullDelimiter(char *data, char delimiter, int start, int end, bool reverse = false);
|
||||
int trim(char *data, int start, int end);
|
||||
int parseDATFilterFile();
|
||||
int parseP2PFilterFile();
|
||||
int getlineInStream(QDataStream &stream, std::string &name, char delim);
|
||||
|
@ -400,7 +400,7 @@ namespace BitTorrent
|
||||
virtual bool isTrackerFilteringEnabled() const = 0;
|
||||
virtual void setTrackerFilteringEnabled(bool enabled) = 0;
|
||||
virtual bool isExcludedFileNamesEnabled() const = 0;
|
||||
virtual void setExcludedFileNamesEnabled(const bool enabled) = 0;
|
||||
virtual void setExcludedFileNamesEnabled(bool enabled) = 0;
|
||||
virtual QStringList excludedFileNames() const = 0;
|
||||
virtual void setExcludedFileNames(const QStringList &newList) = 0;
|
||||
virtual bool isFilenameExcluded(const QString &fileName) const = 0;
|
||||
|
@ -378,7 +378,7 @@ namespace BitTorrent
|
||||
bool isTrackerFilteringEnabled() const override;
|
||||
void setTrackerFilteringEnabled(bool enabled) override;
|
||||
bool isExcludedFileNamesEnabled() const override;
|
||||
void setExcludedFileNamesEnabled(const bool enabled) override;
|
||||
void setExcludedFileNamesEnabled(bool enabled) override;
|
||||
QStringList excludedFileNames() const override;
|
||||
void setExcludedFileNames(const QStringList &newList) override;
|
||||
bool isFilenameExcluded(const QString &fileName) const override;
|
||||
@ -420,24 +420,24 @@ namespace BitTorrent
|
||||
void handleTorrentNeedSaveResumeData(const TorrentImpl *torrent);
|
||||
void handleTorrentSaveResumeDataRequested(const TorrentImpl *torrent);
|
||||
void handleTorrentSaveResumeDataFailed(const TorrentImpl *torrent);
|
||||
void handleTorrentShareLimitChanged(TorrentImpl *const torrent);
|
||||
void handleTorrentNameChanged(TorrentImpl *const torrent);
|
||||
void handleTorrentSavePathChanged(TorrentImpl *const torrent);
|
||||
void handleTorrentCategoryChanged(TorrentImpl *const torrent, const QString &oldCategory);
|
||||
void handleTorrentTagAdded(TorrentImpl *const torrent, const QString &tag);
|
||||
void handleTorrentTagRemoved(TorrentImpl *const torrent, const QString &tag);
|
||||
void handleTorrentSavingModeChanged(TorrentImpl *const torrent);
|
||||
void handleTorrentMetadataReceived(TorrentImpl *const torrent);
|
||||
void handleTorrentPaused(TorrentImpl *const torrent);
|
||||
void handleTorrentResumed(TorrentImpl *const torrent);
|
||||
void handleTorrentChecked(TorrentImpl *const torrent);
|
||||
void handleTorrentFinished(TorrentImpl *const torrent);
|
||||
void handleTorrentTrackersAdded(TorrentImpl *const torrent, const QVector<TrackerEntry> &newTrackers);
|
||||
void handleTorrentTrackersRemoved(TorrentImpl *const torrent, const QStringList &deletedTrackers);
|
||||
void handleTorrentTrackersChanged(TorrentImpl *const torrent);
|
||||
void handleTorrentUrlSeedsAdded(TorrentImpl *const torrent, const QVector<QUrl> &newUrlSeeds);
|
||||
void handleTorrentUrlSeedsRemoved(TorrentImpl *const torrent, const QVector<QUrl> &urlSeeds);
|
||||
void handleTorrentResumeDataReady(TorrentImpl *const torrent, const LoadTorrentParams &data);
|
||||
void handleTorrentShareLimitChanged(TorrentImpl *torrent);
|
||||
void handleTorrentNameChanged(TorrentImpl *torrent);
|
||||
void handleTorrentSavePathChanged(TorrentImpl *torrent);
|
||||
void handleTorrentCategoryChanged(TorrentImpl *torrent, const QString &oldCategory);
|
||||
void handleTorrentTagAdded(TorrentImpl *torrent, const QString &tag);
|
||||
void handleTorrentTagRemoved(TorrentImpl *torrent, const QString &tag);
|
||||
void handleTorrentSavingModeChanged(TorrentImpl *torrent);
|
||||
void handleTorrentMetadataReceived(TorrentImpl *torrent);
|
||||
void handleTorrentPaused(TorrentImpl *torrent);
|
||||
void handleTorrentResumed(TorrentImpl *torrent);
|
||||
void handleTorrentChecked(TorrentImpl *torrent);
|
||||
void handleTorrentFinished(TorrentImpl *torrent);
|
||||
void handleTorrentTrackersAdded(TorrentImpl *torrent, const QVector<TrackerEntry> &newTrackers);
|
||||
void handleTorrentTrackersRemoved(TorrentImpl *torrent, const QStringList &deletedTrackers);
|
||||
void handleTorrentTrackersChanged(TorrentImpl *torrent);
|
||||
void handleTorrentUrlSeedsAdded(TorrentImpl *torrent, const QVector<QUrl> &newUrlSeeds);
|
||||
void handleTorrentUrlSeedsRemoved(TorrentImpl *torrent, const QVector<QUrl> &urlSeeds);
|
||||
void handleTorrentResumeDataReady(TorrentImpl *torrent, const LoadTorrentParams &data);
|
||||
void handleTorrentInfoHashChanged(TorrentImpl *torrent, const InfoHash &prevInfoHash);
|
||||
|
||||
bool addMoveTorrentStorageJob(TorrentImpl *torrent, const Path &newPath, MoveStorageMode mode, MoveStorageContext context);
|
||||
|
@ -74,7 +74,7 @@ namespace BitTorrent
|
||||
void create(const TorrentCreatorParams ¶ms);
|
||||
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
static int calculateTotalPieces(const Path &inputPath, const int pieceSize, const TorrentFormat torrentFormat);
|
||||
static int calculateTotalPieces(const Path &inputPath, int pieceSize, TorrentFormat torrentFormat);
|
||||
#else
|
||||
static int calculateTotalPieces(const Path &inputPath
|
||||
, const int pieceSize, const bool isAlignmentOptimized, int paddedFileSizeLimit);
|
||||
|
@ -253,7 +253,7 @@ public:
|
||||
void setUILocked(bool locked);
|
||||
|
||||
bool isAutoRunOnTorrentAddedEnabled() const;
|
||||
void setAutoRunOnTorrentAddedEnabled(const bool enabled);
|
||||
void setAutoRunOnTorrentAddedEnabled(bool enabled);
|
||||
QString getAutoRunOnTorrentAddedProgram() const;
|
||||
void setAutoRunOnTorrentAddedProgram(const QString &program);
|
||||
bool isAutoRunOnTorrentFinishedEnabled() const;
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
void updatePlugin(const QString &name);
|
||||
void installPlugin(const QString &source);
|
||||
bool uninstallPlugin(const QString &name);
|
||||
static void updateIconPath(PluginInfo *const plugin);
|
||||
static void updateIconPath(PluginInfo *plugin);
|
||||
void checkForUpdates();
|
||||
|
||||
SearchHandler *startSearch(const QString &pattern, const QString &category, const QStringList &usedPlugins);
|
||||
|
@ -36,7 +36,7 @@ class QByteArray;
|
||||
namespace Utils::ByteArray
|
||||
{
|
||||
// Mimic QStringView(in).split(sep, behavior)
|
||||
QVector<QByteArray> splitToViews(const QByteArray &in, const QByteArray &sep, const Qt::SplitBehavior behavior = Qt::KeepEmptyParts);
|
||||
QVector<QByteArray> splitToViews(const QByteArray &in, const QByteArray &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts);
|
||||
|
||||
// Mimic QByteArray::mid(pos, len) but instead of returning a full-copy,
|
||||
// we only return a partial view
|
||||
|
@ -53,7 +53,7 @@ namespace Utils::IO
|
||||
using pointer = void;
|
||||
using reference = void;
|
||||
|
||||
explicit FileDeviceOutputIterator(QFileDevice &device, const int bufferSize = (4 * 1024));
|
||||
explicit FileDeviceOutputIterator(QFileDevice &device, int bufferSize = (4 * 1024));
|
||||
FileDeviceOutputIterator(const FileDeviceOutputIterator &other) = default;
|
||||
~FileDeviceOutputIterator();
|
||||
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
|
||||
int notificationTimeout() const;
|
||||
#ifdef QBT_USES_DBUS
|
||||
void setNotificationTimeout(const int value);
|
||||
void setNotificationTimeout(int value);
|
||||
#endif
|
||||
|
||||
void showNotification(const QString &title, const QString &msg) const;
|
||||
|
@ -76,16 +76,16 @@ public:
|
||||
|
||||
public slots:
|
||||
void setVisibility(bool visible);
|
||||
void loadTorrentInfos(BitTorrent::Torrent *const torrent);
|
||||
void loadTorrentInfos(BitTorrent::Torrent *torrent);
|
||||
void loadDynamicData();
|
||||
void clear();
|
||||
void readSettings();
|
||||
void saveSettings();
|
||||
void reloadPreferences();
|
||||
void loadTrackers(BitTorrent::Torrent *const torrent);
|
||||
void loadTrackers(BitTorrent::Torrent *torrent);
|
||||
|
||||
protected slots:
|
||||
void updateTorrentInfos(BitTorrent::Torrent *const torrent);
|
||||
void updateTorrentInfos(BitTorrent::Torrent *torrent);
|
||||
void loadUrlSeeds();
|
||||
void askWebSeed();
|
||||
void deleteSelectedUrlSeeds();
|
||||
@ -97,7 +97,7 @@ protected slots:
|
||||
|
||||
private slots:
|
||||
void configure();
|
||||
void updateSavePath(BitTorrent::Torrent *const torrent);
|
||||
void updateSavePath(BitTorrent::Torrent *torrent);
|
||||
|
||||
private:
|
||||
QPushButton *getButtonFromIndex(int index);
|
||||
|
@ -54,7 +54,7 @@ class TrackersAdditionDialog : public QDialog
|
||||
Q_DISABLE_COPY_MOVE(TrackersAdditionDialog)
|
||||
|
||||
public:
|
||||
TrackersAdditionDialog(QWidget *parent, BitTorrent::Torrent *const torrent);
|
||||
TrackersAdditionDialog(QWidget *parent, BitTorrent::Torrent *torrent);
|
||||
~TrackersAdditionDialog();
|
||||
|
||||
private slots:
|
||||
|
@ -56,7 +56,7 @@ private slots:
|
||||
virtual void showMenu() = 0;
|
||||
virtual void applyFilter(int row) = 0;
|
||||
virtual void handleTorrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents) = 0;
|
||||
virtual void torrentAboutToBeDeleted(BitTorrent::Torrent *const) = 0;
|
||||
virtual void torrentAboutToBeDeleted(BitTorrent::Torrent *) = 0;
|
||||
|
||||
private:
|
||||
TransferListWidget *m_transferList = nullptr;
|
||||
|
@ -63,8 +63,8 @@ private slots:
|
||||
void categoryAdded(const QString &categoryName);
|
||||
void categoryRemoved(const QString &categoryName);
|
||||
void torrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents);
|
||||
void torrentAboutToBeRemoved(BitTorrent::Torrent *const torrent);
|
||||
void torrentCategoryChanged(BitTorrent::Torrent *const torrent, const QString &oldCategory);
|
||||
void torrentAboutToBeRemoved(BitTorrent::Torrent *torrent);
|
||||
void torrentCategoryChanged(BitTorrent::Torrent *torrent, const QString &oldCategory);
|
||||
void subcategoriesSupportChanged();
|
||||
|
||||
private:
|
||||
|
@ -54,11 +54,11 @@ private:
|
||||
void showMenu() override;
|
||||
void applyFilter(int row) override;
|
||||
void handleTorrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents) override;
|
||||
void torrentAboutToBeDeleted(BitTorrent::Torrent *const) override;
|
||||
void torrentAboutToBeDeleted(BitTorrent::Torrent *) override;
|
||||
|
||||
void configure();
|
||||
|
||||
void update(const QVector<BitTorrent::Torrent *> torrents);
|
||||
void update(QVector<BitTorrent::Torrent *> torrents);
|
||||
void updateTorrentStatus(const BitTorrent::Torrent *torrent);
|
||||
void updateTexts();
|
||||
void hideZeroItems();
|
||||
|
@ -61,10 +61,10 @@ public:
|
||||
private slots:
|
||||
void tagAdded(const QString &tag);
|
||||
void tagRemoved(const QString &tag);
|
||||
void torrentTagAdded(BitTorrent::Torrent *const torrent, const QString &tag);
|
||||
void torrentTagRemoved(BitTorrent::Torrent *const, const QString &tag);
|
||||
void torrentTagAdded(BitTorrent::Torrent *torrent, const QString &tag);
|
||||
void torrentTagRemoved(BitTorrent::Torrent *, const QString &tag);
|
||||
void torrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents);
|
||||
void torrentAboutToBeRemoved(BitTorrent::Torrent *const torrent);
|
||||
void torrentAboutToBeRemoved(BitTorrent::Torrent *torrent);
|
||||
|
||||
private:
|
||||
static QString tagDisplayName(const QString &tag);
|
||||
|
@ -69,7 +69,7 @@ private:
|
||||
void showMenu() override;
|
||||
void applyFilter(int row) override;
|
||||
void handleTorrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents) override;
|
||||
void torrentAboutToBeDeleted(BitTorrent::Torrent *const torrent) override;
|
||||
void torrentAboutToBeDeleted(BitTorrent::Torrent *torrent) override;
|
||||
|
||||
void addItems(const QString &trackerURL, const QVector<BitTorrent::TorrentID> &torrents);
|
||||
void removeItem(const QString &trackerURL, const BitTorrent::TorrentID &id);
|
||||
|
@ -107,15 +107,15 @@ public:
|
||||
|
||||
private slots:
|
||||
void addTorrents(const QVector<BitTorrent::Torrent *> &torrents);
|
||||
void handleTorrentAboutToBeRemoved(BitTorrent::Torrent *const torrent);
|
||||
void handleTorrentStatusUpdated(BitTorrent::Torrent *const torrent);
|
||||
void handleTorrentAboutToBeRemoved(BitTorrent::Torrent *torrent);
|
||||
void handleTorrentStatusUpdated(BitTorrent::Torrent *torrent);
|
||||
void handleTorrentsUpdated(const QVector<BitTorrent::Torrent *> &torrents);
|
||||
|
||||
private:
|
||||
void configure();
|
||||
QString displayValue(const BitTorrent::Torrent *torrent, int column) const;
|
||||
QVariant internalValue(const BitTorrent::Torrent *torrent, int column, bool alt) const;
|
||||
QIcon getIconByState(const BitTorrent::TorrentState state) const;
|
||||
QIcon getIconByState(BitTorrent::TorrentState state) const;
|
||||
|
||||
QList<BitTorrent::Torrent *> m_torrentList; // maps row number to torrent handle
|
||||
QHash<BitTorrent::Torrent *, int> m_torrentMap; // maps torrent handle to row number
|
||||
|
@ -102,7 +102,7 @@ public slots:
|
||||
void renameSelectedTorrent();
|
||||
|
||||
signals:
|
||||
void currentTorrentChanged(BitTorrent::Torrent *const torrent);
|
||||
void currentTorrentChanged(BitTorrent::Torrent *torrent);
|
||||
|
||||
private slots:
|
||||
void torrentDoubleClicked();
|
||||
|
@ -54,8 +54,8 @@ class UIThemeSource
|
||||
public:
|
||||
virtual ~UIThemeSource() = default;
|
||||
|
||||
virtual QColor getColor(const QString &colorId, const ColorMode colorMode) const = 0;
|
||||
virtual Path getIconPath(const QString &iconId, const ColorMode colorMode) const = 0;
|
||||
virtual QColor getColor(const QString &colorId, ColorMode colorMode) const = 0;
|
||||
virtual Path getIconPath(const QString &iconId, ColorMode colorMode) const = 0;
|
||||
virtual QByteArray readStyleSheet() = 0;
|
||||
};
|
||||
|
||||
@ -65,8 +65,8 @@ public:
|
||||
DefaultThemeSource();
|
||||
|
||||
QByteArray readStyleSheet() override;
|
||||
QColor getColor(const QString &colorId, const ColorMode colorMode) const override;
|
||||
Path getIconPath(const QString &iconId, const ColorMode colorMode) const override;
|
||||
QColor getColor(const QString &colorId, ColorMode colorMode) const override;
|
||||
Path getIconPath(const QString &iconId, ColorMode colorMode) const override;
|
||||
|
||||
private:
|
||||
void loadColors();
|
||||
@ -79,8 +79,8 @@ private:
|
||||
class CustomThemeSource : public UIThemeSource
|
||||
{
|
||||
public:
|
||||
QColor getColor(const QString &colorId, const ColorMode colorMode) const override;
|
||||
Path getIconPath(const QString &iconId, const ColorMode colorMode) const override;
|
||||
QColor getColor(const QString &colorId, ColorMode colorMode) const override;
|
||||
Path getIconPath(const QString &iconId, ColorMode colorMode) const override;
|
||||
QByteArray readStyleSheet() override;
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user