From 5f00d42a49950f63f7cb16033deef6e5f77ee085 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 5 May 2023 01:49:24 +0800 Subject: [PATCH] Drop superfluous const --- src/base/bittorrent/filterparserthread.h | 4 +- src/base/bittorrent/session.h | 2 +- src/base/bittorrent/sessionimpl.h | 38 +++++++++---------- src/base/bittorrent/torrentcreatorthread.h | 2 +- src/base/preferences.h | 2 +- src/base/search/searchpluginmanager.h | 2 +- src/base/utils/bytearray.h | 2 +- src/base/utils/io.h | 2 +- src/gui/desktopintegration.h | 2 +- src/gui/properties/propertieswidget.h | 8 ++-- src/gui/properties/trackersadditiondialog.h | 2 +- .../transferlistfilters/basefilterwidget.h | 2 +- .../transferlistfilters/categoryfiltermodel.h | 4 +- .../transferlistfilters/statusfilterwidget.h | 4 +- src/gui/transferlistfilters/tagfiltermodel.h | 6 +-- .../trackersfilterwidget.h | 2 +- src/gui/transferlistmodel.h | 6 +-- src/gui/transferlistwidget.h | 2 +- src/gui/uithemesource.h | 12 +++--- 19 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/base/bittorrent/filterparserthread.h b/src/base/bittorrent/filterparserthread.h index 28a209a3a..b118d706e 100644 --- a/src/base/bittorrent/filterparserthread.h +++ b/src/base/bittorrent/filterparserthread.h @@ -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); diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h index e0256aa00..663cb29fe 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -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; diff --git a/src/base/bittorrent/sessionimpl.h b/src/base/bittorrent/sessionimpl.h index 76dda63a2..475a31a29 100644 --- a/src/base/bittorrent/sessionimpl.h +++ b/src/base/bittorrent/sessionimpl.h @@ -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 &newTrackers); - void handleTorrentTrackersRemoved(TorrentImpl *const torrent, const QStringList &deletedTrackers); - void handleTorrentTrackersChanged(TorrentImpl *const torrent); - void handleTorrentUrlSeedsAdded(TorrentImpl *const torrent, const QVector &newUrlSeeds); - void handleTorrentUrlSeedsRemoved(TorrentImpl *const torrent, const QVector &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 &newTrackers); + void handleTorrentTrackersRemoved(TorrentImpl *torrent, const QStringList &deletedTrackers); + void handleTorrentTrackersChanged(TorrentImpl *torrent); + void handleTorrentUrlSeedsAdded(TorrentImpl *torrent, const QVector &newUrlSeeds); + void handleTorrentUrlSeedsRemoved(TorrentImpl *torrent, const QVector &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); diff --git a/src/base/bittorrent/torrentcreatorthread.h b/src/base/bittorrent/torrentcreatorthread.h index ec09c8a4c..02b33f79b 100644 --- a/src/base/bittorrent/torrentcreatorthread.h +++ b/src/base/bittorrent/torrentcreatorthread.h @@ -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); diff --git a/src/base/preferences.h b/src/base/preferences.h index 57b6e0499..f7c719966 100644 --- a/src/base/preferences.h +++ b/src/base/preferences.h @@ -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; diff --git a/src/base/search/searchpluginmanager.h b/src/base/search/searchpluginmanager.h index e87e9d8a4..e7d1daebe 100644 --- a/src/base/search/searchpluginmanager.h +++ b/src/base/search/searchpluginmanager.h @@ -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); diff --git a/src/base/utils/bytearray.h b/src/base/utils/bytearray.h index c3d959b4c..8d00f1671 100644 --- a/src/base/utils/bytearray.h +++ b/src/base/utils/bytearray.h @@ -36,7 +36,7 @@ class QByteArray; namespace Utils::ByteArray { // Mimic QStringView(in).split(sep, behavior) - QVector splitToViews(const QByteArray &in, const QByteArray &sep, const Qt::SplitBehavior behavior = Qt::KeepEmptyParts); + QVector 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 diff --git a/src/base/utils/io.h b/src/base/utils/io.h index 06a2d71e1..767381ebe 100644 --- a/src/base/utils/io.h +++ b/src/base/utils/io.h @@ -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(); diff --git a/src/gui/desktopintegration.h b/src/gui/desktopintegration.h index 3d55262e7..62dbbc4a9 100644 --- a/src/gui/desktopintegration.h +++ b/src/gui/desktopintegration.h @@ -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; diff --git a/src/gui/properties/propertieswidget.h b/src/gui/properties/propertieswidget.h index d28e74e70..a8f0f9f95 100644 --- a/src/gui/properties/propertieswidget.h +++ b/src/gui/properties/propertieswidget.h @@ -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); diff --git a/src/gui/properties/trackersadditiondialog.h b/src/gui/properties/trackersadditiondialog.h index b9313b6fd..0dc658cff 100644 --- a/src/gui/properties/trackersadditiondialog.h +++ b/src/gui/properties/trackersadditiondialog.h @@ -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: diff --git a/src/gui/transferlistfilters/basefilterwidget.h b/src/gui/transferlistfilters/basefilterwidget.h index bcb2753c8..9f0afecdb 100644 --- a/src/gui/transferlistfilters/basefilterwidget.h +++ b/src/gui/transferlistfilters/basefilterwidget.h @@ -56,7 +56,7 @@ private slots: virtual void showMenu() = 0; virtual void applyFilter(int row) = 0; virtual void handleTorrentsLoaded(const QVector &torrents) = 0; - virtual void torrentAboutToBeDeleted(BitTorrent::Torrent *const) = 0; + virtual void torrentAboutToBeDeleted(BitTorrent::Torrent *) = 0; private: TransferListWidget *m_transferList = nullptr; diff --git a/src/gui/transferlistfilters/categoryfiltermodel.h b/src/gui/transferlistfilters/categoryfiltermodel.h index 744f6b319..1ba799f09 100644 --- a/src/gui/transferlistfilters/categoryfiltermodel.h +++ b/src/gui/transferlistfilters/categoryfiltermodel.h @@ -63,8 +63,8 @@ private slots: void categoryAdded(const QString &categoryName); void categoryRemoved(const QString &categoryName); void torrentsLoaded(const QVector &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: diff --git a/src/gui/transferlistfilters/statusfilterwidget.h b/src/gui/transferlistfilters/statusfilterwidget.h index 1e13bc0d7..c3c3b3229 100644 --- a/src/gui/transferlistfilters/statusfilterwidget.h +++ b/src/gui/transferlistfilters/statusfilterwidget.h @@ -54,11 +54,11 @@ private: void showMenu() override; void applyFilter(int row) override; void handleTorrentsLoaded(const QVector &torrents) override; - void torrentAboutToBeDeleted(BitTorrent::Torrent *const) override; + void torrentAboutToBeDeleted(BitTorrent::Torrent *) override; void configure(); - void update(const QVector torrents); + void update(QVector torrents); void updateTorrentStatus(const BitTorrent::Torrent *torrent); void updateTexts(); void hideZeroItems(); diff --git a/src/gui/transferlistfilters/tagfiltermodel.h b/src/gui/transferlistfilters/tagfiltermodel.h index d51addb1b..577530ac8 100644 --- a/src/gui/transferlistfilters/tagfiltermodel.h +++ b/src/gui/transferlistfilters/tagfiltermodel.h @@ -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 &torrents); - void torrentAboutToBeRemoved(BitTorrent::Torrent *const torrent); + void torrentAboutToBeRemoved(BitTorrent::Torrent *torrent); private: static QString tagDisplayName(const QString &tag); diff --git a/src/gui/transferlistfilters/trackersfilterwidget.h b/src/gui/transferlistfilters/trackersfilterwidget.h index 153b6b3ec..0626c65d4 100644 --- a/src/gui/transferlistfilters/trackersfilterwidget.h +++ b/src/gui/transferlistfilters/trackersfilterwidget.h @@ -69,7 +69,7 @@ private: void showMenu() override; void applyFilter(int row) override; void handleTorrentsLoaded(const QVector &torrents) override; - void torrentAboutToBeDeleted(BitTorrent::Torrent *const torrent) override; + void torrentAboutToBeDeleted(BitTorrent::Torrent *torrent) override; void addItems(const QString &trackerURL, const QVector &torrents); void removeItem(const QString &trackerURL, const BitTorrent::TorrentID &id); diff --git a/src/gui/transferlistmodel.h b/src/gui/transferlistmodel.h index 7f42c6aef..f0d7e8ad1 100644 --- a/src/gui/transferlistmodel.h +++ b/src/gui/transferlistmodel.h @@ -107,15 +107,15 @@ public: private slots: void addTorrents(const QVector &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 &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 m_torrentList; // maps row number to torrent handle QHash m_torrentMap; // maps torrent handle to row number diff --git a/src/gui/transferlistwidget.h b/src/gui/transferlistwidget.h index 5b5be7d61..205b21246 100644 --- a/src/gui/transferlistwidget.h +++ b/src/gui/transferlistwidget.h @@ -102,7 +102,7 @@ public slots: void renameSelectedTorrent(); signals: - void currentTorrentChanged(BitTorrent::Torrent *const torrent); + void currentTorrentChanged(BitTorrent::Torrent *torrent); private slots: void torrentDoubleClicked(); diff --git a/src/gui/uithemesource.h b/src/gui/uithemesource.h index bfd89546c..4969c3cee 100644 --- a/src/gui/uithemesource.h +++ b/src/gui/uithemesource.h @@ -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: