mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Avoid duplicate paths for zip install
This commit is contained in:
1 parent
a2de96a4d1
commit
96deade782
1 file changed
+16
-2
+16
-2
@@ -117,6 +117,16 @@ void InstallZipScreen::CreateSettingsViews(UI::ViewGroup *parent) {
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool Contains(const std::vector<T> &vec, const T &needle) {
|
||||
for (const auto &item : vec) {
|
||||
if (item == needle) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) {
|
||||
using namespace UI;
|
||||
|
||||
@@ -161,9 +171,13 @@ void InstallZipScreen::CreateContentViews(UI::ViewGroup *parent) {
|
||||
destFolders_.push_back(parent);
|
||||
}
|
||||
if (g_Config.currentDirectory.IsLocalType() && File::Exists(g_Config.currentDirectory) && g_Config.currentDirectory != parent) {
|
||||
destFolders_.push_back(g_Config.currentDirectory);
|
||||
if (!Contains(destFolders_, g_Config.currentDirectory)) {
|
||||
destFolders_.push_back(g_Config.currentDirectory);
|
||||
}
|
||||
}
|
||||
if (!Contains(destFolders_, g_Config.memStickDirectory)) {
|
||||
destFolders_.push_back(g_Config.memStickDirectory);
|
||||
}
|
||||
destFolders_.push_back(g_Config.memStickDirectory);
|
||||
} else {
|
||||
destFolders_.push_back(GetSysDirectory(DIRECTORY_GAME));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user