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

Port internal uses to use g_source_set_static_name()

See merge request GNOME/glib!2198
diff --git a/gio/gactiongroupexporter.c b/gio/gactiongroupexporter.c
index 8453723..d1c1903 100644
--- a/gio/gactiongroupexporter.c
+++ b/gio/gactiongroupexporter.c
@@ -249,7 +249,7 @@
       source = g_idle_source_new ();
       exporter->pending_source = source;
       g_source_set_callback (source, g_action_group_exporter_dispatch_events, exporter, NULL);
-      g_source_set_name (source, "[gio] g_action_group_exporter_dispatch_events");
+      g_source_set_static_name (source, "[gio] g_action_group_exporter_dispatch_events");
       g_source_attach (source, exporter->context);
       g_source_unref (source);
     }
diff --git a/gio/gcancellable.c b/gio/gcancellable.c
index a084282..b96e948 100644
--- a/gio/gcancellable.c
+++ b/gio/gcancellable.c
@@ -798,7 +798,7 @@
   GCancellableSource *cancellable_source;
 
   source = g_source_new (&cancellable_source_funcs, sizeof (GCancellableSource));
-  g_source_set_name (source, "GCancellable");
+  g_source_set_static_name (source, "GCancellable");
   g_source_set_dispose_function (source, cancellable_source_dispose);
   cancellable_source = (GCancellableSource *)source;
 
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 8ce70a9..d730111 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -275,7 +275,7 @@
                          call_destroy_notify_data_in_idle,
                          data,
                          (GDestroyNotify) call_destroy_notify_data_free);
-  g_source_set_name (idle_source, "[gio] call_destroy_notify_data_in_idle");
+  g_source_set_static_name (idle_source, "[gio] call_destroy_notify_data_in_idle");
   g_source_attach (idle_source, context);
   g_source_unref (idle_source);
 }
@@ -1418,7 +1418,7 @@
                          emit_closed_in_idle,
                          data,
                          (GDestroyNotify) emit_closed_data_free);
-  g_source_set_name (idle_source, "[gio] emit_closed_in_idle");
+  g_source_set_static_name (idle_source, "[gio] emit_closed_in_idle");
   g_source_attach (idle_source, connection->main_context_at_construction);
   g_source_unref (idle_source);
 }
@@ -1885,7 +1885,7 @@
    * via g_cancellable_connect() (e.g. holding lock)
    */
   idle_source = g_idle_source_new ();
-  g_source_set_name (idle_source, "[gio] send_message_with_reply_cancelled_idle_cb");
+  g_source_set_static_name (idle_source, "[gio] send_message_with_reply_cancelled_idle_cb");
   g_task_attach_source (task, idle_source, send_message_with_reply_cancelled_idle_cb);
   g_source_unref (idle_source);
 }
@@ -3954,7 +3954,7 @@
                                  emit_signal_instance_in_idle_cb,
                                  signal_instance,
                                  (GDestroyNotify) signal_instance_free);
-          g_source_set_name (idle_source, "[gio] emit_signal_instance_in_idle_cb");
+          g_source_set_static_name (idle_source, "[gio] emit_signal_instance_in_idle_cb");
           g_source_attach (idle_source, subscriber->context);
           g_source_unref (idle_source);
         }
@@ -4429,9 +4429,9 @@
                          property_data,
                          (GDestroyNotify) property_data_free);
   if (is_get)
-    g_source_set_name (idle_source, "[gio] invoke_get_property_in_idle_cb");
+    g_source_set_static_name (idle_source, "[gio] invoke_get_property_in_idle_cb");
   else
-    g_source_set_name (idle_source, "[gio] invoke_set_property_in_idle_cb");
+    g_source_set_static_name (idle_source, "[gio] invoke_set_property_in_idle_cb");
   g_source_attach (idle_source, main_context);
   g_source_unref (idle_source);
 
@@ -4649,7 +4649,7 @@
                          invoke_get_all_properties_in_idle_cb,
                          property_get_all_data,
                          (GDestroyNotify) property_get_all_data_free);
-  g_source_set_name (idle_source, "[gio] invoke_get_all_properties_in_idle_cb");
+  g_source_set_static_name (idle_source, "[gio] invoke_get_all_properties_in_idle_cb");
   g_source_attach (idle_source, main_context);
   g_source_unref (idle_source);
 
@@ -4966,7 +4966,7 @@
                          call_in_idle_cb,
                          invocation,
                          g_object_unref);
-  g_source_set_name (idle_source, "[gio, " __FILE__ "] call_in_idle_cb");
+  g_source_set_static_name (idle_source, "[gio, " __FILE__ "] call_in_idle_cb");
   g_source_attach (idle_source, main_context);
   g_source_unref (idle_source);
 }
@@ -6828,7 +6828,7 @@
                          process_subtree_vtable_message_in_idle_cb,
                          data,
                          (GDestroyNotify) subtree_deferred_data_free);
-  g_source_set_name (idle_source, "[gio] process_subtree_vtable_message_in_idle_cb");
+  g_source_set_static_name (idle_source, "[gio] process_subtree_vtable_message_in_idle_cb");
   g_source_attach (idle_source, es->context);
   g_source_unref (idle_source);
 
diff --git a/gio/gdbusnameowning.c b/gio/gdbusnameowning.c
index 328354b..879da0b 100644
--- a/gio/gdbusnameowning.c
+++ b/gio/gdbusnameowning.c
@@ -197,7 +197,7 @@
                          call_in_idle_cb,
                          data,
                          (GDestroyNotify) call_handler_data_free);
-  g_source_set_name (idle_source, "[gio, gdbusnameowning.c] call_in_idle_cb");
+  g_source_set_static_name (idle_source, "[gio, gdbusnameowning.c] call_in_idle_cb");
   g_source_attach (idle_source, client->main_context);
   g_source_unref (idle_source);
 }
diff --git a/gio/gdbusnamewatching.c b/gio/gdbusnamewatching.c
index 40aee5a..8daa69c 100644
--- a/gio/gdbusnamewatching.c
+++ b/gio/gdbusnamewatching.c
@@ -206,7 +206,7 @@
                          call_in_idle_cb,
                          data,
                          (GDestroyNotify) call_handler_data_free);
-  g_source_set_name (idle_source, "[gio, gdbusnamewatching.c] call_in_idle_cb");
+  g_source_set_static_name (idle_source, "[gio, gdbusnamewatching.c] call_in_idle_cb");
   g_source_attach (idle_source, client->main_context);
   g_source_unref (idle_source);
 }
diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c
index 7e62fa8..fc58aea 100644
--- a/gio/gdbusprivate.c
+++ b/gio/gdbusprivate.c
@@ -554,7 +554,7 @@
                          unfreeze_in_idle_cb,
                          _g_dbus_worker_ref (worker),
                          (GDestroyNotify) _g_dbus_worker_unref);
-  g_source_set_name (idle_source, "[gio] unfreeze_in_idle_cb");
+  g_source_set_static_name (idle_source, "[gio] unfreeze_in_idle_cb");
   g_source_attach (idle_source, worker->shared_thread_data->context);
   g_source_unref (idle_source);
 }
@@ -1601,7 +1601,7 @@
                              continue_writing_in_idle_cb,
                              _g_dbus_worker_ref (worker),
                              (GDestroyNotify) _g_dbus_worker_unref);
-      g_source_set_name (idle_source, "[gio] continue_writing_in_idle_cb");
+      g_source_set_static_name (idle_source, "[gio] continue_writing_in_idle_cb");
       g_source_attach (idle_source, worker->shared_thread_data->context);
       g_source_unref (idle_source);
     }
@@ -1696,7 +1696,7 @@
                          _g_dbus_worker_do_initial_read,
                          _g_dbus_worker_ref (worker),
                          (GDestroyNotify) _g_dbus_worker_unref);
-  g_source_set_name (idle_source, "[gio] _g_dbus_worker_do_initial_read");
+  g_source_set_static_name (idle_source, "[gio] _g_dbus_worker_do_initial_read");
   g_source_attach (idle_source, worker->shared_thread_data->context);
   g_source_unref (idle_source);
 
diff --git a/gio/gdbusserver.c b/gio/gdbusserver.c
index 3fdded5..c83a647 100644
--- a/gio/gdbusserver.c
+++ b/gio/gdbusserver.c
@@ -1085,7 +1085,7 @@
                              emit_new_connection_in_idle,
                              data,
                              (GDestroyNotify) emit_idle_data_free);
-      g_source_set_name (idle_source, "[gio] emit_new_connection_in_idle");
+      g_source_set_static_name (idle_source, "[gio] emit_new_connection_in_idle");
       g_source_attach (idle_source, server->main_context_at_construction);
       g_source_unref (idle_source);
     }
diff --git a/gio/gioscheduler.c b/gio/gioscheduler.c
index c146e07..0367ede 100644
--- a/gio/gioscheduler.c
+++ b/gio/gioscheduler.c
@@ -261,7 +261,7 @@
   g_source_set_priority (source, G_PRIORITY_DEFAULT);
   g_source_set_callback (source, mainloop_proxy_func, proxy,
 			 NULL);
-  g_source_set_name (source, "[gio] mainloop_proxy_func");
+  g_source_set_static_name (source, "[gio] mainloop_proxy_func");
 
   g_source_attach (source, job->context);
   g_source_unref (source);
@@ -318,7 +318,7 @@
   g_source_set_priority (source, G_PRIORITY_DEFAULT);
   g_source_set_callback (source, mainloop_proxy_func, proxy,
 			 (GDestroyNotify)mainloop_proxy_free);
-  g_source_set_name (source, "[gio] mainloop_proxy_func");
+  g_source_set_static_name (source, "[gio] mainloop_proxy_func");
 
   g_source_attach (source, job->context);
   g_source_unref (source);
diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c
index 6695fc1..3867ca6 100644
--- a/gio/glocalfileinfo.c
+++ b/gio/glocalfileinfo.c
@@ -1667,8 +1667,8 @@
             g_timeout_source_new_seconds (hidden_cache_ttl_secs +
                                           hidden_cache_ttl_jitter_secs);
           g_source_set_priority (hidden_cache_source, G_PRIORITY_DEFAULT);
-          g_source_set_name (hidden_cache_source,
-                             "[gio] remove_from_hidden_cache");
+          g_source_set_static_name (hidden_cache_source,
+                                    "[gio] remove_from_hidden_cache");
           g_source_set_callback (hidden_cache_source,
                                  remove_from_hidden_cache,
                                  NULL, NULL);
diff --git a/gio/glocalfilemonitor.c b/gio/glocalfilemonitor.c
index dc32fb6..7e92256 100644
--- a/gio/glocalfilemonitor.c
+++ b/gio/glocalfilemonitor.c
@@ -658,7 +658,7 @@
   source = g_source_new (&source_funcs, sizeof (GFileMonitorSource));
   fms = (GFileMonitorSource *) source;
 
-  g_source_set_name (source, "GFileMonitorSource");
+  g_source_set_static_name (source, "GFileMonitorSource");
 
   g_mutex_init (&fms->lock);
   g_weak_ref_init (&fms->instance_ref, instance);
diff --git a/gio/gnetworkmonitorbase.c b/gio/gnetworkmonitorbase.c
index d503759..3ad2f9b 100644
--- a/gio/gnetworkmonitorbase.c
+++ b/gio/gnetworkmonitorbase.c
@@ -467,7 +467,7 @@
        */
       g_source_set_priority (source, G_PRIORITY_HIGH_IDLE);
       g_source_set_callback (source, emit_network_changed, monitor, NULL);
-      g_source_set_name (source, "[gio] emit_network_changed");
+      g_source_set_static_name (source, "[gio] emit_network_changed");
       g_source_attach (source, monitor->priv->context);
       monitor->priv->network_changed_source = source;
     }
diff --git a/gio/gpollableutils.c b/gio/gpollableutils.c
index 77bf821..a20d150 100644
--- a/gio/gpollableutils.c
+++ b/gio/gpollableutils.c
@@ -116,7 +116,7 @@
 			G_IS_POLLABLE_OUTPUT_STREAM (pollable_stream), NULL);
 
   source = g_source_new (&pollable_source_funcs, sizeof (GPollableSource));
-  g_source_set_name (source, "GPollableSource");
+  g_source_set_static_name (source, "GPollableSource");
   pollable_source = (GPollableSource *)source;
   pollable_source->stream = g_object_ref (pollable_stream);
 
diff --git a/gio/gsimpleasyncresult.c b/gio/gsimpleasyncresult.c
index c6ddd97..c971bdf 100644
--- a/gio/gsimpleasyncresult.c
+++ b/gio/gsimpleasyncresult.c
@@ -842,7 +842,7 @@
   source = g_idle_source_new ();
   g_source_set_priority (source, G_PRIORITY_DEFAULT);
   g_source_set_callback (source, complete_in_idle_cb, simple, g_object_unref);
-  g_source_set_name (source, "[gio] complete_in_idle_cb");
+  g_source_set_static_name (source, "[gio] complete_in_idle_cb");
 
   g_source_attach (source, simple->context);
   g_source_unref (source);
@@ -903,7 +903,7 @@
   source = g_idle_source_new ();
   g_source_set_priority (source, G_PRIORITY_DEFAULT);
   g_source_set_callback (source, complete_in_idle_cb_for_thread, data, NULL);
-  g_source_set_name (source, "[gio] complete_in_idle_cb_for_thread");
+  g_source_set_static_name (source, "[gio] complete_in_idle_cb_for_thread");
 
   g_source_attach (source, simple->context);
   g_source_unref (source);
diff --git a/gio/gsocket.c b/gio/gsocket.c
index a7ba27d..d5603c5 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -4114,7 +4114,7 @@
   condition |= G_IO_HUP | G_IO_ERR | G_IO_NVAL;
 
   source = g_source_new (&socket_source_funcs, sizeof (GSocketSource));
-  g_source_set_name (source, "GSocket");
+  g_source_set_static_name (source, "GSocket");
   socket_source = (GSocketSource *)source;
 
   socket_source->socket = g_object_ref (socket);
diff --git a/gio/gtask.c b/gio/gtask.c
index b533a18..a767e19 100644
--- a/gio/gtask.c
+++ b/gio/gtask.c
@@ -2177,7 +2177,7 @@
   g_thread_pool_set_sort_function (task_pool, g_task_compare_priority, NULL);
 
   task_pool_manager = g_source_new (&trivial_source_funcs, sizeof (GSource));
-  g_source_set_name (task_pool_manager, "GTask thread pool manager");
+  g_source_set_static_name (task_pool_manager, "GTask thread pool manager");
   g_source_set_callback (task_pool_manager, task_pool_manager_timeout, NULL, NULL);
   g_source_set_ready_time (task_pool_manager, -1);
   g_source_attach (task_pool_manager,
diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
index 46a41fc..e0c8f67 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -1854,7 +1854,7 @@
   source = g_idle_source_new ();
   g_source_set_priority (source, G_PRIORITY_DEFAULT);
   g_source_set_callback (source, mtab_file_changed_cb, NULL, NULL);
-  g_source_set_name (source, "[gio] mtab_file_changed_cb");
+  g_source_set_static_name (source, "[gio] mtab_file_changed_cb");
   g_source_attach (source, context);
   g_source_unref (source);
 }
diff --git a/gio/inotify/inotify-kernel.c b/gio/inotify/inotify-kernel.c
index 1a30fc8..92d61fc 100644
--- a/gio/inotify/inotify-kernel.c
+++ b/gio/inotify/inotify-kernel.c
@@ -381,7 +381,7 @@
   source = g_source_new (&source_funcs, sizeof (InotifyKernelSource));
   iks = (InotifyKernelSource *) source;
 
-  g_source_set_name (source, "inotify kernel source");
+  g_source_set_static_name (source, "inotify kernel source");
 
   iks->unmatched_moves = g_hash_table_new (NULL, NULL);
   iks->fd = inotify_init1 (IN_CLOEXEC);
diff --git a/glib/giounix.c b/glib/giounix.c
index b86d79d..ad3aba2 100644
--- a/glib/giounix.c
+++ b/glib/giounix.c
@@ -348,7 +348,7 @@
 
 
   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;
diff --git a/glib/giowin32.c b/glib/giowin32.c
index b0b6c3d..e4c246d 100644
--- a/glib/giowin32.c
+++ b/glib/giowin32.c
@@ -1170,7 +1170,7 @@
   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;
diff --git a/glib/gmain.c b/glib/gmain.c
index f36da1e..6cba3bd 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -5592,7 +5592,7 @@
   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 @@
   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_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;
 }
diff --git a/glib/tests/mainloop.c b/glib/tests/mainloop.c
index 4ef0e9c..ab13176 100644
--- a/glib/tests/mainloop.c
+++ b/glib/tests/mainloop.c
@@ -78,7 +78,7 @@
   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");
diff --git a/tests/mainloop-test.c b/tests/mainloop-test.c
index be6024a..365864d 100644
--- a/tests/mainloop-test.c
+++ b/tests/mainloop-test.c
@@ -158,13 +158,13 @@
   addr_data.count = 0;
 
   adder_source = g_io_create_watch (channels[0], G_IO_IN | G_IO_HUP);
-  g_source_set_name (adder_source, "Adder I/O");
+  g_source_set_static_name (adder_source, "Adder I/O");
   g_source_set_callback (adder_source, (GSourceFunc)adder_callback, &addr_data, NULL);
   g_source_attach (adder_source, context);
   g_source_unref (adder_source);
 
   timeout_source = g_timeout_source_new (10);
-  g_source_set_name (timeout_source, "Adder timeout");
+  g_source_set_static_name (timeout_source, "Adder timeout");
   g_source_set_callback (timeout_source, (GSourceFunc)timeout_callback, &addr_data, NULL);
   g_source_set_priority (timeout_source, G_PRIORITY_HIGH);
   g_source_attach (timeout_source, context);
@@ -335,7 +335,7 @@
 create_crawler (void)
 {
   GSource *source = g_timeout_source_new (g_random_int_range (0, CRAWLER_TIMEOUT_RANGE));
-  g_source_set_name (source, "Crawler timeout");
+  g_source_set_static_name (source, "Crawler timeout");
   g_source_set_callback (source, (GSourceFunc)crawler_callback, source, NULL);
 
   G_LOCK (crawler_array_lock);
@@ -389,7 +389,7 @@
     {
       context = context_array->pdata[g_random_int_range (0, context_array->len)];
       source = g_idle_source_new ();
-      g_source_set_name (source, "Recursing idle source");
+      g_source_set_static_name (source, "Recursing idle source");
       g_source_set_callback (source, recurser_idle, context, NULL);
       g_source_attach (source, context);
       g_source_unref (source);