Fix music display not displaying a stripped down version of the song name

This commit is contained in:
Crystalwarrior 2019-10-06 23:23:52 +03:00
parent 91eeffb959
commit ec02078b4d

View File

@ -2820,8 +2820,7 @@ void Courtroom::handle_song(QStringList *p_contents)
return; return;
QString f_song = f_contents.at(0); QString f_song = f_contents.at(0);
QString f_song_clear = f_song; QString f_song_clear = f_song.left(f_song.lastIndexOf(".")).right(f_song.lastIndexOf("/"));
f_song_clear = f_song_clear.left(f_song_clear.lastIndexOf("."));
int n_char = f_contents.at(1).toInt(); int n_char = f_contents.at(1).toInt();
bool looping = true; bool looping = true;
@ -2843,7 +2842,7 @@ void Courtroom::handle_song(QStringList *p_contents)
music_player->play(f_song, channel, looping, effect_flags); music_player->play(f_song, channel, looping, effect_flags);
if (channel == 0) if (channel == 0)
ui_music_name->setText(f_song); ui_music_name->setText(f_song_clear);
} }
else else
{ {
@ -2886,7 +2885,7 @@ void Courtroom::handle_song(QStringList *p_contents)
music_player->play(f_song, channel, looping, effect_flags); music_player->play(f_song, channel, looping, effect_flags);
if (channel == 0) if (channel == 0)
ui_music_name->setText(f_song); ui_music_name->setText(f_song_clear);
} }
} }
} }