For example:
I am downloading a rar set bh-xvid.r??. Suppose I search for alternates on bh-xvid.r05. DC++ will search for "bh xvid r05". The search results include dmt-xvid-bh.r05, and that file is improperly added to the queue as an alternate for bh-xvid.r05.
I found the following code in QueueFrame.cpp, but I am not sure how to modify it or even if it is the right place to modify.
Code: Select all
LRESULT QueueFrame::onSearchAlternates(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
if(ctrlQueue.GetSelectedCount() == 1) {
string tmp;
int i = ctrlQueue.GetNextItem(-1, LVNI_SELECTED);
QueueItemInfo* ii = ctrlQueue.getItemData(i);
string searchString = SearchManager::clean(ii->getSearchString());
if (searchString.size() < 1)
string searchString = SearchManager::clean(ii->getTargetFileName());
StringList tok = StringTokenizer(searchString, ' ').getTokens();
for(StringIter si = tok.begin(); si != tok.end(); ++si) {
bool found = false;
for(StringIter j = searchFilter.begin(); j != searchFilter.end(); ++j) {
if(Util::stricmp(si->c_str(), j->c_str()) == 0) {
found = true;
}
}
if(!found && !si->empty()) {
tmp += *si + ' ';
}
}
if(!tmp.empty()) {
bool bigFile = (ii->getSize() > 10*1024*1024);
if(bigFile) {
SearchFrame::openWindow(tmp, ii->getSize()-1, SearchManager::SIZE_ATLEAST, ShareManager::getInstance()->getType(ii->getTargetFileName()));
} else {
SearchFrame::openWindow(tmp, ii->getSize()+1, SearchManager::SIZE_ATMOST, ShareManager::getInstance()->getType(ii->getTargetFileName()));
}
}
}
return 0;
}