Skip to content

Commit

Permalink
fix: handle empty folders
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenvukhang committed Feb 2, 2023
1 parent 016a21e commit 8fc1409
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mainwindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,12 @@ void MainWindow::folder_files_fetched(Update u, size_t total_expected_updates,
bool download)
{
QNetworkReply *r = (QNetworkReply *)this->sender();
if (has_network_err(r))
return;
std::vector<File> f = to_files(to_json(r));
remove_existing_files(&f, u.local_dir);

size_t n = f.size();
while (n-- > 0)
f[n].local_dir = u.local_dir;
for (size_t i = 0; i < n; i++)
f[i].local_dir = u.local_dir;

u.files = std::move(f);
// u.files now contains a list of files that the user does not have
Expand Down

0 comments on commit 8fc1409

Please sign in to comment.