MCPcopy Create free account
hub / github.com/Greedysky/TTKMusicPlayer / currentFileName

Method currentFileName

TTKModule/musicapplication.cpp:119–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119QString 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
138QString MusicApplication::currentFilePath() const
139{

Callers 4

checkMetaDataValidMethod · 0.80
checkLrcValidMethod · 0.80
checkArtistCoverValidMethod · 0.80

Calls 6

QStringClass · 0.85
currentItemMethod · 0.80
itemsMethod · 0.80
currentIndexMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected