Skip to content

Commit

Permalink
Remove warning boxes
Browse files Browse the repository at this point in the history
- as all fields are always overwritten when the user choose "reload" them,
it did not make sense having warning boxes (to warn about cases of overwriting) just for covers...
  • Loading branch information
cardinot committed Jul 18, 2014
1 parent fe2a796 commit cce6a05
Showing 1 changed file with 4 additions and 36 deletions.
40 changes: 4 additions & 36 deletions src/dlgtrackinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,42 +472,10 @@ void DlgTrackInfo::reloadTrackMetadata() {
}

void DlgTrackInfo::reloadEmbeddedCover() {
CoverArtCache* covercache = CoverArtCache::instance();
QString md5Hash = covercache->getHashOfEmbeddedCover(
m_pLoadedTrack->getLocation());

QString msg;
reloadCoverCases reloadCase = LOAD;
if (md5Hash.isEmpty() && !m_sLoadedMd5Hash.isEmpty()) {
reloadCase = UNSET;
msg = tr("The current track does not have an embedded cover art.\n"
"Do you want to unset the current cover art?");
} else if (md5Hash != m_sLoadedMd5Hash) {
reloadCase = CHANGE;
msg = tr("The current cover art is different from the embedded cover art.\n"
"Do you want to load the embedded cover art?");
}

if (reloadCase == LOAD) {
if (!md5Hash.isEmpty()) {
m_sLoadedCoverLocation.clear();
m_sLoadedMd5Hash = md5Hash;
covercache->requestPixmap(m_pLoadedTrack->getId());
}
return;
}

QMessageBox::StandardButton reply;
reply = QMessageBox::question(this, tr("Reload Embedded Cover Art"), msg,
QMessageBox::Yes|QMessageBox::No);
if (reply == QMessageBox::Yes) {
if (reloadCase == UNSET) {
slotUnsetCoverArt();
} else if (reloadCase == CHANGE) {
m_sLoadedCoverLocation.clear();
m_sLoadedMd5Hash = md5Hash;
covercache->requestPixmap(m_pLoadedTrack->getId());
}
if (m_pLoadedTrack) {
m_sLoadedCoverLocation.clear();
m_sLoadedMd5Hash.clear();
CoverArtCache::instance()->requestPixmap(m_pLoadedTrack->getId());
}
}

Expand Down

0 comments on commit cce6a05

Please sign in to comment.