diff options
| author | Jonas Suhr Christensen <jsc@umbraculum.org> | 2014-09-23 18:07:43 +0200 | 
|---|---|---|
| committer | Jonas Suhr Christensen <jsc@umbraculum.org> | 2014-09-23 18:07:43 +0200 | 
| commit | c71c82e1c86c811920a31916324cd6af263517f9 (patch) | |
| tree | 98d3e979bd25797345163684e9242862208d53f4 | |
| parent | 4b3d17e132fe9c88162ff46c1d33f0438c1ba67d (diff) | |
Testing file attribute filter on windows XP.
| -rw-r--r-- | plugingui/directory.cc | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/plugingui/directory.cc b/plugingui/directory.cc index ce695dc..a94b0b4 100644 --- a/plugingui/directory.cc +++ b/plugingui/directory.cc @@ -318,22 +318,29 @@ bool Directory::exists(std::string path)  bool Directory::isHidden(std::string path)   { +  DEBUG(directory, "Is '%s' hidden?\n", path.c_str());    // TODO: Handle hidden and system files in windows  #ifdef WIN32    DWORD fattribs = GetFileAttributes(path.c_str());    if(fattribs & FILE_ATTRIBUTE_HIDDEN) { +    DEBUG(directory, "\t...yes!\n");      return true;    } -  return false; +  else { +    DEBUG(directory, "\t...no!\n"); +    return false; +  }  #else    unsigned pos = path.find_last_of("/\\");    std::string entry = path.substr(pos+1);    if(entry.size() > 1 &&       entry.at(0) == '.' &&       entry.at(1) != '.') { +    DEBUG(directory, "\t...yes!\n");      return true;    }    else { +    DEBUG(directory, "\t...no!\n");      return false;    }  #endif  | 
