aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Body.cpp4
-rw-r--r--src/QuickMedia.cpp10
2 files changed, 10 insertions, 4 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 39f6e01..c53a476 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -271,7 +271,7 @@ namespace QuickMedia {
Path thumbnail_path = get_cache_dir().join("thumbnails").join(base64_url::encode(url));
std::string texture_data;
- if(thumbnail_resize_target_size.x != 0 && thumbnail_resize_target_size.y != 0 && file_get_content(thumbnail_path, texture_data) == 0) {
+ if(file_get_content(thumbnail_path, texture_data) == 0) {
fprintf(stderr, "Loaded %s from thumbnail cache\n", url.c_str());
result->loadFromMemory(texture_data.data(), texture_data.size());
loading_thumbnail = false;
@@ -443,7 +443,7 @@ namespace QuickMedia {
glScissor(scissor_pos.x, (int)window_size.y - (int)scissor_pos.y - (int)scissor_size.y, scissor_size.x, scissor_size.y);
for(int i = first_visible_item + 1; i < num_items; ++i) {
- const auto &item = items[i];
+ auto &item = items[i];
if(pos.y >= start_y + size.y)
break;
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 09c6e01..5d8a7e4 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -252,7 +252,7 @@ namespace QuickMedia {
delete body;
if(file_manager)
delete file_manager;
- if(current_plugin)
+ if(current_plugin && current_plugin != file_manager)
delete current_plugin;
if(disp)
XCloseDisplay(disp);
@@ -1097,6 +1097,7 @@ namespace QuickMedia {
if(tabs[selected_tab].body) {
tabs[selected_tab].body->filter_search_fuzzy("");
tabs[selected_tab].body->clamp_selection();
+ tabs[selected_tab].body->clear_thumbnails();
}
selected_tab = std::max(0, selected_tab - 1);
search_bar->clear();
@@ -1104,6 +1105,7 @@ namespace QuickMedia {
if(tabs[selected_tab].body) {
tabs[selected_tab].body->filter_search_fuzzy("");
tabs[selected_tab].body->clamp_selection();
+ tabs[selected_tab].body->clear_thumbnails();
}
selected_tab = std::min((int)tabs.size() - 1, selected_tab + 1);
search_bar->clear();
@@ -1869,11 +1871,13 @@ namespace QuickMedia {
} else if(event.key.code == sf::Keyboard::Left) {
tabs[selected_tab].body->filter_search_fuzzy("");
tabs[selected_tab].body->clamp_selection();
+ tabs[selected_tab].body->clear_thumbnails();
selected_tab = std::max(0, selected_tab - 1);
search_bar->clear();
} else if(event.key.code == sf::Keyboard::Right) {
tabs[selected_tab].body->filter_search_fuzzy("");
tabs[selected_tab].body->clamp_selection();
+ tabs[selected_tab].body->clear_thumbnails();
selected_tab = std::min((int)tabs.size() - 1, selected_tab + 1);
search_bar->clear();
}
@@ -2579,7 +2583,7 @@ namespace QuickMedia {
search_bar->text_autosearch_delay = prev_autosearch_delay;
// We want exit code 1 if the file manager was launched and no files were selected, to know when the user didn't select any file(s)
if(selected_files.empty() && current_page == Page::EXIT)
- exit(1);
+ exit_code = 1;
}
void Program::image_board_thread_list_page() {
@@ -3333,11 +3337,13 @@ namespace QuickMedia {
} else if(event.key.code == sf::Keyboard::Left) {
tabs[selected_tab].body->filter_search_fuzzy("");
tabs[selected_tab].body->clamp_selection();
+ tabs[selected_tab].body->clear_thumbnails();
selected_tab = std::max(0, selected_tab - 1);
chat_input.clear();
} else if(event.key.code == sf::Keyboard::Right) {
tabs[selected_tab].body->filter_search_fuzzy("");
tabs[selected_tab].body->clamp_selection();
+ tabs[selected_tab].body->clear_thumbnails();
selected_tab = std::min((int)tabs.size() - 1, selected_tab + 1);
chat_input.clear();
}