From bf9f737c609a2831ad52aab68030fb888c64bd01 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Mon, 18 Jan 2021 01:22:54 +0100 Subject: game_list: Fix folder reordering The bug(s) happened because we swapped the contents on values.game_dirs, but the pointer each item had to their respective game_dir wasn't updated. This made it so that the item had the wrong game_dir associated with it after a "move up" or "move down" operation. It can be observed by choosing "open directory location" after such operation. Changed from raw pointer to an index because it's equivalent but a bit clearer, but the change is not essential. Co-Authored-By: Vitor K <29167336+vitor-k@users.noreply.github.com> --- src/yuzu/game_list_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/game_list_p.h') diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index df935022d..f25445f18 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h @@ -230,7 +230,7 @@ public: setData(type(), TypeRole); UISettings::GameDir* game_dir = &directory; - setData(QVariant::fromValue(game_dir), GameDirRole); + setData(QVariant(UISettings::values.game_dirs.indexOf(directory)), GameDirRole); const int icon_size = std::min(static_cast(UISettings::values.icon_size), 64); switch (dir_type) { -- cgit v1.2.3