From 20b92f50d9f0541712c45ced53b98709f19012c0 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 22 Apr 2023 11:18:31 +0200 Subject: [PATCH] Qt: don't calculate sizes in grid mode --- rpcs3/rpcs3qt/game_list_frame.cpp | 34 +------------------------------ rpcs3/rpcs3qt/game_list_frame.h | 2 -- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 06c62edb49..62652e9164 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -173,17 +173,6 @@ game_list_frame::game_list_frame(std::shared_ptr gui_settings, std size_item->setData(Qt::UserRole, QVariant::fromValue(game_size)); } }); - connect(&m_size_watcher, &QFutureWatcher::canceled, this, [this]() - { - if (m_size_watcher_cancel) - { - *m_size_watcher_cancel = true; - } - }); - connect(&m_size_watcher, &QFutureWatcher::finished, this, [this]() - { - Refresh(); - }); connect(m_game_list, &QTableWidget::customContextMenuRequested, this, &game_list_frame::ShowContextMenu); connect(m_game_list, &QTableWidget::itemSelectionChanged, this, &game_list_frame::ItemSelectionChangedSlot); @@ -869,8 +858,7 @@ void game_list_frame::OnRefreshFinished() Refresh(); - m_size_watcher_cancel = std::make_shared>(false); - + // Only calculate sizes in list mode if (m_is_list_layout) { for (auto& game : m_game_data) @@ -899,25 +887,7 @@ void game_list_frame::OnRefreshFinished() }); } } - - return; } - - m_size_watcher.setFuture(QtConcurrent::map(m_game_data, [this, cancel = m_size_watcher_cancel, dev_flash = g_cfg_vfs.get_dev_flash()](const game_info& game) -> void - { - if (game) - { - if (game->info.path.starts_with(dev_flash)) - { - // Do not report size of apps inside /dev_flash (it does not make sense to do so) - game->info.size_on_disk = 0; - } - else - { - game->info.size_on_disk = fs::get_dir_size(game->info.path, 1, cancel.get()); - } - } - })); } void game_list_frame::OnRepaintFinished() @@ -3097,8 +3067,6 @@ void game_list_frame::WaitAndAbortRepaintThreads() void game_list_frame::WaitAndAbortSizeCalcThreads() { - gui::utils::stop_future_watcher(m_size_watcher, true, m_size_watcher_cancel); - for (const game_info& game : m_game_data) { if (game && game->item) diff --git a/rpcs3/rpcs3qt/game_list_frame.h b/rpcs3/rpcs3qt/game_list_frame.h index 843eba5249..ad817b4a3a 100644 --- a/rpcs3/rpcs3qt/game_list_frame.h +++ b/rpcs3/rpcs3qt/game_list_frame.h @@ -173,10 +173,8 @@ private: QSet m_serials; QMutex m_games_mutex; lf_queue m_games; - QFutureWatcher m_size_watcher; QFutureWatcher m_refresh_watcher; QFutureWatcher m_repaint_watcher; - std::shared_ptr> m_size_watcher_cancel; QSet m_hidden_list; bool m_show_hidden{false};