From: <arn...@us...> - 2007-12-23 11:04:39
|
Revision: 949 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=949&view=rev Author: arnetheduck Date: 2007-12-23 03:04:30 -0800 (Sun, 23 Dec 2007) Log Message: ----------- Fix crash, use token field Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/DirectoryListingFrame.cpp dcplusplus/trunk/win32/SearchFrame.cpp dcplusplus/trunk/win32/SearchFrame.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-22 22:38:16 UTC (rev 948) +++ dcplusplus/trunk/changelog.txt 2007-12-23 11:04:30 UTC (rev 949) @@ -1,7 +1,10 @@ -- 0.705 -- * Several patches for better *nix compatibility of the core (thanks steven sheehy et al) -* Improve segmented download file sharing +* Improve segmented download implementation * Fix search request ip when using multiple ip's (thanks stanislav maslovski) +* Fixed a crash when right-clicking in own file list +* [ADC] Searches filtered by token if available so that each search window only gets its own results +* [ADC] Implemented test version of bloom filters which will dramatically reduce hub bandwidth usage for TTH searches -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) Modified: dcplusplus/trunk/win32/DirectoryListingFrame.cpp =================================================================== --- dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2007-12-22 22:38:16 UTC (rev 948) +++ dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2007-12-23 11:04:30 UTC (rev 949) @@ -396,9 +396,9 @@ } if(files->getSelectedCount() == 1) { - if(BOOLSETTING(SHOW_SHELL_MENU) && (dl->getUser() == ClientManager::getInstance()->getMe())) { + ItemInfo* ii = files->getSelectedData(); + if(BOOLSETTING(SHOW_SHELL_MENU) && (dl->getUser() == ClientManager::getInstance()->getMe()) && ii->type == ItemInfo::FILE) { string path; - ItemInfo* ii = files->getSelectedData(); try { path = ShareManager::getInstance()->toReal(Util::toAdcFile(dl->getPath(ii->file) + ii->file->getName())); } catch(const ShareException&) { @@ -412,7 +412,6 @@ return true; } } - ItemInfo* ii = files->getSelectedData(); contextMenu = makeSingleMenu(ii); } else { Modified: dcplusplus/trunk/win32/SearchFrame.cpp =================================================================== --- dcplusplus/trunk/win32/SearchFrame.cpp 2007-12-22 22:38:16 UTC (rev 948) +++ dcplusplus/trunk/win32/SearchFrame.cpp 2007-12-23 11:04:30 UTC (rev 949) @@ -836,6 +836,12 @@ if(currentSearch.empty()) { return; } + + if(!aResult->getToken().empty() && token != aResult->getToken()) { + droppedResults++; + speak(SPEAK_FILTER_RESULT); + return; + } if(isHash) { if(aResult->getType() != SearchResult::TYPE_FILE || TTHValue(Text::fromT(currentSearch[0])) != aResult->getTTH()) { @@ -970,6 +976,7 @@ } s = s.substr(0, max(s.size(), static_cast<tstring::size_type>(1)) - 1); + token = Util::toString(Util::rand()); } @@ -1004,7 +1011,7 @@ if(SearchManager::getInstance()->okToSearch()) { SearchManager::getInstance()->search(clients, Text::fromT(s), llsize, - (SearchManager::TypeModes)ftype, mode, "manual"); + (SearchManager::TypeModes)ftype, mode, token); if(BOOLSETTING(CLEAR_SEARCH)) // Only clear if the search was sent searchBox->setText(Util::emptyStringT); } else { Modified: dcplusplus/trunk/win32/SearchFrame.h =================================================================== --- dcplusplus/trunk/win32/SearchFrame.h 2007-12-22 22:38:16 UTC (rev 948) +++ dcplusplus/trunk/win32/SearchFrame.h 2007-12-23 11:04:30 UTC (rev 949) @@ -200,6 +200,8 @@ CriticalSection cs; StringMap ucLineParams; + + std::string token; SearchFrame(SmartWin::WidgetTabView* mdiParent, const tstring& initialString_, LONGLONG initialSize_, SearchManager::SizeModes initialMode_, SearchManager::TypeModes initialType_); virtual ~SearchFrame(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |