mirror of
https://github.com/PabloMK7/citra.git
synced 2024-12-29 11:06:12 +00:00
game_list: fix folder reordering
This commit is contained in:
parent
950c032837
commit
fbf24e3ca4
|
@ -580,6 +580,8 @@ void GameList::AddPermDirPopup(QMenu& context_menu, QModelIndex selected) {
|
|||
std::swap(UISettings::values.game_dirs[game_dir_index],
|
||||
UISettings::values.game_dirs[selected.sibling(row - 1, 0)
|
||||
.data(GameListDir::GameDirRole).toInt()]);
|
||||
GetModel()->setData(selected, QVariant::fromValue(selected.sibling(row-1,0).data(GameListDir::GameDirRole).toInt()), GameListDir::GameDirRole);
|
||||
GetModel()->setData(selected.sibling(row-1,0), QVariant::fromValue(game_dir_index), GameListDir::GameDirRole);
|
||||
// move the treeview items
|
||||
QList<QStandardItem*> item = item_model->takeRow(row);
|
||||
item_model->invisibleRootItem()->insertRow(row - 1, item);
|
||||
|
@ -591,6 +593,8 @@ void GameList::AddPermDirPopup(QMenu& context_menu, QModelIndex selected) {
|
|||
std::swap(UISettings::values.game_dirs[game_dir_index],
|
||||
UISettings::values.game_dirs[selected.sibling(row + 1, 0)
|
||||
.data(GameListDir::GameDirRole).toInt()]);
|
||||
GetModel()->setData(selected, QVariant::fromValue(selected.sibling(row+1,0).data(GameListDir::GameDirRole).toInt()), GameListDir::GameDirRole);
|
||||
GetModel()->setData(selected.sibling(row+1,0), QVariant::fromValue(game_dir_index), GameListDir::GameDirRole);
|
||||
// move the treeview items
|
||||
const QList<QStandardItem*> item = item_model->takeRow(row);
|
||||
item_model->invisibleRootItem()->insertRow(row + 1, item);
|
||||
|
|
Loading…
Reference in a new issue