Fix bad performance with TimerFileWatcher
This commit is contained in:
parent
67cb808401
commit
98dc75e02f
@ -57,7 +57,7 @@ static void timer_application_activate(GApplication *app) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TimerApplication *timer_application_new() {
|
TimerApplication *timer_application_new() {
|
||||||
return g_object_new(TIMER_TYPE_APPLICATION, "application-id", "org.zander.practicetiemr", "flags", G_APPLICATION_FLAGS_NONE, NULL);
|
return g_object_new(TIMER_TYPE_APPLICATION, "application-id", "org.zander.practicetiemr", "flags", G_APPLICATION_DEFAULT_FLAGS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *timer_application_get_config_file(TimerApplication *self) {
|
const char *timer_application_get_config_file(TimerApplication *self) {
|
||||||
|
@ -25,7 +25,7 @@ static void timer_clock_thread_callback(TimerClock *self) {
|
|||||||
self->lastTick = now;
|
self->lastTick = now;
|
||||||
self->currentTime = 0;
|
self->currentTime = 0;
|
||||||
}
|
}
|
||||||
g_usleep(50);
|
g_usleep(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ static void timer_file_watcher_tick(TimerFileWatcher *self) {
|
|||||||
}
|
}
|
||||||
last_tick = now;
|
last_tick = now;
|
||||||
}
|
}
|
||||||
|
g_usleep(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -396,6 +396,7 @@ void timer_task_tree_set_data_path(TimerTaskTree *self, const char *path) {
|
|||||||
if (self->fileWatcher) {
|
if (self->fileWatcher) {
|
||||||
g_object_unref(self->fileWatcher);
|
g_object_unref(self->fileWatcher);
|
||||||
}
|
}
|
||||||
|
self->fileWatcher = NULL;
|
||||||
self->fileWatcher = timer_file_watcher_new(path);
|
self->fileWatcher = timer_file_watcher_new(path);
|
||||||
g_signal_connect(self->fileWatcher, "file-changed", G_CALLBACK(data_file_updated), self);
|
g_signal_connect(self->fileWatcher, "file-changed", G_CALLBACK(data_file_updated), self);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user