Commit 1e81d6e4 authored by Urs Fleisch's avatar Urs Fleisch
Browse files

do not import from Tag 1 if Tag 1 is not supported

parent b27b5f38
......@@ -187,6 +187,16 @@ ImportConfig::ImportDestination ImportDialog::getDestination() const
return m_impsel->getDestination();
}
/**
* Set import destination.
*
* @param dest DestV1, DestV2 or DestV1V2 for ID3v1, ID3v2 or both
*/
void ImportDialog::setDestination(ImportConfig::ImportDestination dest)
{
m_impsel->setDestination(dest);
}
/**
* Set the format lineedits.
*
......
......@@ -93,6 +93,13 @@ public:
*/
ImportConfig::ImportDestination getDestination() const;
/**
* Set import destination.
*
* @param dest DestV1, DestV2 or DestV1V2 for ID3v1, ID3v2 or both
*/
void setDestination(ImportConfig::ImportDestination dest);
/**
* Set the format lineedits.
*
......
......@@ -901,6 +901,16 @@ ImportConfig::ImportDestination ImportSelector::getDestination()
m_destComboBox->QCM_currentIndex());
}
/**
* Set import destination.
*
* @param dest DestV1, DestV2 or DestV1V2 for ID3v1, ID3v2 or both
*/
void ImportSelector::setDestination(ImportConfig::ImportDestination dest)
{
m_destComboBox->QCM_setCurrentIndex(dest);
}
/**
* Save the local settings to the configuration.
*
......
......@@ -116,6 +116,13 @@ public:
*/
ImportConfig::ImportDestination getDestination();
/**
* Set import destination.
*
* @param dest DestV1, DestV2 or DestV1V2 for ID3v1, ID3v2 or both
*/
void setDestination(ImportConfig::ImportDestination dest);
/**
* Get list with track durations.
*
......
......@@ -1720,6 +1720,7 @@ void Kid3App::setupImportDialog()
m_trackDataList.clear();
FileListItem* mp3file = m_view->firstFileInDir();
bool firstTrack = true;
bool tag1Supported = true;
while (mp3file != 0) {
mp3file->getFile()->readTags(false);
if (firstTrack) {
......@@ -1731,6 +1732,7 @@ void Kid3App::setupImportDialog()
m_trackDataList.m_artist = st.artist;
m_trackDataList.m_album = st.album;
firstTrack = false;
tag1Supported = mp3file->getFile()->isTagV1Supported();
}
m_trackDataList.push_back(ImportTrackData(mp3file->getFile()->getAbsFilename(),
mp3file->getFile()->getDuration()));
......@@ -1744,6 +1746,10 @@ void Kid3App::setupImportDialog()
}
if (m_importDialog) {
m_importDialog->clear();
if (!tag1Supported &&
m_importDialog->getDestination() == ImportConfig::DestV1) {
m_importDialog->setDestination(ImportConfig::DestV2);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment