Index: client/HashManager.cpp =================================================================== RCS file: /cvsroot/linuxdcpp/linuxdcpp/client/HashManager.cpp,v retrieving revision 1.15 diff -u -r1.15 HashManager.cpp --- client/HashManager.cpp 4 Aug 2007 21:17:21 -0000 1.15 +++ client/HashManager.cpp 18 Jun 2008 20:23:35 -0000 @@ -87,8 +87,8 @@ void HashManager::HashStore::addFile(const string& aFileName, uint32_t aTimeStamp, const TigerTree& tth, bool aUsed) { addTree(tth); - string fname = Text::toLower(Util::getFileName(aFileName)); - string fpath = Text::toLower(Util::getFilePath(aFileName)); + string fname = Util::getFileName(aFileName); + string fpath = Util::getFilePath(aFileName); FileInfoList& fileList = fileIndex[fpath]; @@ -172,8 +172,10 @@ } bool HashManager::HashStore::checkTTH(const string& aFileName, int64_t aSize, uint32_t aTimeStamp) { - string fname = Text::toLower(Util::getFileName(aFileName)); - string fpath = Text::toLower(Util::getFilePath(aFileName)); + + string fname = Util::getFileName(aFileName); + string fpath = Util::getFilePath(aFileName); + DirIter i = fileIndex.find(fpath); if(i != fileIndex.end()) { FileInfoIter j = find(i->second.begin(), i->second.end(), fname); @@ -192,8 +194,9 @@ } const TTHValue* HashManager::HashStore::getTTH(const string& aFileName) { - string fname = Text::toLower(Util::getFileName(aFileName)); - string fpath = Text::toLower(Util::getFilePath(aFileName)); + string fname = Util::getFileName(aFileName); + string fpath = Util::getFilePath(aFileName); + DirIter i = fileIndex.find(fpath); if(i != fileIndex.end()) { @@ -392,8 +395,8 @@ const string& root = getAttrib(attribs, sRoot, 2); if(!file.empty() && size >= 0 && timeStamp > 0 && !root.empty()) { - string fname = Text::toLower(Util::getFileName(file)); - string fpath = Text::toLower(Util::getFilePath(file)); + string fname = Util::getFileName(file); + string fpath = Util::getFilePath(file); store.fileIndex[fpath].push_back(HashManager::HashStore::FileInfo(fname, TTHValue(root), timeStamp, false)); } Index: client/ShareManager.cpp =================================================================== RCS file: /cvsroot/linuxdcpp/linuxdcpp/client/ShareManager.cpp,v retrieving revision 1.14 diff -u -r1.14 ShareManager.cpp --- client/ShareManager.cpp 13 Oct 2007 21:56:55 -0000 1.14 +++ client/ShareManager.cpp 18 Jun 2008 20:23:36 -0000 @@ -719,7 +719,11 @@ } void ShareManager::addTree(Directory& dir) { +#ifdef _WIN32 bloom.add(Text::toLower(dir.getName())); +#else + bloom.add(dir.getName()); +#endif for(Directory::MapIter i = dir.directories.begin(); i != dir.directories.end(); ++i) { addTree(*i->second); @@ -756,7 +760,12 @@ dir.addType(getType(f.getName())); tthIndex.insert(make_pair(f.getTTH(), i)); +#ifdef _WIN32 bloom.add(Text::toLower(f.getName())); +#else + bloom.add(f.getName()); +#endif + } void ShareManager::refresh(bool dirs /* = false */, bool aUpdate /* = true */, bool block /* = false */) throw(ThreadException, ShareException) { @@ -1083,7 +1092,11 @@ if (i != string::npos) { +#ifdef _WIN32 const string &suffix = Text::toLower(aFileName.substr(i + 1)); +#else + const string &suffix = aFileName.substr(i + 1); +#endif TypeIter iter = typeMap.find(suffix); if (iter != typeMap.end()) Index: client/Util.h =================================================================== RCS file: /cvsroot/linuxdcpp/linuxdcpp/client/Util.h,v retrieving revision 1.12 diff -u -r1.12 Util.h --- client/Util.h 13 Oct 2007 21:56:55 -0000 1.12 +++ client/Util.h 18 Jun 2008 20:23:36 -0000 @@ -197,12 +197,22 @@ } static string getFilePath(const string& path) { - string::size_type i = path.rfind(PATH_SEPARATOR); - return (i != string::npos) ? path.substr(0, i + 1) : path; + #ifdef _WIN32 + string rval = Text::toLower(path); + #else + string rval = path; + #endif + string::size_type i = rval.rfind(PATH_SEPARATOR); + return (i != string::npos) ? rval.substr(0, i + 1) : rval; } static string getFileName(const string& path) { - string::size_type i = path.rfind(PATH_SEPARATOR); - return (i != string::npos) ? path.substr(i + 1) : path; + #ifdef _WIN32 + string rval = Text::toLower(path); + #else + string rval = path; + #endif + string::size_type i = rval.rfind(PATH_SEPARATOR); + return (i != string::npos) ? rval.substr(i + 1) : rval; } static string getFileExt(const string& path) { string::size_type i = path.rfind('.');