Add/remove reference for parameters
This commit is contained in:
parent
adef05bbdf
commit
13ac20f8b3
|
@ -30,7 +30,7 @@ class CollectionQueryOptions {
|
||||||
explicit CollectionQueryOptions();
|
explicit CollectionQueryOptions();
|
||||||
|
|
||||||
struct Where {
|
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;
|
QString column;
|
||||||
QVariant value;
|
QVariant value;
|
||||||
QString op;
|
QString op;
|
||||||
|
|
|
@ -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) {
|
switch (type) {
|
||||||
case AlbumCoverLoaderOptions::Type::Unset:{
|
case AlbumCoverLoaderOptions::Type::Unset:{
|
||||||
|
|
|
@ -109,7 +109,7 @@ class AlbumCoverLoader : public QObject {
|
||||||
quint64 EnqueueTask(TaskPtr task);
|
quint64 EnqueueTask(TaskPtr task);
|
||||||
void ProcessTask(TaskPtr task);
|
void ProcessTask(TaskPtr task);
|
||||||
void InitArt(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 LoadEmbeddedImage(TaskPtr task);
|
||||||
LoadImageResult LoadUrlImage(TaskPtr task, const AlbumCoverLoaderResult::Type result_type, const QUrl &cover_url);
|
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);
|
LoadImageResult LoadLocalUrlImage(TaskPtr task, const AlbumCoverLoaderResult::Type result_type, const QUrl &cover_url);
|
||||||
|
|
|
@ -41,10 +41,10 @@ class AlbumCoverLoaderResult {
|
||||||
|
|
||||||
explicit AlbumCoverLoaderResult(const bool _success = false,
|
explicit AlbumCoverLoaderResult(const bool _success = false,
|
||||||
const Type _type = Type::None,
|
const Type _type = Type::None,
|
||||||
AlbumCoverImageResult _album_cover = AlbumCoverImageResult(),
|
const AlbumCoverImageResult &_album_cover = AlbumCoverImageResult(),
|
||||||
const QImage &_image_scaled = QImage(),
|
const QImage &_image_scaled = QImage(),
|
||||||
const QUrl _art_manual_updated = QUrl(),
|
const QUrl &_art_manual_updated = QUrl(),
|
||||||
const QUrl _art_automatic_updated = QUrl()) :
|
const QUrl &_art_automatic_updated = QUrl()) :
|
||||||
success(_success),
|
success(_success),
|
||||||
type(_type),
|
type(_type),
|
||||||
album_cover(_album_cover),
|
album_cover(_album_cover),
|
||||||
|
|
|
@ -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();
|
return Utilities::Transliterate(text).remove(QRegularExpression("[^\\w0-9\\-]")).toLower();
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ class AzLyricsComLyricsProvider : public HtmlLyricsProvider {
|
||||||
QUrl Url(const LyricsSearchRequest &request) override;
|
QUrl Url(const LyricsSearchRequest &request) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString StringFixup(QString text);
|
QString StringFixup(const QString &text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const char kUrl[];
|
static const char kUrl[];
|
||||||
|
|
|
@ -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)
|
return Utilities::Transliterate(text)
|
||||||
.replace(QRegularExpression("[^\\w0-9_,&\\-\\(\\) ]"), "_")
|
.replace(QRegularExpression("[^\\w0-9_,&\\-\\(\\) ]"), "_")
|
||||||
|
|
|
@ -42,7 +42,7 @@ class ElyricsNetLyricsProvider : public HtmlLyricsProvider {
|
||||||
QUrl Url(const LyricsSearchRequest &request) override;
|
QUrl Url(const LyricsSearchRequest &request) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString StringFixup(QString text);
|
QString StringFixup(const QString &text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const char kUrl[];
|
static const char kUrl[];
|
||||||
|
|
|
@ -131,7 +131,7 @@ class FloatEqComparator : public SearchTermComparator {
|
||||||
|
|
||||||
class FloatNeComparator : public SearchTermComparator {
|
class FloatNeComparator : public SearchTermComparator {
|
||||||
public:
|
public:
|
||||||
explicit FloatNeComparator(const float &value) : search_term_(value) {}
|
explicit FloatNeComparator(const float value) : search_term_(value) {}
|
||||||
bool Matches(const QString &element) const override {
|
bool Matches(const QString &element) const override {
|
||||||
return search_term_ != element.toFloat();
|
return search_term_ != element.toFloat();
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ class FloatNeComparator : public SearchTermComparator {
|
||||||
|
|
||||||
class FloatGtComparator : public SearchTermComparator {
|
class FloatGtComparator : public SearchTermComparator {
|
||||||
public:
|
public:
|
||||||
explicit FloatGtComparator(const float &value) : search_term_(value) {}
|
explicit FloatGtComparator(const float value) : search_term_(value) {}
|
||||||
bool Matches(const QString &element) const override {
|
bool Matches(const QString &element) const override {
|
||||||
return element.toFloat() > search_term_;
|
return element.toFloat() > search_term_;
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ class FloatGtComparator : public SearchTermComparator {
|
||||||
|
|
||||||
class FloatGeComparator : public SearchTermComparator {
|
class FloatGeComparator : public SearchTermComparator {
|
||||||
public:
|
public:
|
||||||
explicit FloatGeComparator(const float &value) : search_term_(value) {}
|
explicit FloatGeComparator(const float value) : search_term_(value) {}
|
||||||
bool Matches(const QString &element) const override {
|
bool Matches(const QString &element) const override {
|
||||||
return element.toFloat() >= search_term_;
|
return element.toFloat() >= search_term_;
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ class FloatGeComparator : public SearchTermComparator {
|
||||||
|
|
||||||
class FloatLtComparator : public SearchTermComparator {
|
class FloatLtComparator : public SearchTermComparator {
|
||||||
public:
|
public:
|
||||||
explicit FloatLtComparator(const float &value) : search_term_(value) {}
|
explicit FloatLtComparator(const float value) : search_term_(value) {}
|
||||||
bool Matches(const QString &element) const override {
|
bool Matches(const QString &element) const override {
|
||||||
return element.toFloat() < search_term_;
|
return element.toFloat() < search_term_;
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ class FloatLtComparator : public SearchTermComparator {
|
||||||
|
|
||||||
class FloatLeComparator : public SearchTermComparator {
|
class FloatLeComparator : public SearchTermComparator {
|
||||||
public:
|
public:
|
||||||
explicit FloatLeComparator(const float &value) : search_term_(value) {}
|
explicit FloatLeComparator(const float value) : search_term_(value) {}
|
||||||
bool Matches(const QString &element) const override {
|
bool Matches(const QString &element) const override {
|
||||||
return element.toFloat() <= search_term_;
|
return element.toFloat() <= search_term_;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue