void refreshStatsOfNode(gpointer n) { if( ((HostNode *)n)->fpstat ) { fclose(((HostNode *)n)->fpstat); ((HostNode *)n)->fpstat = NULL; } getUpdatesFromStat(((HostNode *) n)); unsetLockForHost((HostNode *) n); rebuilddl = TRUE; /* Trigger a DrawList rebuild */ }
void stats_changed(GFileMonitor *monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type, gpointer user_data) { HostNode *n = user_data; g_assert(n); switch(event_type) { case G_FILE_MONITOR_EVENT_DELETED: n->category = (g_file_test(n->statstmpf, G_FILE_TEST_EXISTS) ? C_REFRESH : C_UNKNOWN); rebuilddl = TRUE; /* Trigger a DrawList rebuild */ ;; case G_FILE_MONITOR_EVENT_CREATED: getUpdatesFromStat(n); rebuilddl = TRUE; /* Trigger a DrawList rebuild */ ;; default: return; ;; } }