← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2395: propagate hub hints to file lists opened from finished transfers

 

------------------------------------------------------------
revno: 2395
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Tue 2011-01-18 18:49:48 +0100
message:
  propagate hub hints to file lists opened from finished transfers
modified:
  win32/FinishedFrameBase.h


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'win32/FinishedFrameBase.h'
--- win32/FinishedFrameBase.h	2011-01-09 14:54:10 +0000
+++ win32/FinishedFrameBase.h	2011-01-18 17:49:48 +0000
@@ -277,16 +277,24 @@
 		}
 
 		void open(TabViewPtr parent, const string& ownList) {
-			if (in_UL && file == ownList) {
+			// see if we are opening our own file list.
+			if(in_UL && file == ownList) {
 				DirectoryListingFrame::openOwnList(parent);
 				return;
 			}
 
+			// see if we are opening a file list.
 			UserPtr u = DirectoryListing::getUserFromFilename(file);
-			if(u)
-				DirectoryListingFrame::openWindow(parent, Text::toT(file), Util::emptyStringT, HintedUser(u, Util::emptyString), entry->getAverageSpeed());
-			else
-				WinUtil::openFile(Text::toT(file));
+			if(u) {
+				const auto& users = entry->getUsers();
+				auto hu = find(users.cbegin(), users.cend(), u);
+				if(hu != users.cend()) {
+					DirectoryListingFrame::openWindow(parent, Text::toT(file), Util::emptyStringT, *hu, entry->getAverageSpeed());
+					return;
+				}
+			}
+
+			WinUtil::openFile(Text::toT(file));
 		}
 
 		void openFolder() {