| 136 | } |
| 137 | |
| 138 | QString MusicApplication::currentFilePath() const |
| 139 | { |
| 140 | if(m_playlist->currentIndex() < 0 || m_currentPlaylistRow < 0) |
| 141 | { |
| 142 | return {}; |
| 143 | } |
| 144 | |
| 145 | const MusicPlayItem &item = m_playlist->currentItem(); |
| 146 | const MusicSongItemList &items = m_songTreeWidget->items(); |
| 147 | |
| 148 | if(0 <= m_currentPlaylistRow && m_currentPlaylistRow < items.count()) |
| 149 | { |
| 150 | const MusicSongList &songs = items[m_currentPlaylistRow].m_songs; |
| 151 | const int index = m_songTreeWidget->mapSongIndexByFilePath(m_currentPlaylistRow, item.m_path); |
| 152 | return (index != -1) ? songs[index].path() : QString(); |
| 153 | } |
| 154 | return {}; |
| 155 | } |
| 156 | |
| 157 | bool MusicApplication::checkMusicListCurrentIndex() const |
| 158 | { |
no test coverage detected