Enhance performance by updating the GtkTreeModel inside the TaskManager

The code to update the model has been moved inside the XtmTaskManager
class and this in order to enhance performance. In fact all the rows of
the model were udpdated everytime (150~ processes × 9 columns calls on
gtk_list_store_set per seconds) which represented a big CPU hog. Now
that the model is being updated within the same class that pulls the
processes information it is possible to run low check routines and
update only the rows that have updated information.

Also big surprise, the new tasks weren't added, well they did but not
the right data. The pointer's location was copied instead of the
pointer's content.
This commit is contained in:
Mike Massonnet
2010-05-07 20:28:25 +02:00
parent 2506eb50d8
commit 239c5d5064
3 changed files with 142 additions and 128 deletions

View File

@@ -66,5 +66,6 @@ const gchar * xtm_task_manager_get_username (XtmTaskManager *manager);
const gchar * xtm_task_manager_get_hostname (XtmTaskManager *manager);
void xtm_task_manager_get_system_info (XtmTaskManager *manager, guint *num_processes, gfloat *cpu, gfloat *memory, gfloat *swap);
const GArray * xtm_task_manager_get_task_list (XtmTaskManager *manager);
void xtm_task_manager_update_model (XtmTaskManager *manager);
#endif /* !TASK_MANAGER_H */