← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2790: don't download incomplete file list dirs while using the find function

 

------------------------------------------------------------
revno: 2790
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sat 2012-01-07 17:34:26 +0100
message:
  don't download incomplete file list dirs while using the find function
modified:
  win32/DirectoryListingFrame.cpp


--
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/DirectoryListingFrame.cpp'
--- win32/DirectoryListingFrame.cpp	2012-01-07 16:20:01 +0000
+++ win32/DirectoryListingFrame.cpp	2012-01-07 16:34:26 +0000
@@ -1047,6 +1047,20 @@
 	HoldRedraw hold(files);
 	changeDir(d);
 
+	if(!d->getComplete()) {
+		dcdebug("Directory %s incomplete, downloading...\n", d->getName().c_str());
+		if(dl->getUser().user->isOnline()) {
+			try {
+				QueueManager::getInstance()->addList(dl->getUser(), QueueItem::FLAG_PARTIAL_LIST, dl->getPath(d));
+				status->setText(STATUS_STATUS, T_("Downloading list..."));
+			} catch(const QueueException& e) {
+				status->setText(STATUS_STATUS, Text::toT(e.getError()));
+			}
+		} else {
+			status->setText(STATUS_STATUS, T_("User offline"));
+		}
+	}
+
 	addHistory(dl->getPath(d));
 
 	pathBox->clear();
@@ -1058,7 +1072,6 @@
 }
 
 void DirectoryListingFrame::changeDir(DirectoryListing::Directory* d) {
-
 	updating = true;
 	files->clear();
 
@@ -1073,20 +1086,6 @@
 
 	updating = false;
 	updateStatus();
-
-	if(!d->getComplete()) {
-		dcdebug("Directory incomplete\n");
-		if(dl->getUser().user->isOnline()) {
-			try {
-				QueueManager::getInstance()->addList(dl->getUser(), QueueItem::FLAG_PARTIAL_LIST, dl->getPath(d));
-				status->setText(STATUS_STATUS, T_("Downloading list..."));
-			} catch(const QueueException& e) {
-				status->setText(STATUS_STATUS, Text::toT(e.getError()));
-			}
-		} else {
-			status->setText(STATUS_STATUS, T_("User offline"));
-		}
-	}
 }
 
 void DirectoryListingFrame::addHistory(const string& name) {