Merge branch 'source-static-name' into 'main'

Port internal uses to use g_source_set_static_name()

See merge request GNOME/glib!2198
This commit is contained in:
Philip Withnall
2021-07-26 15:05:50 +00:00
22 changed files with 40 additions and 40 deletions

View File

@@ -348,7 +348,7 @@ g_io_unix_create_watch (GIOChannel *channel,
source = g_source_new (&g_io_watch_funcs, sizeof (GIOUnixWatch));
g_source_set_name (source, "GIOChannel (Unix)");
g_source_set_static_name (source, "GIOChannel (Unix)");
watch = (GIOUnixWatch *)source;
watch->channel = channel;

View File

@@ -1170,7 +1170,7 @@ g_io_win32_msg_create_watch (GIOChannel *channel,
GSource *source;
source = g_source_new (&g_io_watch_funcs, sizeof (GIOWin32Watch));
g_source_set_name (source, "GIOChannel (Win32)");
g_source_set_static_name (source, "GIOChannel (Win32)");
watch = (GIOWin32Watch *)source;
watch->channel = channel;

View File

@@ -5592,7 +5592,7 @@ _g_main_create_unix_signal_watch (int signum)
unix_signal_source->pending = FALSE;
/* Set a default name on the source, just in case the caller does not. */
g_source_set_name (source, signum_to_string (signum));
g_source_set_static_name (source, signum_to_string (signum));
G_LOCK (unix_signal_lock);
ref_unix_signal_handler_unlocked (signum);
@@ -5729,7 +5729,7 @@ g_child_watch_source_new (GPid pid)
child_watch_source = (GChildWatchSource *)source;
/* Set a default name on the source, just in case the caller does not. */
g_source_set_name (source, "GChildWatchSource");
g_source_set_static_name (source, "GChildWatchSource");
child_watch_source->pid = pid;
@@ -5918,7 +5918,7 @@ g_idle_source_new (void)
g_source_set_priority (source, G_PRIORITY_DEFAULT_IDLE);
/* Set a default name on the source, just in case the caller does not. */
g_source_set_name (source, "GIdleSource");
g_source_set_static_name (source, "GIdleSource");
return source;
}

View File

@@ -78,7 +78,7 @@ test_maincontext_basic (void)
g_assert_null (g_source_get_name (source));
g_source_set_can_recurse (source, TRUE);
g_source_set_name (source, "d");
g_source_set_static_name (source, "d");
g_assert_true (g_source_get_can_recurse (source));
g_assert_cmpstr (g_source_get_name (source), ==, "d");