use g_timeout_add_seconds_once()

Use the newly added g_timeout_add_seconds_once() where appropriate.
This commit is contained in:
Peter Eisenmann
2023-04-16 21:49:10 +02:00
committed by Peter Eisenmann
parent 467b917719
commit e25a4f995f
6 changed files with 16 additions and 29 deletions

View File

@@ -452,15 +452,13 @@ created_cb (GObject *source,
data);
}
static gboolean
static void
stop_timeout (gpointer user_data)
{
CreateDeleteData *data = user_data;
data->timed_out = TRUE;
g_main_context_wakeup (data->context);
return G_SOURCE_REMOVE;
}
/*
@@ -518,7 +516,7 @@ test_create_delete (gconstpointer d)
/* Use the global default main context */
data->context = NULL;
data->timeout = g_timeout_add_seconds (10, stop_timeout, data);
data->timeout = g_timeout_add_seconds_once (10, stop_timeout, data);
g_file_create_async (data->file, 0, 0, NULL, created_cb, data);