Merge branch 'hide-hidden-files' of https://github.com/agateau/aseprite into agateau-hide-hidden-files

This commit is contained in:
David Capello 2015-05-11 12:01:31 -03:00
commit 15618c4fde
3 changed files with 16 additions and 1 deletions

View File

@ -84,6 +84,7 @@ public:
bool isFolder() const;
bool isBrowsable() const;
bool isHidden() const;
std::string getKeyName() const;
std::string getFileName() const;
@ -313,6 +314,17 @@ bool FileItem::isBrowsable() const
return is_folder;
}
bool FileItem::isHidden() const
{
ASSERT(this->displayname != NOTINITIALIZED);
#ifdef _WIN32
return false;
#else
return this->displayname[0] == '.';
#endif
}
std::string FileItem::getKeyName() const
{
ASSERT(this->keyname != NOTINITIALIZED);

View File

@ -68,6 +68,7 @@ namespace app {
virtual bool isFolder() const = 0;
virtual bool isBrowsable() const = 0;
virtual bool isHidden() const = 0;
virtual std::string getKeyName() const = 0;
virtual std::string getFileName() const = 0;

View File

@ -497,7 +497,9 @@ void FileList::regenerateList()
it=m_list.begin();
it!=m_list.end(); ) {
IFileItem* fileitem = *it;
if (!fileitem->isFolder() &&
if (fileitem->isHidden())
it = m_list.erase(it);
else if (!fileitem->isFolder() &&
!fileitem->hasExtension(m_exts.c_str())) {
it = m_list.erase(it);
}