gui2/tgame_cache_options: Set busy mouse cursor during cleaning/purging
These are potentially expensive operations depending on the target medium, the number of files that must be deleted, and the filesystem implementation. For example, deleting 12,100 files (around 235 MiB) takes around 0.4 seconds here. Using the busy mouse cursor makes it look less like Wesnoth has frozen entirely and more like there's actual work being done.
This commit is contained in:
parent
4e57408485
commit
4e4d757fde
1 changed files with 3 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "desktop/clipboard.hpp"
|
||||
#include "config_cache.hpp"
|
||||
#include "cursor.hpp"
|
||||
#include "desktop/open.hpp"
|
||||
#include "filesystem.hpp"
|
||||
#include "gui/auxiliary/find_widget.tpp"
|
||||
|
@ -161,6 +162,7 @@ void tgame_cache_options::clean_cache_callback(CVideo& video)
|
|||
|
||||
bool tgame_cache_options::clean_cache()
|
||||
{
|
||||
const cursor::setter cs(cursor::WAIT);
|
||||
return game_config::config_cache::instance().clean_cache();
|
||||
}
|
||||
|
||||
|
@ -191,6 +193,7 @@ void tgame_cache_options::purge_cache_callback(CVideo& video)
|
|||
|
||||
bool tgame_cache_options::purge_cache()
|
||||
{
|
||||
const cursor::setter cs(cursor::WAIT);
|
||||
return game_config::config_cache::instance().purge_cache();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue