gui: remove room views when ladishd crash is detected. Fix for #84
This commit is contained in:
parent
b4e5f52776
commit
f94badb5fb
|
@ -865,6 +865,8 @@ void control_proxy_on_daemon_disappeared(bool clean_exit)
|
||||||
g_studio_view = NULL;
|
g_studio_view = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
world_tree_destroy_room_views();
|
||||||
|
|
||||||
g_ladishd_poll_source_tag = g_timeout_add(500, poll_ladishd, NULL);
|
g_ladishd_poll_source_tag = g_timeout_add(500, poll_ladishd, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -803,3 +803,39 @@ void world_tree_remove_app(graph_view_handle view, uint64_t id)
|
||||||
|
|
||||||
gtk_tree_path_free(path);
|
gtk_tree_path_free(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void world_tree_destroy_room_views(void)
|
||||||
|
{
|
||||||
|
gint type;
|
||||||
|
graph_view_handle view;
|
||||||
|
GtkTreeIter iter;
|
||||||
|
bool valid;
|
||||||
|
|
||||||
|
if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_treestore), &iter))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
loop:
|
||||||
|
gtk_tree_model_get(GTK_TREE_MODEL(g_treestore), &iter, COL_TYPE, &type, COL_VIEW, &view, -1);
|
||||||
|
if (type == entry_type_view && is_room_view(view))
|
||||||
|
{
|
||||||
|
//log_info("removing view for room %s", get_view_opath(view));
|
||||||
|
valid = gtk_tree_store_remove(g_treestore, &iter);
|
||||||
|
|
||||||
|
destroy_view(view);
|
||||||
|
|
||||||
|
if (!valid)
|
||||||
|
{
|
||||||
|
/* no more entries */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
goto loop;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gtk_tree_model_iter_next(GTK_TREE_MODEL(g_treestore), &iter))
|
||||||
|
{
|
||||||
|
goto loop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -39,5 +39,6 @@ void world_tree_name_changed(graph_view_handle view);
|
||||||
void world_tree_add_app(graph_view_handle view, uint64_t id, const char * name, bool running, bool terminal, uint8_t level);
|
void world_tree_add_app(graph_view_handle view, uint64_t id, const char * name, bool running, bool terminal, uint8_t level);
|
||||||
void world_tree_app_state_changed(graph_view_handle view, uint64_t id, const char * name, bool running, bool terminal, uint8_t level);
|
void world_tree_app_state_changed(graph_view_handle view, uint64_t id, const char * name, bool running, bool terminal, uint8_t level);
|
||||||
void world_tree_remove_app(graph_view_handle view, uint64_t id);
|
void world_tree_remove_app(graph_view_handle view, uint64_t id);
|
||||||
|
void world_tree_destroy_room_views(void);
|
||||||
|
|
||||||
#endif // #ifndef WORLD_TREE_H__D786489B_E400_4E92_85C7_2BAE606DE56D__INCLUDED
|
#endif // #ifndef WORLD_TREE_H__D786489B_E400_4E92_85C7_2BAE606DE56D__INCLUDED
|
||||||
|
|
Loading…
Reference in New Issue