summaryrefslogtreecommitdiff
path: root/src/yuzu/game_list_p.h
diff options
context:
space:
mode:
authorFearlessTobi <thm.frey@gmail.com>2021-01-18 01:22:54 +0100
committerFearlessTobi <thm.frey@gmail.com>2021-01-18 01:22:54 +0100
commitbf9f737c609a2831ad52aab68030fb888c64bd01 (patch)
treebcfaf2a20101d921925d34c0dac02b6c0a60b562 /src/yuzu/game_list_p.h
parente8401964b4cb617223554e147091f109dc870ba5 (diff)
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>
Diffstat (limited to 'src/yuzu/game_list_p.h')
-rw-r--r--src/yuzu/game_list_p.h2
1 files changed, 1 insertions, 1 deletions
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<int>(UISettings::values.icon_size), 64);
switch (dir_type) {