diff options
-rw-r--r-- | playerwidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp index f0bb6cf..976da48 100644 --- a/playerwidget.cpp +++ b/playerwidget.cpp @@ -219,6 +219,7 @@ void PlayerWidget::populateBySong(QStandardItem *parent, const QString &filter){ curSong->setFont(QFont("courier")); QString songText = QString(tr("%1 %2 (%3)")).arg(QChar(0x266C)).arg(songQ.value(1).toString()).arg(songQ.value(4).toString()); curSong->setText(songText); + curSong->setData(Song, TypeRole); curSong->setData(songQ.value(0), IdRole); curSong->setData(songQ.value(2), FullPathRole); curSong->setData(songQ.value(3), GenreRole); @@ -246,8 +247,7 @@ void PlayerWidget::populateByGenre(QStandardItem *parent, const QString &filter) curGenre->setData(genreQ.value(0), IdRole); root->appendRow(curGenre); QSqlQuery songQ = QSqlQuery(db); - //songQ.prepare("SELECT sipos, ttitle, tfullpath, igenres_id, artists.tartists_name FROM songs, artists WHERE igenres_id = :id AND songs.iartists_id = artists.iartists_id ORDER BY ttitle ASC"); - songQ.prepare("SELECT sipos, ttitle, tfullpath, igenres_id, artists.tartists_name, albums.talbum_name FROM songs, artists, albums WHERE ttitle ~ :f AND songs.iartists_id = artists.iartists_id and songs.ialbums_id = albums.ialbums_id ORDER BY ttitle ASC"); + songQ.prepare("SELECT sipos, ttitle, tfullpath, igenres_id, artists.tartists_name, albums.talbum_name FROM songs, artists, albums WHERE igenres_id = :id AND songs.iartists_id = artists.iartists_id AND songs.ialbums_id = albums.ialbums_id ORDER BY ttitle ASC"); songQ.bindValue(":id", genreQ.value(0)); songQ.exec(); while(songQ.next()){ |