Add/remove reference for parameters

This commit is contained in:
Jonas Kvinge 2023-10-13 22:58:18 +02:00
parent adef05bbdf
commit 13ac20f8b3
9 changed files with 15 additions and 15 deletions

View File

@ -30,7 +30,7 @@ class CollectionQueryOptions {
explicit CollectionQueryOptions();
struct Where {
explicit Where(const QString _column = QString(), const QVariant _value = QString(), const QString _op = QString()) : column(_column), value(_value), op(_op) {}
explicit Where(const QString &_column = QString(), const QVariant &_value = QString(), const QString &_op = QString()) : column(_column), value(_value), op(_op) {}
QString column;
QVariant value;
QString op;

View File

@ -251,7 +251,7 @@ void AlbumCoverLoader::InitArt(TaskPtr task) {
}
AlbumCoverLoader::LoadImageResult AlbumCoverLoader::LoadImage(TaskPtr task, const AlbumCoverLoaderOptions::Type &type) {
AlbumCoverLoader::LoadImageResult AlbumCoverLoader::LoadImage(TaskPtr task, const AlbumCoverLoaderOptions::Type type) {
switch (type) {
case AlbumCoverLoaderOptions::Type::Unset:{

View File

@ -109,7 +109,7 @@ class AlbumCoverLoader : public QObject {
quint64 EnqueueTask(TaskPtr task);
void ProcessTask(TaskPtr task);
void InitArt(TaskPtr task);
LoadImageResult LoadImage(TaskPtr task, const AlbumCoverLoaderOptions::Type &type);
LoadImageResult LoadImage(TaskPtr task, const AlbumCoverLoaderOptions::Type type);
LoadImageResult LoadEmbeddedImage(TaskPtr task);
LoadImageResult LoadUrlImage(TaskPtr task, const AlbumCoverLoaderResult::Type result_type, const QUrl &cover_url);
LoadImageResult LoadLocalUrlImage(TaskPtr task, const AlbumCoverLoaderResult::Type result_type, const QUrl &cover_url);

View File

@ -41,10 +41,10 @@ class AlbumCoverLoaderResult {
explicit AlbumCoverLoaderResult(const bool _success = false,
const Type _type = Type::None,
AlbumCoverImageResult _album_cover = AlbumCoverImageResult(),
const AlbumCoverImageResult &_album_cover = AlbumCoverImageResult(),
const QImage &_image_scaled = QImage(),
const QUrl _art_manual_updated = QUrl(),
const QUrl _art_automatic_updated = QUrl()) :
const QUrl &_art_manual_updated = QUrl(),
const QUrl &_art_automatic_updated = QUrl()) :
success(_success),
type(_type),
album_cover(_album_cover),

View File

@ -44,7 +44,7 @@ QUrl AzLyricsComLyricsProvider::Url(const LyricsSearchRequest &request) {
}
QString AzLyricsComLyricsProvider::StringFixup(QString text) {
QString AzLyricsComLyricsProvider::StringFixup(const QString &text) {
return Utilities::Transliterate(text).remove(QRegularExpression("[^\\w0-9\\-]")).toLower();

View File

@ -42,7 +42,7 @@ class AzLyricsComLyricsProvider : public HtmlLyricsProvider {
QUrl Url(const LyricsSearchRequest &request) override;
private:
QString StringFixup(QString text);
QString StringFixup(const QString &text);
private:
static const char kUrl[];

View File

@ -44,7 +44,7 @@ QUrl ElyricsNetLyricsProvider::Url(const LyricsSearchRequest &request) {
}
QString ElyricsNetLyricsProvider::StringFixup(QString text) {
QString ElyricsNetLyricsProvider::StringFixup(const QString &text) {
return Utilities::Transliterate(text)
.replace(QRegularExpression("[^\\w0-9_,&\\-\\(\\) ]"), "_")

View File

@ -42,7 +42,7 @@ class ElyricsNetLyricsProvider : public HtmlLyricsProvider {
QUrl Url(const LyricsSearchRequest &request) override;
private:
QString StringFixup(QString text);
QString StringFixup(const QString &text);
private:
static const char kUrl[];

View File

@ -131,7 +131,7 @@ class FloatEqComparator : public SearchTermComparator {
class FloatNeComparator : public SearchTermComparator {
public:
explicit FloatNeComparator(const float &value) : search_term_(value) {}
explicit FloatNeComparator(const float value) : search_term_(value) {}
bool Matches(const QString &element) const override {
return search_term_ != element.toFloat();
}
@ -141,7 +141,7 @@ class FloatNeComparator : public SearchTermComparator {
class FloatGtComparator : public SearchTermComparator {
public:
explicit FloatGtComparator(const float &value) : search_term_(value) {}
explicit FloatGtComparator(const float value) : search_term_(value) {}
bool Matches(const QString &element) const override {
return element.toFloat() > search_term_;
}
@ -151,7 +151,7 @@ class FloatGtComparator : public SearchTermComparator {
class FloatGeComparator : public SearchTermComparator {
public:
explicit FloatGeComparator(const float &value) : search_term_(value) {}
explicit FloatGeComparator(const float value) : search_term_(value) {}
bool Matches(const QString &element) const override {
return element.toFloat() >= search_term_;
}
@ -161,7 +161,7 @@ class FloatGeComparator : public SearchTermComparator {
class FloatLtComparator : public SearchTermComparator {
public:
explicit FloatLtComparator(const float &value) : search_term_(value) {}
explicit FloatLtComparator(const float value) : search_term_(value) {}
bool Matches(const QString &element) const override {
return element.toFloat() < search_term_;
}
@ -171,7 +171,7 @@ class FloatLtComparator : public SearchTermComparator {
class FloatLeComparator : public SearchTermComparator {
public:
explicit FloatLeComparator(const float &value) : search_term_(value) {}
explicit FloatLeComparator(const float value) : search_term_(value) {}
bool Matches(const QString &element) const override {
return element.toFloat() <= search_term_;
}