All pastes #1050807 Raw Edit

Mine

public cpp v1 · immutable
#1050807 ·published 2008-06-19 04:44 UTC
rendered paste body
Index: client/HashManager.cpp===================================================================RCS file: /cvsroot/linuxdcpp/linuxdcpp/client/HashManager.cpp,vretrieving revision 1.15diff -u -r1.15 HashManager.cpp--- client/HashManager.cpp	4 Aug 2007 21:17:21 -0000	1.15+++ client/HashManager.cpp	18 Jun 2008 20:15:24 -0000@@ -87,8 +87,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]; @@ -172,8 +177,15 @@ }  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);@@ -192,8 +204,14 @@ }  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()) {@@ -392,8 +410,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: client/ShareManager.cpp===================================================================RCS file: /cvsroot/linuxdcpp/linuxdcpp/client/ShareManager.cpp,vretrieving revision 1.14diff -u -r1.14 ShareManager.cpp--- client/ShareManager.cpp	13 Oct 2007 21:56:55 -0000	1.14+++ client/ShareManager.cpp	18 Jun 2008 20:15:25 -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())