diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-10-12 01:43:48 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-10-12 01:43:48 +0300 |
| commit | 330aa9755095cd4f12f028452d268c50311d3710 (patch) | |
| tree | b5fb6bf39032266db2151cd118c0cee71459558c /src/courtroom.cpp | |
| parent | 990f653e4a063a684b5d5584c7454c36a1036a85 (diff) | |
Properly handle "true song name" even with folders/categories and file formats (paving way for folder-categorized music lists set up by servers)
Prevent BG's from falling back on default BG path (this isn't really user-convenient and causes more trouble than its worth, e.g. stands appearing on BG's that dont' want stands to appear)
Implement Case Cafe's method of categorization for (a) and (b) emotes
Diffstat (limited to 'src/courtroom.cpp')
| -rw-r--r-- | src/courtroom.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 7d2f183f..42927918 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -127,7 +127,8 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_area_list = new QListWidget(this); ui_area_list->hide(); ui_music_list = new QTreeWidget(this); - ui_music_list->setColumnCount(1); + ui_music_list->setColumnCount(2); + ui_music_list->hideColumn(1); ui_music_list->setHeaderHidden(true); ui_music_list->header()->setStretchLastSection(false); ui_music_list->header()->setSectionResizeMode(QHeaderView::ResizeToContents); @@ -1184,13 +1185,15 @@ void Courtroom::list_music() { QString i_song = music_list.at(n_song); QString i_song_listname = i_song.left(i_song.lastIndexOf(".")); + i_song_listname = i_song_listname.right(i_song_listname.length() - (i_song_listname.lastIndexOf("/") + 1)); QTreeWidgetItem *treeItem; if (i_song_listname != i_song && parent != nullptr) //not a category, parent exists treeItem = new QTreeWidgetItem(parent); else treeItem = new QTreeWidgetItem(ui_music_list); - treeItem->setText(0, i_song); + treeItem->setText(0, i_song_listname); + treeItem->setText(1, i_song); music_row_to_number.append(n_song); QString song_path = ao_app->get_music_path(i_song); @@ -2825,7 +2828,8 @@ void Courtroom::handle_song(QStringList *p_contents) return; QString f_song = f_contents.at(0); - QString f_song_clear = f_song.left(f_song.lastIndexOf(".")).right(f_song.lastIndexOf("/")); + QString f_song_clear = f_song.left(f_song.lastIndexOf(".")); + f_song_clear = f_song_clear.right(f_song_clear.length() - (f_song_clear.lastIndexOf("/") + 1)); int n_char = f_contents.at(1).toInt(); bool looping = true; @@ -3779,6 +3783,7 @@ void Courtroom::on_music_list_double_clicked(QTreeWidgetItem *p_item, int column if (is_muted) return; + column = 1; //Column 1 is always the metadata (which we want) QString p_song = p_item->text(column); QStringList packet_contents; |
