Skip to content

Commit

Permalink
booru/page: Reset saving flag on cancel
Browse files Browse the repository at this point in the history
Maybe add a way to cancel without closing the tab?
Changing the save button into a stop button might be good.
  • Loading branch information
ahodesuka committed Dec 5, 2017
1 parent e090380 commit b5e521f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/booru/page.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ void Page::save_images(const std::string &path)
[](auto &i) { return !std::static_pointer_cast<Image>(i)->get_url().empty(); });
m_SaveImagesThread = std::thread([ &, path ]()
{
// FIXME: Why not using the ImageFetchers threads?
ThreadPool pool(std::thread::hardware_concurrency());
for (const std::shared_ptr<AhoViewer::Image> &img : *m_ImageList)
{
Expand Down Expand Up @@ -243,6 +242,8 @@ void Page::cancel_save()

if (m_SaveImagesThread.joinable())
m_SaveImagesThread.join();

m_Saving = false;
}

void Page::get_posts()
Expand Down

0 comments on commit b5e521f

Please sign in to comment.