More file cleanups

This commit is contained in:
Alexander Bock
2015-06-15 19:37:06 +02:00
parent 13bee28974
commit 5967063754
5 changed files with 36 additions and 4 deletions
+11 -1
View File
@@ -373,12 +373,22 @@ void SyncWidget::handleTimer() {
using namespace libtorrent;
using FileFuture = openspace::DownloadManager::FileFuture;
std::vector<FileFuture*> toRemove;
for (FileFuture* f : _futures) {
InfoWidget* w = _futureInfoWidgetMap[f];
w->update(f->progress);
if (f->isFinished) {
toRemove.push_back(f);
_downloadLayout->removeWidget(w);
delete w;
}
else
w->update(f->progress);
}
for (FileFuture* f : toRemove)
_futures.erase(std::remove(_futures.begin(), _futures.end(), f), _futures.end());
//_session->post_torrent_updates();
//libtorrent::session_settings settings = _session->settings();