diff options
| author | 2019-06-08 00:51:58 +0200 | |
|---|---|---|
| committer | 2019-09-04 16:47:33 +0200 | |
| commit | 13891fd62dc67292c9157f52b5a1bad1541f120e (patch) | |
| tree | bdfdc657a3a56eb1e1102521855afa79c574b843 /src | |
| parent | Separate UserNand and Sdmc directories (diff) | |
| download | yuzu-13891fd62dc67292c9157f52b5a1bad1541f120e.tar.gz yuzu-13891fd62dc67292c9157f52b5a1bad1541f120e.tar.xz yuzu-13891fd62dc67292c9157f52b5a1bad1541f120e.zip | |
Change QList to QVector
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/game_list.cpp | 22 | ||||
| -rw-r--r-- | src/yuzu/game_list.h | 3 | ||||
| -rw-r--r-- | src/yuzu/game_list_worker.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/game_list_worker.h | 5 | ||||
| -rw-r--r-- | src/yuzu/uisettings.h | 3 |
5 files changed, 19 insertions, 16 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index cab982385..c525d3f17 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -537,11 +537,11 @@ void GameList::AddPermDirPopup(QMenu& context_menu, QModelIndex selected) { | |||
| 537 | 537 | ||
| 538 | connect(move_up, &QAction::triggered, [this, selected, row, &game_dir] { | 538 | connect(move_up, &QAction::triggered, [this, selected, row, &game_dir] { |
| 539 | // find the indices of the items in settings and swap them | 539 | // find the indices of the items in settings and swap them |
| 540 | UISettings::values.game_dirs.swap( | 540 | std::swap(UISettings::values.game_dirs[UISettings::values.game_dirs.indexOf(game_dir)], |
| 541 | UISettings::values.game_dirs.indexOf(game_dir), | 541 | UISettings::values.game_dirs[UISettings::values.game_dirs.indexOf( |
| 542 | UISettings::values.game_dirs.indexOf(*selected.sibling(row - 1, 0) | 542 | *selected.sibling(row - 1, 0) |
| 543 | .data(GameListDir::GameDirRole) | 543 | .data(GameListDir::GameDirRole) |
| 544 | .value<UISettings::GameDir*>())); | 544 | .value<UISettings::GameDir*>())]); |
| 545 | // move the treeview items | 545 | // move the treeview items |
| 546 | QList<QStandardItem*> item = item_model->takeRow(row); | 546 | QList<QStandardItem*> item = item_model->takeRow(row); |
| 547 | item_model->invisibleRootItem()->insertRow(row - 1, item); | 547 | item_model->invisibleRootItem()->insertRow(row - 1, item); |
| @@ -550,11 +550,11 @@ void GameList::AddPermDirPopup(QMenu& context_menu, QModelIndex selected) { | |||
| 550 | 550 | ||
| 551 | connect(move_down, &QAction::triggered, [this, selected, row, &game_dir] { | 551 | connect(move_down, &QAction::triggered, [this, selected, row, &game_dir] { |
| 552 | // find the indices of the items in settings and swap them | 552 | // find the indices of the items in settings and swap them |
| 553 | UISettings::values.game_dirs.swap( | 553 | std::swap(UISettings::values.game_dirs[UISettings::values.game_dirs.indexOf(game_dir)], |
| 554 | UISettings::values.game_dirs.indexOf(game_dir), | 554 | UISettings::values.game_dirs[UISettings::values.game_dirs.indexOf( |
| 555 | UISettings::values.game_dirs.indexOf(*selected.sibling(row + 1, 0) | 555 | *selected.sibling(row + 1, 0) |
| 556 | .data(GameListDir::GameDirRole) | 556 | .data(GameListDir::GameDirRole) |
| 557 | .value<UISettings::GameDir*>())); | 557 | .value<UISettings::GameDir*>())]); |
| 558 | // move the treeview items | 558 | // move the treeview items |
| 559 | const QList<QStandardItem*> item = item_model->takeRow(row); | 559 | const QList<QStandardItem*> item = item_model->takeRow(row); |
| 560 | item_model->invisibleRootItem()->insertRow(row + 1, item); | 560 | item_model->invisibleRootItem()->insertRow(row + 1, item); |
| @@ -609,7 +609,7 @@ void GameList::LoadCompatibilityList() { | |||
| 609 | } | 609 | } |
| 610 | } | 610 | } |
| 611 | 611 | ||
| 612 | void GameList::PopulateAsync(QList<UISettings::GameDir>& game_dirs) { | 612 | void GameList::PopulateAsync(QVector<UISettings::GameDir>& game_dirs) { |
| 613 | tree_view->setEnabled(false); | 613 | tree_view->setEnabled(false); |
| 614 | 614 | ||
| 615 | // Update the columns in case UISettings has changed | 615 | // Update the columns in case UISettings has changed |
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index 7ed77fd9c..e781afb16 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <QToolButton> | 17 | #include <QToolButton> |
| 18 | #include <QTreeView> | 18 | #include <QTreeView> |
| 19 | #include <QVBoxLayout> | 19 | #include <QVBoxLayout> |
| 20 | #include <QVector> | ||
| 20 | #include <QWidget> | 21 | #include <QWidget> |
| 21 | 22 | ||
| 22 | #include "common/common_types.h" | 23 | #include "common/common_types.h" |
| @@ -62,7 +63,7 @@ public: | |||
| 62 | bool isEmpty() const; | 63 | bool isEmpty() const; |
| 63 | 64 | ||
| 64 | void LoadCompatibilityList(); | 65 | void LoadCompatibilityList(); |
| 65 | void PopulateAsync(QList<UISettings::GameDir>& game_dirs); | 66 | void PopulateAsync(QVector<UISettings::GameDir>& game_dirs); |
| 66 | 67 | ||
| 67 | void SaveInterfaceLayout(); | 68 | void SaveInterfaceLayout(); |
| 68 | void LoadInterfaceLayout(); | 69 | void LoadInterfaceLayout(); |
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index c715bcef4..fd21a9761 100644 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp | |||
| @@ -224,7 +224,7 @@ QList<QStandardItem*> MakeGameListEntry(const std::string& path, const std::stri | |||
| 224 | 224 | ||
| 225 | GameListWorker::GameListWorker(FileSys::VirtualFilesystem vfs, | 225 | GameListWorker::GameListWorker(FileSys::VirtualFilesystem vfs, |
| 226 | FileSys::ManualContentProvider* provider, | 226 | FileSys::ManualContentProvider* provider, |
| 227 | QList<UISettings::GameDir>& game_dirs, | 227 | QVector<UISettings::GameDir>& game_dirs, |
| 228 | const CompatibilityList& compatibility_list) | 228 | const CompatibilityList& compatibility_list) |
| 229 | : vfs(std::move(vfs)), provider(provider), game_dirs(game_dirs), | 229 | : vfs(std::move(vfs)), provider(provider), game_dirs(game_dirs), |
| 230 | compatibility_list(compatibility_list) {} | 230 | compatibility_list(compatibility_list) {} |
diff --git a/src/yuzu/game_list_worker.h b/src/yuzu/game_list_worker.h index 46ec96516..6e52fca89 100644 --- a/src/yuzu/game_list_worker.h +++ b/src/yuzu/game_list_worker.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <QObject> | 14 | #include <QObject> |
| 15 | #include <QRunnable> | 15 | #include <QRunnable> |
| 16 | #include <QString> | 16 | #include <QString> |
| 17 | #include <QVector> | ||
| 17 | 18 | ||
| 18 | #include "common/common_types.h" | 19 | #include "common/common_types.h" |
| 19 | #include "yuzu/compatibility_list.h" | 20 | #include "yuzu/compatibility_list.h" |
| @@ -35,7 +36,7 @@ class GameListWorker : public QObject, public QRunnable { | |||
| 35 | public: | 36 | public: |
| 36 | explicit GameListWorker(std::shared_ptr<FileSys::VfsFilesystem> vfs, | 37 | explicit GameListWorker(std::shared_ptr<FileSys::VfsFilesystem> vfs, |
| 37 | FileSys::ManualContentProvider* provider, | 38 | FileSys::ManualContentProvider* provider, |
| 38 | QList<UISettings::GameDir>& game_dirs, | 39 | QVector<UISettings::GameDir>& game_dirs, |
| 39 | const CompatibilityList& compatibility_list); | 40 | const CompatibilityList& compatibility_list); |
| 40 | ~GameListWorker() override; | 41 | ~GameListWorker() override; |
| 41 | 42 | ||
| @@ -76,6 +77,6 @@ private: | |||
| 76 | FileSys::ManualContentProvider* provider; | 77 | FileSys::ManualContentProvider* provider; |
| 77 | QStringList watch_list; | 78 | QStringList watch_list; |
| 78 | const CompatibilityList& compatibility_list; | 79 | const CompatibilityList& compatibility_list; |
| 79 | QList<UISettings::GameDir>& game_dirs; | 80 | QVector<UISettings::GameDir>& game_dirs; |
| 80 | std::atomic_bool stop_processing; | 81 | std::atomic_bool stop_processing; |
| 81 | }; | 82 | }; |
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 76348db69..c57290006 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <QMetaType> | 11 | #include <QMetaType> |
| 12 | #include <QString> | 12 | #include <QString> |
| 13 | #include <QStringList> | 13 | #include <QStringList> |
| 14 | #include <QVector> | ||
| 14 | #include "common/common_types.h" | 15 | #include "common/common_types.h" |
| 15 | 16 | ||
| 16 | namespace UISettings { | 17 | namespace UISettings { |
| @@ -70,7 +71,7 @@ struct Values { | |||
| 70 | QString screenshot_path; | 71 | QString screenshot_path; |
| 71 | QString game_dir_deprecated; | 72 | QString game_dir_deprecated; |
| 72 | bool game_dir_deprecated_deepscan; | 73 | bool game_dir_deprecated_deepscan; |
| 73 | QList<UISettings::GameDir> game_dirs; | 74 | QVector<UISettings::GameDir> game_dirs; |
| 74 | QStringList recent_files; | 75 | QStringList recent_files; |
| 75 | 76 | ||
| 76 | QString theme; | 77 | QString theme; |