diff options
| author | Cerapter <cerap@protonmail.com> | 2018-08-14 17:06:23 +0200 |
|---|---|---|
| committer | Cerapter <cerap@protonmail.com> | 2018-08-14 17:06:23 +0200 |
| commit | 0f8cb919e289d433d8a7e84b16b934c2b04c7dd2 (patch) | |
| tree | bb97eba956993a11cfeca3815bfa484186905cc9 | |
| parent | f81a9adc99cb03c63fc05689697dfac7f287dc07 (diff) | |
Fixed a bug where the music being played would depend on the row selected.
| -rw-r--r-- | courtroom.cpp | 5 | ||||
| -rw-r--r-- | courtroom.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/courtroom.cpp b/courtroom.cpp index 1b24bd38..8d500157 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -790,6 +790,7 @@ void Courtroom::enter_courtroom(int p_cid) void Courtroom::list_music() { ui_music_list->clear(); + music_row_to_number.clear(); QString f_file = "courtroom_design.ini"; @@ -807,6 +808,7 @@ void Courtroom::list_music() if (i_song.toLower().contains(ui_music_search->text().toLower())) { ui_music_list->addItem(i_song_listname); + music_row_to_number.append(n_song); QString song_path = ao_app->get_base_path() + "sounds/music/" + i_song.toLower(); @@ -2404,8 +2406,7 @@ void Courtroom::on_music_list_double_clicked(QModelIndex p_model) if (is_muted) return; - //QString p_song = ui_music_list->item(p_model.row())->text(); - QString p_song = music_list.at(p_model.row()); + QString p_song = music_list.at(music_row_to_number.at(p_model.row())); if (!ui_ic_chat_name->text().isEmpty()) { diff --git a/courtroom.h b/courtroom.h index 1cc2ed4a..8a93543d 100644 --- a/courtroom.h +++ b/courtroom.h @@ -191,6 +191,8 @@ private: QSignalMapper *char_button_mapper; + QVector<int> music_row_to_number; + //triggers ping_server() every 60 seconds QTimer *keepalive_timer; |
