Browse Source

Remove const in declarations' arguments that are passed by value

adaptive-webui-19844
thalieht 6 years ago
parent
commit
8a19a0d4a0
  1. 4
      src/base/preferences.cpp
  2. 16
      src/base/preferences.h
  3. 2
      src/base/scanfoldersmodel.h
  4. 2
      src/base/torrentfilter.h
  5. 2
      src/base/utils/bytearray.h
  6. 2
      src/base/utils/random.h
  7. 2
      src/base/utils/string.h
  8. 2
      src/gui/mainwindow.h
  9. 2
      src/gui/transferlistsortmodel.h
  10. 6
      src/gui/utils.h
  11. 4
      src/webui/api/searchcontroller.h

4
src/base/preferences.cpp

@ -1186,7 +1186,7 @@ int Preferences::getPropCurTab() const
return value("TorrentProperties/CurrentTab", -1).toInt(); return value("TorrentProperties/CurrentTab", -1).toInt();
} }
void Preferences::setPropCurTab(const int &tab) void Preferences::setPropCurTab(const int tab)
{ {
setValue("TorrentProperties/CurrentTab", tab); setValue("TorrentProperties/CurrentTab", tab);
} }
@ -1356,7 +1356,7 @@ int Preferences::getTransSelFilter() const
return value("TransferListFilters/selectedFilterIndex", 0).toInt(); return value("TransferListFilters/selectedFilterIndex", 0).toInt();
} }
void Preferences::setTransSelFilter(const int &index) void Preferences::setTransSelFilter(const int index)
{ {
setValue("TransferListFilters/selectedFilterIndex", index); setValue("TransferListFilters/selectedFilterIndex", index);
} }

16
src/base/preferences.h

@ -303,7 +303,7 @@ public:
QString getDNSLastIP() const; QString getDNSLastIP() const;
void setDNSLastIP(const QString &ip); void setDNSLastIP(const QString &ip);
bool getAcceptedLegal() const; bool getAcceptedLegal() const;
void setAcceptedLegal(const bool accepted); void setAcceptedLegal(bool accepted);
QByteArray getMainGeometry() const; QByteArray getMainGeometry() const;
void setMainGeometry(const QByteArray &geometry); void setMainGeometry(const QByteArray &geometry);
QByteArray getMainVSplitterState() const; QByteArray getMainVSplitterState() const;
@ -321,9 +321,9 @@ public:
QByteArray getPropFileListState() const; QByteArray getPropFileListState() const;
void setPropFileListState(const QByteArray &state); void setPropFileListState(const QByteArray &state);
int getPropCurTab() const; int getPropCurTab() const;
void setPropCurTab(const int &tab); void setPropCurTab(int tab);
bool getPropVisible() const; bool getPropVisible() const;
void setPropVisible(const bool visible); void setPropVisible(bool visible);
QByteArray getPropTrackerListState() const; QByteArray getPropTrackerListState() const;
void setPropTrackerListState(const QByteArray &state); void setPropTrackerListState(const QByteArray &state);
QSize getRssGeometrySize() const; QSize getRssGeometrySize() const;
@ -351,17 +351,17 @@ public:
bool getTagFilterState() const; bool getTagFilterState() const;
bool getTrackerFilterState() const; bool getTrackerFilterState() const;
int getTransSelFilter() const; int getTransSelFilter() const;
void setTransSelFilter(const int &index); void setTransSelFilter(int index);
QByteArray getTransHeaderState() const; QByteArray getTransHeaderState() const;
void setTransHeaderState(const QByteArray &state); void setTransHeaderState(const QByteArray &state);
bool getRegexAsFilteringPatternForTransferList() const; bool getRegexAsFilteringPatternForTransferList() const;
void setRegexAsFilteringPatternForTransferList(bool checked); void setRegexAsFilteringPatternForTransferList(bool checked);
int getToolbarTextPosition() const; int getToolbarTextPosition() const;
void setToolbarTextPosition(const int position); void setToolbarTextPosition(int position);
// From old RssSettings class // From old RssSettings class
bool isRSSWidgetEnabled() const; bool isRSSWidgetEnabled() const;
void setRSSWidgetVisible(const bool enabled); void setRSSWidgetVisible(bool enabled);
// Network // Network
QList<QNetworkCookie> getNetworkCookies() const; QList<QNetworkCookie> getNetworkCookies() const;
@ -371,9 +371,9 @@ public:
bool isSpeedWidgetEnabled() const; bool isSpeedWidgetEnabled() const;
void setSpeedWidgetEnabled(bool enabled); void setSpeedWidgetEnabled(bool enabled);
int getSpeedWidgetPeriod() const; int getSpeedWidgetPeriod() const;
void setSpeedWidgetPeriod(const int period); void setSpeedWidgetPeriod(int period);
bool getSpeedWidgetGraphEnable(int id) const; bool getSpeedWidgetGraphEnable(int id) const;
void setSpeedWidgetGraphEnable(int id, const bool enable); void setSpeedWidgetGraphEnable(int id, bool enable);
public slots: public slots:
void setStatusFilterState(bool checked); void setStatusFilterState(bool checked);

2
src/base/scanfoldersmodel.h

@ -68,7 +68,7 @@ public:
static void freeInstance(); static void freeInstance();
static ScanFoldersModel *instance(); static ScanFoldersModel *instance();
static QString pathTypeDisplayName(const PathType type); static QString pathTypeDisplayName(PathType type);
int rowCount(const QModelIndex &parent = QModelIndex()) const; int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const;

2
src/base/torrentfilter.h

@ -72,7 +72,7 @@ public:
TorrentFilter(); TorrentFilter();
// category & tags: pass empty string for uncategorized / untagged torrents. // category & tags: pass empty string for uncategorized / untagged torrents.
// Pass null string (QString()) to disable filtering (i.e. all torrents). // Pass null string (QString()) to disable filtering (i.e. all torrents).
TorrentFilter(const Type type, const QStringSet &hashSet = AnyHash, const QString &category = AnyCategory, const QString &tag = AnyTag); TorrentFilter(Type type, const QStringSet &hashSet = AnyHash, const QString &category = AnyCategory, const QString &tag = AnyTag);
TorrentFilter(const QString &filter, const QStringSet &hashSet = AnyHash, const QString &category = AnyCategory, const QString &tags = AnyTag); TorrentFilter(const QString &filter, const QStringSet &hashSet = AnyHash, const QString &category = AnyCategory, const QString &tags = AnyTag);
bool setType(Type type); bool setType(Type type);

2
src/base/utils/bytearray.h

@ -40,6 +40,6 @@ namespace Utils
// 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
const QByteArray midView(const QByteArray &in, const int pos, const int len = -1); const QByteArray midView(const QByteArray &in, int pos, int len = -1);
} }
} }

2
src/base/utils/random.h

@ -35,7 +35,7 @@ namespace Utils
{ {
namespace Random namespace Random
{ {
uint32_t rand(const uint32_t min = 0, const uint32_t max = UINT32_MAX); uint32_t rand(uint32_t min = 0, uint32_t max = UINT32_MAX);
} }
} }

2
src/base/utils/string.h

@ -63,7 +63,7 @@ namespace Utils
return str; return str;
} }
bool parseBool(const QString &string, const bool defaultValue); bool parseBool(const QString &string, bool defaultValue);
TriStateBool parseTriStateBool(const QString &string); TriStateBool parseTriStateBool(const QString &string);
} }
} }

2
src/gui/mainwindow.h

@ -84,7 +84,7 @@ public:
bool isExecutionLogEnabled() const; bool isExecutionLogEnabled() const;
void setExecutionLogEnabled(bool value); void setExecutionLogEnabled(bool value);
int executionLogMsgTypes() const; int executionLogMsgTypes() const;
void setExecutionLogMsgTypes(const int value); void setExecutionLogMsgTypes(int value);
// Notifications properties // Notifications properties
bool isNotificationsEnabled() const; bool isNotificationsEnabled() const;

2
src/gui/transferlistsortmodel.h

@ -52,7 +52,7 @@ public:
private: private:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
bool lowerPositionThan(const QModelIndex &left, const QModelIndex &right) const; bool lowerPositionThan(const QModelIndex &left, const QModelIndex &right) const;
bool dateLessThan(const int dateColumn, const QModelIndex &left, const QModelIndex &right, bool sortInvalidInBottom) const; bool dateLessThan(int dateColumn, const QModelIndex &left, const QModelIndex &right, bool sortInvalidInBottom) const;
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
bool matchFilter(int sourceRow, const QModelIndex &sourceParent) const; bool matchFilter(int sourceRow, const QModelIndex &sourceParent) const;

6
src/gui/utils.h

@ -49,9 +49,9 @@ namespace Utils
return (size * screenScalingFactor(widget)); return (size * screenScalingFactor(widget));
} }
QPixmap scaledPixmap(const QIcon &icon, const QWidget *widget, const int height); QPixmap scaledPixmap(const QIcon &icon, const QWidget *widget, int height);
QPixmap scaledPixmap(const QString &path, const QWidget *widget, const int height = 0); QPixmap scaledPixmap(const QString &path, const QWidget *widget, int height = 0);
QPixmap scaledPixmapSvg(const QString &path, const QWidget *widget, const int baseHeight); QPixmap scaledPixmapSvg(const QString &path, const QWidget *widget, int baseHeight);
QSize smallIconSize(const QWidget *widget = nullptr); QSize smallIconSize(const QWidget *widget = nullptr);
QSize mediumIconSize(const QWidget *widget = nullptr); QSize mediumIconSize(const QWidget *widget = nullptr);
QSize largeIconSize(const QWidget *widget = nullptr); QSize largeIconSize(const QWidget *widget = nullptr);

4
src/webui/api/searchcontroller.h

@ -66,8 +66,8 @@ private:
void checkForUpdatesFinished(const QHash<QString, PluginVersion> &updateInfo); void checkForUpdatesFinished(const QHash<QString, PluginVersion> &updateInfo);
void checkForUpdatesFailed(const QString &reason); void checkForUpdatesFailed(const QString &reason);
void searchFinished(ISession *session, const int id); void searchFinished(ISession *session, int id);
void searchFailed(ISession *session, const int id); void searchFailed(ISession *session, int id);
int generateSearchId() const; int generateSearchId() const;
QJsonObject getResults(const QList<SearchResult> &searchResults, bool isSearchActive, int totalResults) const; QJsonObject getResults(const QList<SearchResult> &searchResults, bool isSearchActive, int totalResults) const;
QJsonArray getPluginsInfo(const QStringList &plugins) const; QJsonArray getPluginsInfo(const QStringList &plugins) const;

Loading…
Cancel
Save