1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-22 18:23:08 +02:00

The method FileLister::browse() now takes an optional boolean argument.

If set to "false", the previous list of files/directories won't be cleared when browsing another directory.
It will allow us to have file choosers that list files contained on different directories.
This commit is contained in:
Ayla 2011-04-01 18:17:33 +02:00
parent 3db5844f3c
commit d8204706d7
2 changed files with 6 additions and 4 deletions

View File

@ -65,10 +65,12 @@ void FileLister::setFilter(const string &filter)
this->filter = filter; this->filter = filter;
} }
void FileLister::browse() void FileLister::browse(bool clean)
{ {
directories.clear(); if (clean) {
files.clear(); directories.clear();
files.clear();
}
if (showDirectories || showFiles) { if (showDirectories || showFiles) {
DIR *dirp; DIR *dirp;

View File

@ -36,7 +36,7 @@ private:
public: public:
FileLister(const string &startPath = "/boot/local", bool showDirectories = true, bool showFiles = true); FileLister(const string &startPath = "/boot/local", bool showDirectories = true, bool showFiles = true);
void browse(); void browse(bool clean = true);
unsigned int size(); unsigned int size();
unsigned int dirCount(); unsigned int dirCount();