Browse Source

Drop superfluous const

adaptive-webui-19844
Chocobo1 2 years ago
parent
commit
5f00d42a49
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 4
      src/base/bittorrent/filterparserthread.h
  2. 2
      src/base/bittorrent/session.h
  3. 38
      src/base/bittorrent/sessionimpl.h
  4. 2
      src/base/bittorrent/torrentcreatorthread.h
  5. 2
      src/base/preferences.h
  6. 2
      src/base/search/searchpluginmanager.h
  7. 2
      src/base/utils/bytearray.h
  8. 2
      src/base/utils/io.h
  9. 2
      src/gui/desktopintegration.h
  10. 8
      src/gui/properties/propertieswidget.h
  11. 2
      src/gui/properties/trackersadditiondialog.h
  12. 2
      src/gui/transferlistfilters/basefilterwidget.h
  13. 4
      src/gui/transferlistfilters/categoryfiltermodel.h
  14. 4
      src/gui/transferlistfilters/statusfilterwidget.h
  15. 6
      src/gui/transferlistfilters/tagfiltermodel.h
  16. 2
      src/gui/transferlistfilters/trackersfilterwidget.h
  17. 6
      src/gui/transferlistmodel.h
  18. 2
      src/gui/transferlistwidget.h
  19. 12
      src/gui/uithemesource.h

4
src/base/bittorrent/filterparserthread.h

@ -55,8 +55,8 @@ protected:
void run() override; void run() override;
private: private:
int findAndNullDelimiter(char *const data, char delimiter, int start, int end, bool reverse = false); int findAndNullDelimiter(char *data, char delimiter, int start, int end, bool reverse = false);
int trim(char *const data, int start, int end); int trim(char *data, int start, int end);
int parseDATFilterFile(); int parseDATFilterFile();
int parseP2PFilterFile(); int parseP2PFilterFile();
int getlineInStream(QDataStream &stream, std::string &name, char delim); int getlineInStream(QDataStream &stream, std::string &name, char delim);

2
src/base/bittorrent/session.h

@ -400,7 +400,7 @@ namespace BitTorrent
virtual bool isTrackerFilteringEnabled() const = 0; virtual bool isTrackerFilteringEnabled() const = 0;
virtual void setTrackerFilteringEnabled(bool enabled) = 0; virtual void setTrackerFilteringEnabled(bool enabled) = 0;
virtual bool isExcludedFileNamesEnabled() const = 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 QStringList excludedFileNames() const = 0;
virtual void setExcludedFileNames(const QStringList &newList) = 0; virtual void setExcludedFileNames(const QStringList &newList) = 0;
virtual bool isFilenameExcluded(const QString &fileName) const = 0; virtual bool isFilenameExcluded(const QString &fileName) const = 0;

38
src/base/bittorrent/sessionimpl.h

@ -378,7 +378,7 @@ namespace BitTorrent
bool isTrackerFilteringEnabled() const override; bool isTrackerFilteringEnabled() const override;
void setTrackerFilteringEnabled(bool enabled) override; void setTrackerFilteringEnabled(bool enabled) override;
bool isExcludedFileNamesEnabled() const override; bool isExcludedFileNamesEnabled() const override;
void setExcludedFileNamesEnabled(const bool enabled) override; void setExcludedFileNamesEnabled(bool enabled) override;
QStringList excludedFileNames() const override; QStringList excludedFileNames() const override;
void setExcludedFileNames(const QStringList &newList) override; void setExcludedFileNames(const QStringList &newList) override;
bool isFilenameExcluded(const QString &fileName) const override; bool isFilenameExcluded(const QString &fileName) const override;
@ -420,24 +420,24 @@ namespace BitTorrent
void handleTorrentNeedSaveResumeData(const TorrentImpl *torrent); void handleTorrentNeedSaveResumeData(const TorrentImpl *torrent);
void handleTorrentSaveResumeDataRequested(const TorrentImpl *torrent); void handleTorrentSaveResumeDataRequested(const TorrentImpl *torrent);
void handleTorrentSaveResumeDataFailed(const TorrentImpl *torrent); void handleTorrentSaveResumeDataFailed(const TorrentImpl *torrent);
void handleTorrentShareLimitChanged(TorrentImpl *const torrent); void handleTorrentShareLimitChanged(TorrentImpl *torrent);
void handleTorrentNameChanged(TorrentImpl *const torrent); void handleTorrentNameChanged(TorrentImpl *torrent);
void handleTorrentSavePathChanged(TorrentImpl *const torrent); void handleTorrentSavePathChanged(TorrentImpl *torrent);
void handleTorrentCategoryChanged(TorrentImpl *const torrent, const QString &oldCategory); void handleTorrentCategoryChanged(TorrentImpl *torrent, const QString &oldCategory);
void handleTorrentTagAdded(TorrentImpl *const torrent, const QString &tag); void handleTorrentTagAdded(TorrentImpl *torrent, const QString &tag);
void handleTorrentTagRemoved(TorrentImpl *const torrent, const QString &tag); void handleTorrentTagRemoved(TorrentImpl *torrent, const QString &tag);
void handleTorrentSavingModeChanged(TorrentImpl *const torrent); void handleTorrentSavingModeChanged(TorrentImpl *torrent);
void handleTorrentMetadataReceived(TorrentImpl *const torrent); void handleTorrentMetadataReceived(TorrentImpl *torrent);
void handleTorrentPaused(TorrentImpl *const torrent); void handleTorrentPaused(TorrentImpl *torrent);
void handleTorrentResumed(TorrentImpl *const torrent); void handleTorrentResumed(TorrentImpl *torrent);
void handleTorrentChecked(TorrentImpl *const torrent); void handleTorrentChecked(TorrentImpl *torrent);
void handleTorrentFinished(TorrentImpl *const torrent); void handleTorrentFinished(TorrentImpl *torrent);
void handleTorrentTrackersAdded(TorrentImpl *const torrent, const QVector<TrackerEntry> &newTrackers); void handleTorrentTrackersAdded(TorrentImpl *torrent, const QVector<TrackerEntry> &newTrackers);
void handleTorrentTrackersRemoved(TorrentImpl *const torrent, const QStringList &deletedTrackers); void handleTorrentTrackersRemoved(TorrentImpl *torrent, const QStringList &deletedTrackers);
void handleTorrentTrackersChanged(TorrentImpl *const torrent); void handleTorrentTrackersChanged(TorrentImpl *torrent);
void handleTorrentUrlSeedsAdded(TorrentImpl *const torrent, const QVector<QUrl> &newUrlSeeds); void handleTorrentUrlSeedsAdded(TorrentImpl *torrent, const QVector<QUrl> &newUrlSeeds);
void handleTorrentUrlSeedsRemoved(TorrentImpl *const torrent, const QVector<QUrl> &urlSeeds); void handleTorrentUrlSeedsRemoved(TorrentImpl *torrent, const QVector<QUrl> &urlSeeds);
void handleTorrentResumeDataReady(TorrentImpl *const torrent, const LoadTorrentParams &data); void handleTorrentResumeDataReady(TorrentImpl *torrent, const LoadTorrentParams &data);
void handleTorrentInfoHashChanged(TorrentImpl *torrent, const InfoHash &prevInfoHash); void handleTorrentInfoHashChanged(TorrentImpl *torrent, const InfoHash &prevInfoHash);
bool addMoveTorrentStorageJob(TorrentImpl *torrent, const Path &newPath, MoveStorageMode mode, MoveStorageContext context); bool addMoveTorrentStorageJob(TorrentImpl *torrent, const Path &newPath, MoveStorageMode mode, MoveStorageContext context);

2
src/base/bittorrent/torrentcreatorthread.h

@ -74,7 +74,7 @@ namespace BitTorrent
void create(const TorrentCreatorParams &params); void create(const TorrentCreatorParams &params);
#ifdef QBT_USES_LIBTORRENT2 #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 #else
static int calculateTotalPieces(const Path &inputPath static int calculateTotalPieces(const Path &inputPath
, const int pieceSize, const bool isAlignmentOptimized, int paddedFileSizeLimit); , const int pieceSize, const bool isAlignmentOptimized, int paddedFileSizeLimit);

2
src/base/preferences.h

@ -253,7 +253,7 @@ public:
void setUILocked(bool locked); void setUILocked(bool locked);
bool isAutoRunOnTorrentAddedEnabled() const; bool isAutoRunOnTorrentAddedEnabled() const;
void setAutoRunOnTorrentAddedEnabled(const bool enabled); void setAutoRunOnTorrentAddedEnabled(bool enabled);
QString getAutoRunOnTorrentAddedProgram() const; QString getAutoRunOnTorrentAddedProgram() const;
void setAutoRunOnTorrentAddedProgram(const QString &program); void setAutoRunOnTorrentAddedProgram(const QString &program);
bool isAutoRunOnTorrentFinishedEnabled() const; bool isAutoRunOnTorrentFinishedEnabled() const;

2
src/base/search/searchpluginmanager.h

@ -80,7 +80,7 @@ public:
void updatePlugin(const QString &name); void updatePlugin(const QString &name);
void installPlugin(const QString &source); void installPlugin(const QString &source);
bool uninstallPlugin(const QString &name); bool uninstallPlugin(const QString &name);
static void updateIconPath(PluginInfo *const plugin); static void updateIconPath(PluginInfo *plugin);
void checkForUpdates(); void checkForUpdates();
SearchHandler *startSearch(const QString &pattern, const QString &category, const QStringList &usedPlugins); SearchHandler *startSearch(const QString &pattern, const QString &category, const QStringList &usedPlugins);

2
src/base/utils/bytearray.h

@ -36,7 +36,7 @@ class QByteArray;
namespace Utils::ByteArray namespace Utils::ByteArray
{ {
// Mimic QStringView(in).split(sep, behavior) // 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, // Mimic QByteArray::mid(pos, len) but instead of returning a full-copy,
// we only return a partial view // we only return a partial view

2
src/base/utils/io.h

@ -53,7 +53,7 @@ namespace Utils::IO
using pointer = void; using pointer = void;
using reference = 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(const FileDeviceOutputIterator &other) = default;
~FileDeviceOutputIterator(); ~FileDeviceOutputIterator();

2
src/gui/desktopintegration.h

@ -63,7 +63,7 @@ public:
int notificationTimeout() const; int notificationTimeout() const;
#ifdef QBT_USES_DBUS #ifdef QBT_USES_DBUS
void setNotificationTimeout(const int value); void setNotificationTimeout(int value);
#endif #endif
void showNotification(const QString &title, const QString &msg) const; void showNotification(const QString &title, const QString &msg) const;

8
src/gui/properties/propertieswidget.h

@ -76,16 +76,16 @@ public:
public slots: public slots:
void setVisibility(bool visible); void setVisibility(bool visible);
void loadTorrentInfos(BitTorrent::Torrent *const torrent); void loadTorrentInfos(BitTorrent::Torrent *torrent);
void loadDynamicData(); void loadDynamicData();
void clear(); void clear();
void readSettings(); void readSettings();
void saveSettings(); void saveSettings();
void reloadPreferences(); void reloadPreferences();
void loadTrackers(BitTorrent::Torrent *const torrent); void loadTrackers(BitTorrent::Torrent *torrent);
protected slots: protected slots:
void updateTorrentInfos(BitTorrent::Torrent *const torrent); void updateTorrentInfos(BitTorrent::Torrent *torrent);
void loadUrlSeeds(); void loadUrlSeeds();
void askWebSeed(); void askWebSeed();
void deleteSelectedUrlSeeds(); void deleteSelectedUrlSeeds();
@ -97,7 +97,7 @@ protected slots:
private slots: private slots:
void configure(); void configure();
void updateSavePath(BitTorrent::Torrent *const torrent); void updateSavePath(BitTorrent::Torrent *torrent);
private: private:
QPushButton *getButtonFromIndex(int index); QPushButton *getButtonFromIndex(int index);

2
src/gui/properties/trackersadditiondialog.h

@ -54,7 +54,7 @@ class TrackersAdditionDialog : public QDialog
Q_DISABLE_COPY_MOVE(TrackersAdditionDialog) Q_DISABLE_COPY_MOVE(TrackersAdditionDialog)
public: public:
TrackersAdditionDialog(QWidget *parent, BitTorrent::Torrent *const torrent); TrackersAdditionDialog(QWidget *parent, BitTorrent::Torrent *torrent);
~TrackersAdditionDialog(); ~TrackersAdditionDialog();
private slots: private slots:

2
src/gui/transferlistfilters/basefilterwidget.h

@ -56,7 +56,7 @@ private slots:
virtual void showMenu() = 0; virtual void showMenu() = 0;
virtual void applyFilter(int row) = 0; virtual void applyFilter(int row) = 0;
virtual void handleTorrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents) = 0; virtual void handleTorrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents) = 0;
virtual void torrentAboutToBeDeleted(BitTorrent::Torrent *const) = 0; virtual void torrentAboutToBeDeleted(BitTorrent::Torrent *) = 0;
private: private:
TransferListWidget *m_transferList = nullptr; TransferListWidget *m_transferList = nullptr;

4
src/gui/transferlistfilters/categoryfiltermodel.h

@ -63,8 +63,8 @@ private slots:
void categoryAdded(const QString &categoryName); void categoryAdded(const QString &categoryName);
void categoryRemoved(const QString &categoryName); void categoryRemoved(const QString &categoryName);
void torrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents); void torrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents);
void torrentAboutToBeRemoved(BitTorrent::Torrent *const torrent); void torrentAboutToBeRemoved(BitTorrent::Torrent *torrent);
void torrentCategoryChanged(BitTorrent::Torrent *const torrent, const QString &oldCategory); void torrentCategoryChanged(BitTorrent::Torrent *torrent, const QString &oldCategory);
void subcategoriesSupportChanged(); void subcategoriesSupportChanged();
private: private:

4
src/gui/transferlistfilters/statusfilterwidget.h

@ -54,11 +54,11 @@ private:
void showMenu() override; void showMenu() override;
void applyFilter(int row) override; void applyFilter(int row) override;
void handleTorrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents) override; void handleTorrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents) override;
void torrentAboutToBeDeleted(BitTorrent::Torrent *const) override; void torrentAboutToBeDeleted(BitTorrent::Torrent *) override;
void configure(); void configure();
void update(const QVector<BitTorrent::Torrent *> torrents); void update(QVector<BitTorrent::Torrent *> torrents);
void updateTorrentStatus(const BitTorrent::Torrent *torrent); void updateTorrentStatus(const BitTorrent::Torrent *torrent);
void updateTexts(); void updateTexts();
void hideZeroItems(); void hideZeroItems();

6
src/gui/transferlistfilters/tagfiltermodel.h

@ -61,10 +61,10 @@ public:
private slots: private slots:
void tagAdded(const QString &tag); void tagAdded(const QString &tag);
void tagRemoved(const QString &tag); void tagRemoved(const QString &tag);
void torrentTagAdded(BitTorrent::Torrent *const torrent, const QString &tag); void torrentTagAdded(BitTorrent::Torrent *torrent, const QString &tag);
void torrentTagRemoved(BitTorrent::Torrent *const, const QString &tag); void torrentTagRemoved(BitTorrent::Torrent *, const QString &tag);
void torrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents); void torrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents);
void torrentAboutToBeRemoved(BitTorrent::Torrent *const torrent); void torrentAboutToBeRemoved(BitTorrent::Torrent *torrent);
private: private:
static QString tagDisplayName(const QString &tag); static QString tagDisplayName(const QString &tag);

2
src/gui/transferlistfilters/trackersfilterwidget.h

@ -69,7 +69,7 @@ private:
void showMenu() override; void showMenu() override;
void applyFilter(int row) override; void applyFilter(int row) override;
void handleTorrentsLoaded(const QVector<BitTorrent::Torrent *> &torrents) 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 addItems(const QString &trackerURL, const QVector<BitTorrent::TorrentID> &torrents);
void removeItem(const QString &trackerURL, const BitTorrent::TorrentID &id); void removeItem(const QString &trackerURL, const BitTorrent::TorrentID &id);

6
src/gui/transferlistmodel.h

@ -107,15 +107,15 @@ public:
private slots: private slots:
void addTorrents(const QVector<BitTorrent::Torrent *> &torrents); void addTorrents(const QVector<BitTorrent::Torrent *> &torrents);
void handleTorrentAboutToBeRemoved(BitTorrent::Torrent *const torrent); void handleTorrentAboutToBeRemoved(BitTorrent::Torrent *torrent);
void handleTorrentStatusUpdated(BitTorrent::Torrent *const torrent); void handleTorrentStatusUpdated(BitTorrent::Torrent *torrent);
void handleTorrentsUpdated(const QVector<BitTorrent::Torrent *> &torrents); void handleTorrentsUpdated(const QVector<BitTorrent::Torrent *> &torrents);
private: private:
void configure(); void configure();
QString displayValue(const BitTorrent::Torrent *torrent, int column) const; QString displayValue(const BitTorrent::Torrent *torrent, int column) const;
QVariant internalValue(const BitTorrent::Torrent *torrent, int column, bool alt) 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 QList<BitTorrent::Torrent *> m_torrentList; // maps row number to torrent handle
QHash<BitTorrent::Torrent *, int> m_torrentMap; // maps torrent handle to row number QHash<BitTorrent::Torrent *, int> m_torrentMap; // maps torrent handle to row number

2
src/gui/transferlistwidget.h

@ -102,7 +102,7 @@ public slots:
void renameSelectedTorrent(); void renameSelectedTorrent();
signals: signals:
void currentTorrentChanged(BitTorrent::Torrent *const torrent); void currentTorrentChanged(BitTorrent::Torrent *torrent);
private slots: private slots:
void torrentDoubleClicked(); void torrentDoubleClicked();

12
src/gui/uithemesource.h

@ -54,8 +54,8 @@ class UIThemeSource
public: public:
virtual ~UIThemeSource() = default; virtual ~UIThemeSource() = default;
virtual QColor getColor(const QString &colorId, const ColorMode colorMode) const = 0; virtual QColor getColor(const QString &colorId, ColorMode colorMode) const = 0;
virtual Path getIconPath(const QString &iconId, const ColorMode colorMode) const = 0; virtual Path getIconPath(const QString &iconId, ColorMode colorMode) const = 0;
virtual QByteArray readStyleSheet() = 0; virtual QByteArray readStyleSheet() = 0;
}; };
@ -65,8 +65,8 @@ public:
DefaultThemeSource(); DefaultThemeSource();
QByteArray readStyleSheet() override; QByteArray readStyleSheet() override;
QColor getColor(const QString &colorId, const ColorMode colorMode) const override; QColor getColor(const QString &colorId, ColorMode colorMode) const override;
Path getIconPath(const QString &iconId, const ColorMode colorMode) const override; Path getIconPath(const QString &iconId, ColorMode colorMode) const override;
private: private:
void loadColors(); void loadColors();
@ -79,8 +79,8 @@ private:
class CustomThemeSource : public UIThemeSource class CustomThemeSource : public UIThemeSource
{ {
public: public:
QColor getColor(const QString &colorId, const ColorMode colorMode) const override; QColor getColor(const QString &colorId, ColorMode colorMode) const override;
Path getIconPath(const QString &iconId, const ColorMode colorMode) const override; Path getIconPath(const QString &iconId, ColorMode colorMode) const override;
QByteArray readStyleSheet() override; QByteArray readStyleSheet() override;
protected: protected:

Loading…
Cancel
Save