diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-05-15 22:51:33 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-05-15 22:51:33 +0200 |
commit | 2d36d7344a85d0895d0f8894a7412d10e5ff0c8a (patch) | |
tree | 83c839b599befac74585bc32ac1a5d2342517e65 /src | |
parent | 7760e319cbfea444792b4bc627f04bfbe286bbdf (diff) |
Fix manganelo id for manga with <= 2 characters, force redraw manga image after 1 second
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 8 | ||||
-rw-r--r-- | src/plugins/Manganelo.cpp | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 755b5b2..cd4a279 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -2782,6 +2782,8 @@ namespace QuickMedia { malloc_trim(0); + sf::Clock force_redraw_timer; + // TODO: Show to user if a certain page is missing (by checking page name (number) and checking if some are skipped) while (current_page == PageType::IMAGES && window.isOpen()) { while(window.pollEvent(event)) { @@ -2848,6 +2850,12 @@ namespace QuickMedia { content_size.x = window_size.x; content_size.y = window_size.y - bottom_panel_height; + // TODO: Track x11 window damage instead + if(force_redraw_timer.getElapsedTime().asSeconds() >= 1.0f) { + force_redraw_timer.restart(); + redraw = true; + } + if(redraw) { redraw = false; if(error) { diff --git a/src/plugins/Manganelo.cpp b/src/plugins/Manganelo.cpp index 960caaf..5e53451 100644 --- a/src/plugins/Manganelo.cpp +++ b/src/plugins/Manganelo.cpp @@ -163,7 +163,7 @@ namespace QuickMedia { } manga_id = url.substr(index + 6); - if(manga_id.size() <= 2) { + if(manga_id.empty()) { std::string err_msg = "Url "; err_msg += url; err_msg += " doesn't contain manga id"; |