AlbumCoverChoiceController: Move result declaration

This commit is contained in:
Jonas Kvinge 2023-07-02 00:29:19 +02:00
parent d3ee749c14
commit 1d9a052870
1 changed files with 1 additions and 1 deletions

View File

@ -179,13 +179,13 @@ AlbumCoverImageResult AlbumCoverChoiceController::LoadImageFromFile(Song *song)
QString cover_file = QFileDialog::getOpenFileName(this, tr("Load cover from disk"), GetInitialPathForFileDialog(*song, QString()), tr(kLoadImageFileFilter) + ";;" + tr(kAllFilesFilter));
if (cover_file.isEmpty()) return AlbumCoverImageResult();
AlbumCoverImageResult result;
QFile file(cover_file);
if (!file.open(QIODevice::ReadOnly)) {
qLog(Error) << "Failed to open cover file" << cover_file << "for reading:" << file.errorString();
emit Error(tr("Failed to open cover file %1 for reading: %2").arg(cover_file, file.errorString()));
return AlbumCoverImageResult();
}
AlbumCoverImageResult result;
result.image_data = file.readAll();
file.close();
if (result.image_data.isEmpty()) {