summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/game_list.cpp
diff options
context:
space:
mode:
authorKloen Lansfiel <kloen@outlawkiwi.com>2017-02-12 21:28:56 +0100
committerYuri Kunde Schlesner <yuriks@yuriks.net>2017-02-12 21:28:56 +0100
commit30ff675f0284a2ed972fa6cc944e0a96c56d4dd6 (patch)
tree32e88bf2d1846f9778b0b1d0600429c67dc2298e /src/citra_qt/game_list.cpp
parentcore: Free AppLoader on shutdown to release file (#2558) (diff)
downloadyuzu-30ff675f0284a2ed972fa6cc944e0a96c56d4dd6.tar
yuzu-30ff675f0284a2ed972fa6cc944e0a96c56d4dd6.tar.gz
yuzu-30ff675f0284a2ed972fa6cc944e0a96c56d4dd6.tar.bz2
yuzu-30ff675f0284a2ed972fa6cc944e0a96c56d4dd6.tar.lz
yuzu-30ff675f0284a2ed972fa6cc944e0a96c56d4dd6.tar.xz
yuzu-30ff675f0284a2ed972fa6cc944e0a96c56d4dd6.tar.zst
yuzu-30ff675f0284a2ed972fa6cc944e0a96c56d4dd6.zip
Diffstat (limited to '')
-rw-r--r--src/citra_qt/game_list.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp
index 09469f3c5..28e01d81a 100644
--- a/src/citra_qt/game_list.cpp
+++ b/src/citra_qt/game_list.cpp
@@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <QFileInfo>
#include <QHeaderView>
#include <QMenu>
#include <QThreadPool>
@@ -131,6 +132,14 @@ void GameList::LoadInterfaceLayout() {
item_model->sort(header->sortIndicatorSection(), header->sortIndicatorOrder());
}
+const QStringList GameList::supported_file_extensions = {"3ds", "3dsx", "elf", "axf",
+ "cci", "cxi", "app"};
+
+static bool HasSupportedFileExtension(const std::string& file_name) {
+ QFileInfo file = QFileInfo(file_name.c_str());
+ return GameList::supported_file_extensions.contains(file.completeSuffix(), Qt::CaseInsensitive);
+}
+
void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion) {
const auto callback = [this, recursion](unsigned* num_entries_out, const std::string& directory,
const std::string& virtual_name) -> bool {
@@ -139,7 +148,7 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
if (stop_processing)
return false; // Breaks the callback loop.
- if (!FileUtil::IsDirectory(physical_name)) {
+ if (!FileUtil::IsDirectory(physical_name) && HasSupportedFileExtension(physical_name)) {
std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(physical_name);
if (!loader)
return true;