Forráskód Böngészése

Use getFile(index) API

Tatsuhiro Tsujikawa 12 éve
szülő
commit
e4996e563b
1 módosított fájl, 3 hozzáadás és 3 törlés
  1. 3 3
      examples/libaria2wx.cc

+ 3 - 3
examples/libaria2wx.cc

@@ -432,9 +432,9 @@ int downloaderJob(JobQueue& jobq, NotifyQueue& notifyq)
           st.completedLength = dh->getCompletedLength();
           st.downloadSpeed = dh->getDownloadSpeed();
           st.uploadSpeed = dh->getUploadSpeed();
-          std::vector<aria2::FileData> files = dh->getFiles();
-          if(!files.empty()) {
-            st.filename = files[0].path;
+          if(dh->getNumFiles() > 0) {
+            aria2::FileData file = dh->getFile(1);
+            st.filename = file.path;
           }
           v.push_back(std::move(st));
           aria2::deleteDownloadHandle(dh);