mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-24 18:44:52 +08:00
Remove const in declarations' arguments that are passed by value
This commit is contained in:
parent
70f1537d9f
commit
8a19a0d4a0
@ -1186,7 +1186,7 @@ int Preferences::getPropCurTab() const
|
||||
return value("TorrentProperties/CurrentTab", -1).toInt();
|
||||
}
|
||||
|
||||
void Preferences::setPropCurTab(const int &tab)
|
||||
void Preferences::setPropCurTab(const int tab)
|
||||
{
|
||||
setValue("TorrentProperties/CurrentTab", tab);
|
||||
}
|
||||
@ -1356,7 +1356,7 @@ int Preferences::getTransSelFilter() const
|
||||
return value("TransferListFilters/selectedFilterIndex", 0).toInt();
|
||||
}
|
||||
|
||||
void Preferences::setTransSelFilter(const int &index)
|
||||
void Preferences::setTransSelFilter(const int index)
|
||||
{
|
||||
setValue("TransferListFilters/selectedFilterIndex", index);
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ public:
|
||||
QString getDNSLastIP() const;
|
||||
void setDNSLastIP(const QString &ip);
|
||||
bool getAcceptedLegal() const;
|
||||
void setAcceptedLegal(const bool accepted);
|
||||
void setAcceptedLegal(bool accepted);
|
||||
QByteArray getMainGeometry() const;
|
||||
void setMainGeometry(const QByteArray &geometry);
|
||||
QByteArray getMainVSplitterState() const;
|
||||
@ -321,9 +321,9 @@ public:
|
||||
QByteArray getPropFileListState() const;
|
||||
void setPropFileListState(const QByteArray &state);
|
||||
int getPropCurTab() const;
|
||||
void setPropCurTab(const int &tab);
|
||||
void setPropCurTab(int tab);
|
||||
bool getPropVisible() const;
|
||||
void setPropVisible(const bool visible);
|
||||
void setPropVisible(bool visible);
|
||||
QByteArray getPropTrackerListState() const;
|
||||
void setPropTrackerListState(const QByteArray &state);
|
||||
QSize getRssGeometrySize() const;
|
||||
@ -351,17 +351,17 @@ public:
|
||||
bool getTagFilterState() const;
|
||||
bool getTrackerFilterState() const;
|
||||
int getTransSelFilter() const;
|
||||
void setTransSelFilter(const int &index);
|
||||
void setTransSelFilter(int index);
|
||||
QByteArray getTransHeaderState() const;
|
||||
void setTransHeaderState(const QByteArray &state);
|
||||
bool getRegexAsFilteringPatternForTransferList() const;
|
||||
void setRegexAsFilteringPatternForTransferList(bool checked);
|
||||
int getToolbarTextPosition() const;
|
||||
void setToolbarTextPosition(const int position);
|
||||
void setToolbarTextPosition(int position);
|
||||
|
||||
// From old RssSettings class
|
||||
bool isRSSWidgetEnabled() const;
|
||||
void setRSSWidgetVisible(const bool enabled);
|
||||
void setRSSWidgetVisible(bool enabled);
|
||||
|
||||
// Network
|
||||
QList<QNetworkCookie> getNetworkCookies() const;
|
||||
@ -371,9 +371,9 @@ public:
|
||||
bool isSpeedWidgetEnabled() const;
|
||||
void setSpeedWidgetEnabled(bool enabled);
|
||||
int getSpeedWidgetPeriod() const;
|
||||
void setSpeedWidgetPeriod(const int period);
|
||||
void setSpeedWidgetPeriod(int period);
|
||||
bool getSpeedWidgetGraphEnable(int id) const;
|
||||
void setSpeedWidgetGraphEnable(int id, const bool enable);
|
||||
void setSpeedWidgetGraphEnable(int id, bool enable);
|
||||
|
||||
public slots:
|
||||
void setStatusFilterState(bool checked);
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
static void freeInstance();
|
||||
static ScanFoldersModel *instance();
|
||||
|
||||
static QString pathTypeDisplayName(const PathType type);
|
||||
static QString pathTypeDisplayName(PathType type);
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
TorrentFilter();
|
||||
// category & tags: pass empty string for uncategorized / untagged 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);
|
||||
|
||||
bool setType(Type type);
|
||||
|
@ -40,6 +40,6 @@ namespace Utils
|
||||
|
||||
// Mimic QByteArray::mid(pos, len) but instead of returning a full-copy,
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace Utils
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ namespace Utils
|
||||
return str;
|
||||
}
|
||||
|
||||
bool parseBool(const QString &string, const bool defaultValue);
|
||||
bool parseBool(const QString &string, bool defaultValue);
|
||||
TriStateBool parseTriStateBool(const QString &string);
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
bool isExecutionLogEnabled() const;
|
||||
void setExecutionLogEnabled(bool value);
|
||||
int executionLogMsgTypes() const;
|
||||
void setExecutionLogMsgTypes(const int value);
|
||||
void setExecutionLogMsgTypes(int value);
|
||||
|
||||
// Notifications properties
|
||||
bool isNotificationsEnabled() const;
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
private:
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
|
||||
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 matchFilter(int sourceRow, const QModelIndex &sourceParent) const;
|
||||
|
||||
|
@ -49,9 +49,9 @@ namespace Utils
|
||||
return (size * screenScalingFactor(widget));
|
||||
}
|
||||
|
||||
QPixmap scaledPixmap(const QIcon &icon, const QWidget *widget, const int height);
|
||||
QPixmap scaledPixmap(const QString &path, const QWidget *widget, const int height = 0);
|
||||
QPixmap scaledPixmapSvg(const QString &path, const QWidget *widget, const int baseHeight);
|
||||
QPixmap scaledPixmap(const QIcon &icon, const QWidget *widget, int height);
|
||||
QPixmap scaledPixmap(const QString &path, const QWidget *widget, int height = 0);
|
||||
QPixmap scaledPixmapSvg(const QString &path, const QWidget *widget, int baseHeight);
|
||||
QSize smallIconSize(const QWidget *widget = nullptr);
|
||||
QSize mediumIconSize(const QWidget *widget = nullptr);
|
||||
QSize largeIconSize(const QWidget *widget = nullptr);
|
||||
|
@ -66,8 +66,8 @@ private:
|
||||
|
||||
void checkForUpdatesFinished(const QHash<QString, PluginVersion> &updateInfo);
|
||||
void checkForUpdatesFailed(const QString &reason);
|
||||
void searchFinished(ISession *session, const int id);
|
||||
void searchFailed(ISession *session, const int id);
|
||||
void searchFinished(ISession *session, int id);
|
||||
void searchFailed(ISession *session, int id);
|
||||
int generateSearchId() const;
|
||||
QJsonObject getResults(const QList<SearchResult> &searchResults, bool isSearchActive, int totalResults) const;
|
||||
QJsonArray getPluginsInfo(const QStringList &plugins) const;
|
||||
|
Loading…
Reference in New Issue
Block a user