void PlaylistView::openContainingFolder() { PlaylistModel *playlistModel = dynamic_cast<PlaylistModel *>(this->model()); if (playlistModel == nullptr) { return; } QModelIndex i = this->currentIndex(); if (i.isValid()) { int row = i.row(); const Song *s = playlistModel->getPlaylist()->getSong(row); QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(::mydirname(s->Filename)))); } }
void PlaylistView::showInspector() { PlaylistModel *playlistModel = dynamic_cast<PlaylistModel *>(this->model()); if (playlistModel == nullptr) { return; } QModelIndex i = this->currentIndex(); if (i.isValid()) { int row = i.row(); const Song *s = playlistModel->getPlaylist()->getSong(row); SongInspector *insp = new SongInspector(s, this); insp->setAttribute(Qt::WA_DeleteOnClose); insp->show(); } }