diff options
| author | Arno <arno@disconnect.de> | 2018-10-13 00:57:22 +0200 | 
|---|---|---|
| committer | Arno <arno@disconnect.de> | 2018-10-13 00:57:22 +0200 | 
| commit | 6ccb253ceb2f893fc1ba917a6db1792fcfeca8db (patch) | |
| tree | cb46a584b9ae6843c05627c07623510f8c824347 /playerwidget.cpp | |
| parent | 36d643da276a90ed8c8fc920d3e6a150d0bfc809 (diff) | |
| download | BeetPlayer-6ccb253ceb2f893fc1ba917a6db1792fcfeca8db.tar.gz BeetPlayer-6ccb253ceb2f893fc1ba917a6db1792fcfeca8db.tar.bz2 BeetPlayer-6ccb253ceb2f893fc1ba917a6db1792fcfeca8db.zip | |
Fix conversion issues in PlayerWidget
Clang said so, hope it doesn't bite me in the ass...
Diffstat (limited to 'playerwidget.cpp')
| -rw-r--r-- | playerwidget.cpp | 18 | 
1 files changed, 9 insertions, 9 deletions
| diff --git a/playerwidget.cpp b/playerwidget.cpp index 02b5354..71c899b 100644 --- a/playerwidget.cpp +++ b/playerwidget.cpp @@ -576,8 +576,8 @@ void PlayerWidget::fillWithText(QTextEdit *te, const TagLib::FileRef &fr){      QString album = QString::fromStdWString(fr.tag()->album().toWString());      QString title = QString::fromStdWString(fr.tag()->title().toWString());      QString genre = QString::fromStdWString(fr.tag()->genre().toWString()); -    quint16 track = fr.tag()->track(); -    quint16 year = fr.tag()->year(); +    quint32 track = fr.tag()->track(); +    quint32 year = fr.tag()->year();      te->clear();      te->append(QString("%1 %2").arg(tr("Artist:"), -20).arg(artist));      te->append(QString("%1 %2").arg(tr("Album:"), -20).arg(album)); @@ -627,7 +627,7 @@ void PlayerWidget::addSong(const QModelIndex &idx){      item->setText(display);      item->setIcon(QIcon(":/song.png"));      item->setData(idx.data(CollectionWidget::FullPathRole), CollectionWidget::FullPathRole); -    int len = idx.data(CollectionWidget::LengthRole).toInt(); +    quint64 len = idx.data(CollectionWidget::LengthRole).toUInt();      if(len == 0){          len = Helper::lengthInSeconds(idx.data(CollectionWidget::FullPathRole).toString());      } @@ -683,9 +683,9 @@ void PlayerWidget::addToPlayListAndClear(){  void PlayerWidget::removeFromPlayList(){      QModelIndexList sel = mSongView->selectionModel()->selectedRows();      QList<QPersistentModelIndex> persistent; -    int subSecs = 0; +    quint64 subSecs = 0;      for(const QModelIndex &i : sel){ -        subSecs = i.data(CollectionWidget::LengthRole).toInt(); +        subSecs = i.data(CollectionWidget::LengthRole).toUInt();          persistent << QPersistentModelIndex(i);      }      for(const QPersistentModelIndex &i : persistent){ @@ -740,7 +740,7 @@ void PlayerWidget::randomPlay(){          item->setData(randomQ.value(4), CollectionWidget::ArtistRole);          item->setData(randomQ.value(5), CollectionWidget::AlbumRole);          item->setData(randomQ.value(1), CollectionWidget::TitleRole); -        mPlayListLength += randomQ.value(6).toInt(); +        mPlayListLength += randomQ.value(6).toUInt();          root->appendRow(item);      }      emit numFilesChanged(root->rowCount()); @@ -770,7 +770,7 @@ void PlayerWidget::printList(){          QString fp = i.data(CollectionWidget::FullPathRole).toString();          TagLib::FileRef fr(fp.toUtf8());          if(!fr.isNull()){ -            quint16 track = fr.tag()->track(); +            quint32 track = fr.tag()->track();              QString title = QString::fromStdWString(fr.tag()->title().toWString());              int length = fr.audioProperties()->lengthInSeconds();              int minutes = length / 60; @@ -820,7 +820,7 @@ void PlayerWidget::webDlDone(){             return a.at(2).toInt() < b.at(2).toInt();          });          text.append(QString(tr("<b>All Albums (%1):</b><dl>")).arg(QString::number(other.count()))); -        for(const QVariant &vl : other){ +        for(const QVariant vl : other){              QVariantList cur = vl.toList();              QString id = cur.at(0).toString();              QString album = cur.at(1).toString(); @@ -1007,7 +1007,7 @@ void PlayerWidget::slide(int value){      mPlayer->setPosition(newValue);  } -void PlayerWidget::setPosition(qint64 pos){ +void PlayerWidget::setPosition(int pos){      int curPos = pos / 1000;      if(mSongSlider->isEnabled()){          mSongSlider->setValue(curPos); | 
