Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: HashManager.cpp
- ===================================================================
- --- HashManager.cpp (revision 1165)
- +++ HashManager.cpp (working copy)
- @@ -97,8 +97,13 @@
- void HashManager::HashStore::addFile(const string& aFileName, uint32_t aTimeStamp, const TigerTree& tth, bool aUsed) {
- addTree(tth);
- +#ifdef _WIN32
- string fname = Text::toLower(Util::getFileName(aFileName));
- string fpath = Text::toLower(Util::getFilePath(aFileName));
- +#else
- + string fname = Util::getFileName(aFileName);
- + string fpath = Util::getFilePath(aFileName);
- +#endif
- FileInfoList& fileList = fileIndex[fpath];
- @@ -186,8 +191,13 @@
- }
- bool HashManager::HashStore::checkTTH(const string& aFileName, int64_t aSize, uint32_t aTimeStamp) {
- +#ifdef _WIN32
- string fname = Text::toLower(Util::getFileName(aFileName));
- string fpath = Text::toLower(Util::getFilePath(aFileName));
- +#else
- + string fname = Util::getFileName(aFileName);
- + string fpath = Util::getFilePath(aFileName);
- +#endif
- DirIter i = fileIndex.find(fpath);
- if (i != fileIndex.end()) {
- FileInfoIter j = find(i->second.begin(), i->second.end(), fname);
- @@ -206,9 +216,13 @@
- }
- const TTHValue* HashManager::HashStore::getTTH(const string& aFileName) {
- +#ifdef _WIN32
- string fname = Text::toLower(Util::getFileName(aFileName));
- string fpath = Text::toLower(Util::getFilePath(aFileName));
- -
- +#else
- + string fname = Util::getFileName(aFileName);
- + string fpath = Util::getFilePath(aFileName);
- +#endif
- DirIter i = fileIndex.find(fpath);
- if (i != fileIndex.end()) {
- FileInfoIter j = find(i->second.begin(), i->second.end(), fname);
- @@ -225,6 +239,7 @@
- DirMap newFileIndex;
- TreeMap newTreeIndex;
- +
- for (DirIter i = fileIndex.begin(); i != fileIndex.end(); ++i) {
- for (FileInfoIter j = i->second.begin(); j != i->second.end(); ++j) {
- if (!j->getUsed())
- @@ -412,9 +427,13 @@
- const string& root = getAttrib(attribs, sRoot, 2);
- if (!file.empty() && size >= 0 && timeStamp > 0 && !root.empty()) {
- +#ifdef _WIN32
- string fname = Text::toLower(Util::getFileName(file));
- string fpath = Text::toLower(Util::getFilePath(file));
- -
- +#else
- + string fname = Util::getFileName(file);
- + string fpath = Util::getFilePath(file);
- +#endif
- store.fileIndex[fpath].push_back(HashManager::HashStore::FileInfo(fname, TTHValue(root), timeStamp,
- false));
- }
- Index: ShareManager.cpp
- ===================================================================
- --- ShareManager.cpp (revision 1165)
- +++ ShareManager.cpp (working copy)
- @@ -811,8 +811,11 @@
- //}
- void ShareManager::updateIndices(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) {
- updateIndices(*i->second);
- }
- @@ -854,7 +857,11 @@
- 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() {
- @@ -1308,7 +1315,11 @@
- }
- return;
- }
- +//#ifdef _WIN32
- StringTokenizer<string> t(Text::toLower(aString), '$');
- +//#else
- +// StringTokenizer<string> t(aString, '$');
- +//#endif
- StringList& sl = t.getTokens();
- if(!bloom.match(sl))
- return;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement