Lines 631-636
Link Here
|
631 |
g_list_free(children); |
631 |
g_list_free(children); |
632 |
} |
632 |
} |
633 |
|
633 |
|
|
|
634 |
static void |
635 |
unregister_node (GamNode * node) |
636 |
{ |
637 |
if (missing_resources != NULL) { |
638 |
gam_poll_remove_missing(node); |
639 |
} |
640 |
if (busy_resources != NULL) { |
641 |
gam_poll_remove_busy(node); |
642 |
} |
643 |
if (all_resources != NULL) { |
644 |
all_resources = g_list_remove(all_resources, node); |
645 |
} |
646 |
} |
647 |
|
648 |
|
634 |
static gboolean |
649 |
static gboolean |
635 |
remove_directory_subscription(GamNode * node, GamSubscription * sub) |
650 |
remove_directory_subscription(GamNode * node, GamSubscription * sub) |
636 |
{ |
651 |
{ |
Lines 650-661
Link Here
|
650 |
|
665 |
|
651 |
if ((!gam_node_get_subscriptions(child)) && (remove_dir) && |
666 |
if ((!gam_node_get_subscriptions(child)) && (remove_dir) && |
652 |
(!gam_tree_has_children(tree, child))) { |
667 |
(!gam_tree_has_children(tree, child))) { |
653 |
if (missing_resources != NULL) { |
668 |
unregister_node (child); |
654 |
gam_poll_remove_missing(child); |
669 |
|
655 |
} |
|
|
656 |
if (busy_resources != NULL) { |
657 |
gam_poll_remove_busy(child); |
658 |
} |
659 |
gam_tree_remove(tree, child); |
670 |
gam_tree_remove(tree, child); |
660 |
} else { |
671 |
} else { |
661 |
remove_dir = FALSE; |
672 |
remove_dir = FALSE; |
Lines 790-804
Link Here
|
790 |
"prune_tree: node %s\n", gam_node_get_path(node)); |
801 |
"prune_tree: node %s\n", gam_node_get_path(node)); |
791 |
|
802 |
|
792 |
parent = gam_node_parent(node); |
803 |
parent = gam_node_parent(node); |
793 |
if (missing_resources != NULL) { |
804 |
unregister_node(node); |
794 |
gam_poll_remove_missing(node); |
|
|
795 |
} |
796 |
if (busy_resources != NULL) { |
797 |
gam_poll_remove_busy(node); |
798 |
} |
799 |
if (all_resources != NULL) { |
800 |
all_resources = g_list_remove(all_resources, node); |
801 |
} |
802 |
gam_tree_remove(tree, node); |
805 |
gam_tree_remove(tree, node); |
803 |
prune_tree(parent); |
806 |
prune_tree(parent); |
804 |
} |
807 |
} |
Lines 975-989
Link Here
|
975 |
if (!gam_node_get_subscriptions(node)) { |
978 |
if (!gam_node_get_subscriptions(node)) { |
976 |
GamNode *parent; |
979 |
GamNode *parent; |
977 |
|
980 |
|
978 |
if (missing_resources != NULL) { |
981 |
unregister_node (node); |
979 |
gam_poll_remove_missing(node); |
|
|
980 |
} |
981 |
if (busy_resources != NULL) { |
982 |
gam_poll_remove_busy(node); |
983 |
} |
984 |
if (all_resources != NULL) { |
985 |
all_resources = g_list_remove(all_resources, node); |
986 |
} |
987 |
if (gam_tree_has_children(tree, node)) { |
982 |
if (gam_tree_has_children(tree, node)) { |
988 |
fprintf(stderr, |
983 |
fprintf(stderr, |
989 |
"node %s is not dir but has children\n", |
984 |
"node %s is not dir but has children\n", |
Lines 1004-1018
Link Here
|
1004 |
if (remove_directory_subscription(node, sub)) { |
999 |
if (remove_directory_subscription(node, sub)) { |
1005 |
GamNode *parent; |
1000 |
GamNode *parent; |
1006 |
|
1001 |
|
1007 |
if (missing_resources != NULL) { |
1002 |
unregister_node (node); |
1008 |
gam_poll_remove_missing(node); |
|
|
1009 |
} |
1010 |
if (busy_resources != NULL) { |
1011 |
gam_poll_remove_busy(node); |
1012 |
} |
1013 |
if (all_resources != NULL) { |
1014 |
all_resources = g_list_remove(all_resources, node); |
1015 |
} |
1016 |
parent = gam_node_parent(node); |
1003 |
parent = gam_node_parent(node); |
1017 |
if (!gam_tree_has_children(tree, node)) { |
1004 |
if (!gam_tree_has_children(tree, node)) { |
1018 |
gam_tree_remove(tree, node); |
1005 |
gam_tree_remove(tree, node); |