Formatting

This commit is contained in:
Jonas Kvinge
2021-07-11 09:49:38 +02:00
parent a6742d401c
commit e48b7d83a3
161 changed files with 370 additions and 369 deletions

View File

@@ -81,7 +81,7 @@ class AlbumCoverFetcherSearch : public QObject {
void AllProvidersFinished();
void FetchMoreImages();
static float ScoreImage(const QSize size) ;
static float ScoreImage(const QSize size);
void SendBestImage();
static bool ProviderCompareOrder(CoverProvider *a, CoverProvider *b);

View File

@@ -516,7 +516,7 @@ void AlbumCoverLoader::RemoteFetchFinished(QNetworkReply *reply, const QUrl &cov
QImage image_scaled;
QImage image_thumbnail;
if (task.options.scale_output_image_) image_scaled = ImageUtils::ScaleAndPad(image, task.options.scale_output_image_, task.options.pad_output_image_, task.options.desired_height_);
if (task.options.create_thumbnail_) image_thumbnail = ImageUtils::CreateThumbnail(image, task.options.pad_thumbnail_image_, task.options.thumbnail_size_);
if (task.options.create_thumbnail_) image_thumbnail = ImageUtils::CreateThumbnail(image, task.options.pad_thumbnail_image_, task.options.thumbnail_size_);
emit AlbumCoverLoaded(task.id, AlbumCoverLoaderResult(true, task.type, AlbumCoverImageResult(cover_url, mime_type, (task.options.get_image_data_ ? image_data : QByteArray()), image), image_scaled, image_thumbnail, task.art_updated));
return;
}
@@ -615,7 +615,7 @@ void AlbumCoverLoader::SaveEmbeddedCover(const qint64 id, const QString &song_fi
QFile file(cover_filename);
if (file.size() >= 209715200 || !file.open(QIODevice::ReadOnly)) { // Max 200 MB.
if (file.size() >= 209715200 || !file.open(QIODevice::ReadOnly)) { // Max 200 MB.
emit SaveEmbeddedCoverAsyncFinished(id, false, false);
return;
}
@@ -656,7 +656,7 @@ void AlbumCoverLoader::SaveEmbeddedCover(const qint64 id, const QList<QUrl> &url
QFile file(cover_filename);
if (file.size() >= 209715200 || !file.open(QIODevice::ReadOnly)) { // Max 200 MB.
if (file.size() >= 209715200 || !file.open(QIODevice::ReadOnly)) { // Max 200 MB.
emit SaveEmbeddedCoverAsyncFinished(id, false, false);
return;
}

View File

@@ -52,7 +52,7 @@ class Application;
class Ui_AlbumCoverSearcher;
class SizeOverlayDelegate : public QStyledItemDelegate {
Q_OBJECT
Q_OBJECT
public:
static const int kMargin;

View File

@@ -53,7 +53,7 @@ CoverFromURLDialog::~CoverFromURLDialog() {
AlbumCoverImageResult CoverFromURLDialog::Exec() {
// reset state
ui_->url->setText("");;
ui_->url->setText("");
last_album_cover_ = AlbumCoverImageResult();
QClipboard *clipboard = QApplication::clipboard();

View File

@@ -85,4 +85,4 @@ class CoverProvider : public QObject {
};
#endif // COVERPROVIDER_H
#endif // COVERPROVIDER_H

View File

@@ -49,4 +49,4 @@ struct CoverSearchStatistics {
};
#endif // COVERSEARCHSTATISTICS_H
#endif // COVERSEARCHSTATISTICS_H

View File

@@ -231,7 +231,7 @@ void DeezerCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id)
}
QJsonObject json_obj = json_value.toObject();
QJsonObject obj_album;
if (json_obj.contains("album") && json_obj["album"].isObject()) { // Song search, so extract the album.
if (json_obj.contains("album") && json_obj["album"].isObject()) { // Song search, so extract the album.
obj_album = json_obj["album"].toObject();
}
else {

View File

@@ -334,7 +334,7 @@ void DiscogsCoverProvider::StartReleaseRequest(std::shared_ptr<DiscogsCoverSearc
void DiscogsCoverProvider::SendReleaseRequest(const DiscogsCoverReleaseContext &release) {
QNetworkReply *reply = CreateRequest(release.url);
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, release]() { HandleReleaseReply(reply, release.search_id, release.id); } );
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, release]() { HandleReleaseReply(reply, release.search_id, release.id); });
}
@@ -431,7 +431,7 @@ void DiscogsCoverProvider::HandleReleaseReply(QNetworkReply *reply, const int se
continue;
}
QJsonObject obj_image = value_image.toObject();
if (!obj_image.contains("type") || !obj_image.contains("resource_url") || !obj_image.contains("width") || !obj_image.contains("height") ) {
if (!obj_image.contains("type") || !obj_image.contains("resource_url") || !obj_image.contains("width") || !obj_image.contains("height")) {
Error("Invalid Json reply, images array value object is missing type, resource_url, width or height.", obj_image);
continue;
}

View File

@@ -177,7 +177,7 @@ void MusicbrainzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
continue;
}
QJsonObject obj_release = value_release.toObject();
if (!obj_release.contains("id") || !obj_release.contains("artist-credit") || !obj_release.contains("title")) {
if (!obj_release.contains("id") || !obj_release.contains("artist-credit") || !obj_release.contains("title")) {
Error("Invalid Json reply, releases array object is missing id, artist-credit or title.", obj_release);
continue;
}
@@ -197,7 +197,7 @@ void MusicbrainzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
}
QJsonObject obj_artist = value_artist.toObject();
if (!obj_artist.contains("artist") ) {
if (!obj_artist.contains("artist")) {
Error("Invalid Json reply, artist is missing.", obj_artist);
continue;
}
@@ -208,7 +208,7 @@ void MusicbrainzCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
}
QJsonObject obj_artist2 = value_artist2.toObject();
if (!obj_artist2.contains("name") ) {
if (!obj_artist2.contains("name")) {
Error("Invalid Json reply, artist is missing name.", value_artist2);
continue;
}

View File

@@ -144,7 +144,7 @@ void MusixmatchCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
return;
}
if (content_json.contains(QRegularExpression("<[^>]*>"))) { // Make sure it's not HTML code.
if (content_json.contains(QRegularExpression("<[^>]*>"))) { // Make sure it's not HTML code.
emit SearchFinished(id, results);
return;
}