mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 19:22:29 +00:00
Tab completion functional.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@357 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
|
||||
namespace utils {
|
||||
|
||||
void
|
||||
bool
|
||||
Directory::update() {
|
||||
if (m_path.empty())
|
||||
throw std::logic_error("Directory::update() tried to open an empty path");
|
||||
@@ -39,19 +39,21 @@ Directory::update() {
|
||||
DIR* d = opendir(m_path.c_str());
|
||||
|
||||
if (d == NULL)
|
||||
throw std::runtime_error("Directory::update() could not open directory");
|
||||
return false;
|
||||
|
||||
struct dirent* ent;
|
||||
|
||||
while ((ent = readdir(d)) != NULL) {
|
||||
std::string de(ent->d_name);
|
||||
|
||||
if (de != "." && de != "..")
|
||||
if (!de.empty() && de[0] != '.')
|
||||
Base::push_back(ent->d_name);
|
||||
}
|
||||
|
||||
closedir(d);
|
||||
Base::sort(std::less<std::string>());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Directory::Base
|
||||
|
||||
Reference in New Issue
Block a user