summaryrefslogtreecommitdiffstats
path: root/gui/fileselector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/fileselector.cpp')
-rw-r--r--gui/fileselector.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/gui/fileselector.cpp b/gui/fileselector.cpp
index a992b80ea..c4aaab168 100644
--- a/gui/fileselector.cpp
+++ b/gui/fileselector.cpp
@@ -30,6 +30,7 @@ extern "C" {
#include "objects.hpp"
#include "../data.hpp"
#include "../twrp-functions.hpp"
+#include "../adbbu/libtwadbbu.hpp"
int GUIFileSelector::mSortOrder = 0;
@@ -270,7 +271,10 @@ int GUIFileSelector::GetFileList(const std::string folder)
mFolderList.push_back(data);
} else if (data.fileType == DT_REG || data.fileType == DT_LNK || data.fileType == DT_BLK) {
if (mExtn.empty() || (data.fileName.length() > mExtn.length() && data.fileName.substr(data.fileName.length() - mExtn.length()) == mExtn)) {
- mFileList.push_back(data);
+ if (mExtn == ".ab" && twadbbu::Check_ADB_Backup_File(path))
+ mFolderList.push_back(data);
+ else
+ mFileList.push_back(data);
}
}
}
@@ -354,8 +358,8 @@ void GUIFileSelector::NotifySelect(size_t item_selected)
cwd += str;
}
- if (mShowNavFolders == 0 && mShowFiles == 0) {
- // nav folders and files are disabled, this is probably the restore list and we need to save chosen location to mVariable instead of mPathVar
+ if (mShowNavFolders == 0 && (mShowFiles == 0 || mExtn == ".ab")) {
+ // this is probably the restore list and we need to save chosen location to mVariable instead of mPathVar
DataManager::SetValue(mVariable, cwd);
} else {
// We are changing paths, so we need to set mPathVar