diff --git a/gui/picturepreviewselection.cpp b/gui/picturepreviewselection.cpp index 8671a6e..084fcb8 100644 --- a/gui/picturepreviewselection.cpp +++ b/gui/picturepreviewselection.cpp @@ -80,7 +80,7 @@ PicturePreviewSelection::~PicturePreviewSelection() */ void PicturePreviewSelection::setValue(const TagValue &value, PreviousValueHandling previousValueHandling) { - assert(m_currentTypeIndex < static_cast(m_values.size())); + assert(m_currentTypeIndex < m_values.size()); TagValue ¤tValue = m_values[m_currentTypeIndex]; if(previousValueHandling == PreviousValueHandling::Clear || !value.isEmpty()) { if(previousValueHandling != PreviousValueHandling::Keep || currentValue.isEmpty()) { @@ -95,7 +95,7 @@ void PicturePreviewSelection::setValue(const TagValue &value, PreviousValueHandl * \brief Defines the predicate to get relevant fields. */ template -bool fieldPredicate(unsigned int i, const std::pair &pair) +bool fieldPredicate(int i, const std::pair &pair) { return pair.second.isTypeInfoAssigned() ? (pair.second.typeInfo() == i) : (i == 0); } @@ -238,7 +238,7 @@ void pushId3v2CoverValues(TagType *tag, KnownField field, const QList, index, placeholders::_1)); if(pair != range.second) { @@ -302,7 +302,7 @@ void PicturePreviewSelection::clear() */ void PicturePreviewSelection::addOfSelectedType() { - assert(m_currentTypeIndex < static_cast(m_values.size())); + assert(m_currentTypeIndex < m_values.size()); QString path = QFileDialog::getOpenFileName(this, tr("Select a picture to add as cover")); if(!path.isEmpty()) { addOfSelectedType(path); @@ -314,7 +314,7 @@ void PicturePreviewSelection::addOfSelectedType() */ void PicturePreviewSelection::addOfSelectedType(const QString &path) { - assert(m_currentTypeIndex < static_cast(m_values.size())); + assert(m_currentTypeIndex < m_values.size()); TagValue &selectedCover = m_values[m_currentTypeIndex]; try { MediaFileInfo fileInfo(toNativeFileName(path).constData()); @@ -366,7 +366,7 @@ void PicturePreviewSelection::removeSelected() */ void PicturePreviewSelection::extractSelected() { - assert(m_currentTypeIndex < static_cast(m_values.size())); + assert(m_currentTypeIndex < m_values.size()); TagValue &value = m_values[m_currentTypeIndex]; if(value.isEmpty()) { QMessageBox::information(this, QApplication::applicationName(), tr("There is no image attached to be extracted.")); @@ -393,7 +393,7 @@ void PicturePreviewSelection::extractSelected() */ void PicturePreviewSelection::displaySelected() { - assert(m_currentTypeIndex < static_cast(m_values.size())); + assert(m_currentTypeIndex < m_values.size()); TagValue &value = m_values[m_currentTypeIndex]; if(!value.isEmpty()) { QImage img; @@ -435,7 +435,7 @@ void PicturePreviewSelection::displaySelected() */ void PicturePreviewSelection::changeMimeTypeOfSelected() { - assert(m_currentTypeIndex < static_cast(m_values.size())); + assert(m_currentTypeIndex < m_values.size()); TagValue &selectedCover = m_values[m_currentTypeIndex]; auto mimeType = QString::fromUtf8(selectedCover.mimeType().data()); bool ok; @@ -525,12 +525,12 @@ void PicturePreviewSelection::dropEvent(QDropEvent *event) */ void PicturePreviewSelection::typeSwitched(int index) { - assert(m_currentTypeIndex < static_cast(m_values.size())); + assert(m_currentTypeIndex < m_values.size()); int lastIndex = m_currentTypeIndex; if(index < 0 || index >= m_values.size()) { throw logic_error("current type index is invalid"); } else { - m_currentTypeIndex = static_cast(index); + m_currentTypeIndex = index; } updateDescription(lastIndex, index); updatePreview(index); diff --git a/gui/picturepreviewselection.h b/gui/picturepreviewselection.h index 8d34f98..b4a310b 100644 --- a/gui/picturepreviewselection.h +++ b/gui/picturepreviewselection.h @@ -82,7 +82,7 @@ private: Media::Tag *m_tag; Media::KnownField m_field; QList m_values; - unsigned int m_currentTypeIndex; + int m_currentTypeIndex; }; /*!