All pastes #229434 Raw Edit

Someone

public text v1 · immutable
#229434 ·published 2006-10-30 18:18 UTC
rendered paste body
Index: client/FinishedManager.cpp
===================================================================
--- client/FinishedManager.cpp	(revision 683)
+++ client/FinishedManager.cpp	(working copy)
@@ -62,6 +62,22 @@
 		fire(FinishedManagerListener::RemovedAllUl());
 }
 
+FinishedItem* FinishedManager::getFinishedItem(string aTarget, bool upload)
+{
+	FinishedItem *item = NULL;
+	{
+		Lock l(cs);
+		FinishedItem::List *listptr = upload ? &uploads : &downloads;
+		for(FinishedItem::Iter i = listptr->begin(); i != listptr->end(); ++i) {
+			if(Util::stricmp((*i)->getTarget(), aTarget) == 0) {
+				item = *i;
+				break;
+			}
+		}
+	}
+	return item;
+}
+
 void FinishedManager::on(DownloadManagerListener::Complete, Download* d) throw()
 {
 	if(!d->isSet(Download::FLAG_TREE_DOWNLOAD) && (!d->isSet(Download::FLAG_USER_LIST) || BOOLSETTING(LOG_FILELIST_TRANSFERS))) {
Index: client/FinishedManager.h
===================================================================
--- client/FinishedManager.h	(revision 683)
+++ client/FinishedManager.h	(working copy)
@@ -89,6 +89,7 @@
 
 	void remove(FinishedItem *item, bool upload = false);
 	void removeAll(bool upload = false);
+	FinishedItem* getFinishedItem(string aTarget, bool upload = false);
 private:
 	friend class Singleton<FinishedManager>;