Explorar o código

2009-07-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Show first URL in Download Results if file path is not available.
	* src/FileEntry.h
Tatsuhiro Tsujikawa %!s(int64=16) %!d(string=hai) anos
pai
achega
e72c67a7ec
Modificáronse 2 ficheiros con 16 adicións e 5 borrados
  1. 5 0
      ChangeLog
  2. 11 5
      src/FileEntry.h

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2009-07-03  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Show first URL in Download Results if file path is not available.
+	* src/FileEntry.h
+
 2009-07-03  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Throw exception if file path doesn't exist in FTP URL.

+ 11 - 5
src/FileEntry.h

@@ -273,17 +273,23 @@ void writeFilePath
     o << "n/a";
   } else {
     if(e->getPath().empty()) {
-      o << "n/a";
+      std::deque<std::string> uris;
+      e->getUris(uris);
+      if(uris.empty()) {
+	o << "n/a";
+      } else {
+	o << uris.front();
+      }
     } else {
       if(memory) {
 	o << "[MEMORY]" << File(e->getPath()).getBasename();
       } else {
 	o << e->getPath();
       }
-    }
-    size_t count = countRequestedFileEntry(first, last);
-    if(count > 1) {
-      o << " (" << count-1 << "more)";
+      size_t count = countRequestedFileEntry(first, last);
+      if(count > 1) {
+	o << " (" << count-1 << "more)";
+      }
     }
   }
 }