| 117 | } |
| 118 | |
| 119 | QString MusicApplication::currentFileName() const |
| 120 | { |
| 121 | if(m_playlist->currentIndex() < 0 || m_currentPlaylistRow < 0) |
| 122 | { |
| 123 | return {}; |
| 124 | } |
| 125 | |
| 126 | const MusicPlayItem &item = m_playlist->currentItem(); |
| 127 | const MusicSongItemList &items = m_songTreeWidget->items(); |
| 128 | |
| 129 | if(0 <= m_currentPlaylistRow && m_currentPlaylistRow < items.count()) |
| 130 | { |
| 131 | const MusicSongList &songs = items[m_currentPlaylistRow].m_songs; |
| 132 | const int index = m_songTreeWidget->mapSongIndexByFilePath(m_currentPlaylistRow, item.m_path); |
| 133 | return (index != -1) ? songs[index].name() : QString(); |
| 134 | } |
| 135 | return {}; |
| 136 | } |
| 137 | |
| 138 | QString MusicApplication::currentFilePath() const |
| 139 | { |
no test coverage detected