Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

Commit

Permalink
Don't skip Podbeuter itemlist redraws
Browse files Browse the repository at this point in the history
The issue was reported by @antpli (#546). He also suggested the fix,
which sounds fine to me, so I'm committing it.

Closes #546.
  • Loading branch information
Minoru committed May 11, 2017
1 parent cffdcec commit 910cc09
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions src/pb_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,27 @@ void pb_view::run(bool auto_download) {

LOG(level::DEBUG, "pb_view::run: updating view... downloads().size() = %u", ctrl->downloads().size());

if (ctrl->downloads().size() > 0) {
std::string code = "{list";

unsigned int i = 0;
for (auto dl : ctrl->downloads()) {
auto lbuf = strprintf::fmt(
" %4u [%6.1fMB/%6.1fMB] [%5.1f %%] [%7.2f kb/s] %-20s %s -> %s",
i+1,
dl.current_size()/(1024*1024),
dl.total_size()/(1024*1024),
dl.percents_finished(),
dl.kbps(),
dl.status_text(),
dl.url(),
dl.filename());
code.append(strprintf::fmt("{listitem[%u] text:%s}", i, stfl::quote(lbuf)));
i++;
}
std::string code = "{list";

unsigned int i = 0;
for (auto dl : ctrl->downloads()) {
auto lbuf = strprintf::fmt(
" %4u [%6.1fMB/%6.1fMB] [%5.1f %%] [%7.2f kb/s] %-20s %s -> %s",
i+1,
dl.current_size()/(1024*1024),
dl.total_size()/(1024*1024),
dl.percents_finished(),
dl.kbps(),
dl.status_text(),
dl.url(),
dl.filename());
code.append(strprintf::fmt("{listitem[%u] text:%s}", i, stfl::quote(lbuf)));
i++;
}

code.append("}");
code.append("}");

dllist_form.modify("dls", "replace_inner", code);
}
dllist_form.modify("dls", "replace_inner", code);

ctrl->set_view_update_necessary(false);
}
Expand Down

0 comments on commit 910cc09

Please sign in to comment.