@@ -446,7 +446,7 @@ void game_list_frame::Refresh(const bool from_drive, const std::vector<std::stri
446446
447447 // Fill Game List / Game Grid
448448
449- const std::string selected_item = CurrentSelectionPath ();
449+ const std::set<std:: string> selected_items = CurrentSelectionPaths ();
450450
451451 // Release old data
452452 for (const auto & game : m_game_data)
@@ -481,7 +481,7 @@ void game_list_frame::Refresh(const bool from_drive, const std::vector<std::stri
481481 {
482482 m_game_grid->clear_list ();
483483 const int scroll_position = m_game_list->verticalScrollBar ()->value ();
484- m_game_list->populate (matching_apps, m_notes, m_titles, selected_item , m_play_hover_movies);
484+ m_game_list->populate (matching_apps, m_notes, m_titles, selected_items , m_play_hover_movies);
485485 m_game_list->sort (m_game_data.size (), m_sort_column, m_col_sort_order);
486486 RepaintIcons ();
487487
@@ -497,7 +497,7 @@ void game_list_frame::Refresh(const bool from_drive, const std::vector<std::stri
497497 else
498498 {
499499 m_game_list->clear_list ();
500- m_game_grid->populate (matching_apps, m_notes, m_titles, selected_item , m_play_hover_movies);
500+ m_game_grid->populate (matching_apps, m_notes, m_titles, selected_items , m_play_hover_movies);
501501 RepaintIcons ();
502502 }
503503}
@@ -1257,38 +1257,37 @@ bool game_list_frame::SearchMatchesApp(const QString& name, const QString& seria
12571257 return true ;
12581258}
12591259
1260- std::string game_list_frame::CurrentSelectionPath ()
1260+ std::set<std:: string> game_list_frame::CurrentSelectionPaths ()
12611261{
1262- std::string selection;
1263-
1264- game_info game{};
1262+ std::set<std::string> selection;
12651263
12661264 if (m_old_layout_is_list)
12671265 {
1268- if (! m_game_list->selectedItems (). isEmpty ())
1266+ for ( const QTableWidgetItem* selected_item : m_game_list->selectedItems ())
12691267 {
1270- if (QTableWidgetItem* item = m_game_list->item (m_game_list-> currentRow (), 0 ))
1268+ if (const QTableWidgetItem* item = m_game_list->item (selected_item-> row (), 0 ))
12711269 {
12721270 if (const QVariant var = item->data (gui::game_role); var.canConvert <game_info>())
12731271 {
1274- game = var.value <game_info>();
1272+ if (const game_info game = var.value <game_info>())
1273+ {
1274+ selection.insert (game->info .path + game->info .icon_path );
1275+ }
12751276 }
12761277 }
12771278 }
12781279 }
12791280 else if (m_game_grid)
12801281 {
1281- if (game_list_grid_item* item = static_cast <game_list_grid_item*>(m_game_grid->selected_item ()))
1282+ if (const game_list_grid_item* item = static_cast <game_list_grid_item*>(m_game_grid->selected_item ()))
12821283 {
1283- game = item->game ();
1284+ if (const game_info& game = item->game ())
1285+ {
1286+ selection.insert (game->info .path + game->info .icon_path );
1287+ }
12841288 }
12851289 }
12861290
1287- if (game)
1288- {
1289- selection = game->info .path + game->info .icon_path ;
1290- }
1291-
12921291 m_old_layout_is_list = m_is_list_layout;
12931292
12941293 return selection;
0 commit comments