Skip to content

Commit

Permalink
Bugfix: Fixed handling of non-image command line arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipberndt committed Jan 6, 2014
1 parent 47a1f6c commit 55bf274
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ Known bugs
Changelog
---------

pqiv 2.1.1
* Bugfix: Fixed handling of non-image command line arguments

pqiv 2.1
* Support for watching directories for new files
* Downstream Makefile fix: Included LDFLAGS (from Gentoo package, by Tim
Expand Down
17 changes: 11 additions & 6 deletions pqiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#define _XOPEN_SOURCE 600

#define PQIV_VERSION "2.1"
#define PQIV_VERSION "2.1.1"

#include "lib/strnatcmp.h"
#include "lib/bostree.h"
Expand Down Expand Up @@ -1087,7 +1087,7 @@ gboolean image_loader_load_single_destroy_invalid_image_callback(gpointer node_p
}
return FALSE;
}
gboolean image_loader_load_single(BOSNode *node) {/*{{{*/
gboolean image_loader_load_single(BOSNode *node, gboolean called_from_main) {/*{{{*/
// Already loaded?
file_t *file = (file_t *)node->data;
if(file->image_surface != NULL && !file->surface_is_out_of_date) {
Expand Down Expand Up @@ -1241,9 +1241,14 @@ gboolean image_loader_load_single(BOSNode *node) {/*{{{*/
return TRUE;
}
else {
// The node is invalid. Unload it in the main thread to avoid race
// The node is invalid. Unload it in the main thread to avoid race
// conditions with image movement.
g_idle_add(image_loader_load_single_destroy_invalid_image_callback, node);
if(called_from_main) {
image_loader_load_single_destroy_invalid_image_callback(node);
}
else {
g_idle_add(image_loader_load_single_destroy_invalid_image_callback, node);
}
}

return FALSE;
Expand All @@ -1257,7 +1262,7 @@ gpointer image_loader_thread(gpointer user_data) {/*{{{*/
if(FILE(node)->image_surface == NULL || FILE(node)->surface_is_out_of_date) {
// Load image
image_loader_thread_currently_loading = node;
image_loader_load_single(node);
image_loader_load_single(node, FALSE);
image_loader_thread_currently_loading = NULL;
}

Expand All @@ -1271,7 +1276,7 @@ gboolean initialize_image_loader() {/*{{{*/
image_loader_queue = g_async_queue_new();
image_loader_cancellable = g_cancellable_new();
current_file_node = bostree_select(file_tree, 0);
while(!image_loader_load_single(current_file_node) && bostree_node_count(file_tree) > 0);
while(!image_loader_load_single(current_file_node, TRUE) && bostree_node_count(file_tree) > 0);
if(bostree_node_count(file_tree) == 0) {
return FALSE;
}
Expand Down

0 comments on commit 55bf274

Please sign in to comment.