Drop superfluous const

This commit is contained in:
Chocobo1
2023-05-05 01:49:24 +08:00
parent 15de7aed9a
commit 5f00d42a49
19 changed files with 52 additions and 52 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);

View File

@@ -74,7 +74,7 @@ namespace BitTorrent
void create(const TorrentCreatorParams &params);
#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);

View File

@@ -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;

View File

@@ -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);

View File

@@ -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

View File

@@ -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();