summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-09-12 00:00:40 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-09-12 11:13:45 -0400
commit9acd0ddbf3c0f14e6ae7cb3f7faf4c24767f13b8 (patch)
tree97e326f485fbd36233f84124d26511ba26b44cb1
parentc90f283be33bffde48c244e0478b63fd6798fbcf (diff)
downloadglib-9acd0ddbf3c0f14e6ae7cb3f7faf4c24767f13b8.tar.gz
gio: Intern all signal names beforehand
This avoids pointless copying of static strings.
-rw-r--r--gio/gappinfo.c6
-rw-r--r--gio/gapplication.c12
-rw-r--r--gio/gdbusauthobserver.c4
-rw-r--r--gio/gdbusconnection.c2
-rw-r--r--gio/gdbusdaemon.c2
-rw-r--r--gio/gdbusinterfaceskeleton.c2
-rw-r--r--gio/gdbusobject.c4
-rw-r--r--gio/gdbusobjectmanager.c8
-rw-r--r--gio/gdbusobjectmanagerclient.c4
-rw-r--r--gio/gdbusobjectskeleton.c2
-rw-r--r--gio/gdbusproxy.c4
-rw-r--r--gio/gdbusserver.c2
-rw-r--r--gio/glistmodel.c3
-rw-r--r--gio/gmenumodel.c4
-rw-r--r--gio/gsettings.c8
-rw-r--r--gio/gsocketservice.c2
-rw-r--r--gio/gthreadedsocketservice.c2
-rw-r--r--gio/gunixmounts.c4
18 files changed, 39 insertions, 36 deletions
diff --git a/gio/gappinfo.c b/gio/gappinfo.c
index 1b92a01ec..0bbb44df0 100644
--- a/gio/gappinfo.c
+++ b/gio/gappinfo.c
@@ -837,7 +837,7 @@ g_app_launch_context_class_init (GAppLaunchContextClass *klass)
*
* Since: 2.36
*/
- signals[LAUNCH_FAILED] = g_signal_new ("launch-failed",
+ signals[LAUNCH_FAILED] = g_signal_new (I_("launch-failed"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GAppLaunchContextClass, launch_failed),
@@ -858,7 +858,7 @@ g_app_launch_context_class_init (GAppLaunchContextClass *klass)
*
* Since: 2.36
*/
- signals[LAUNCHED] = g_signal_new ("launched",
+ signals[LAUNCHED] = g_signal_new (I_("launched"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GAppLaunchContextClass, launched),
@@ -1102,7 +1102,7 @@ g_app_info_monitor_class_init (GAppInfoMonitorClass *class)
* Signal emitted when the app info database for changes (ie: newly installed
* or removed applications).
**/
- g_app_info_monitor_changed_signal = g_signal_new ("changed", G_TYPE_APP_INFO_MONITOR, G_SIGNAL_RUN_FIRST,
+ g_app_info_monitor_changed_signal = g_signal_new (I_("changed"), G_TYPE_APP_INFO_MONITOR, G_SIGNAL_RUN_FIRST,
0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
object_class->finalize = g_app_info_monitor_finalize;
diff --git a/gio/gapplication.c b/gio/gapplication.c
index c2ab68468..f45786562 100644
--- a/gio/gapplication.c
+++ b/gio/gapplication.c
@@ -1373,7 +1373,7 @@ g_application_class_init (GApplicationClass *class)
* after registration. See g_application_register().
*/
g_application_signals[SIGNAL_STARTUP] =
- g_signal_new ("startup", G_TYPE_APPLICATION, G_SIGNAL_RUN_FIRST,
+ g_signal_new (I_("startup"), G_TYPE_APPLICATION, G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GApplicationClass, startup),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
@@ -1385,7 +1385,7 @@ g_application_class_init (GApplicationClass *class)
* immediately after the main loop terminates.
*/
g_application_signals[SIGNAL_SHUTDOWN] =
- g_signal_new ("shutdown", G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST,
+ g_signal_new (I_("shutdown"), G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GApplicationClass, shutdown),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
@@ -1397,7 +1397,7 @@ g_application_class_init (GApplicationClass *class)
* activation occurs. See g_application_activate().
*/
g_application_signals[SIGNAL_ACTIVATE] =
- g_signal_new ("activate", G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST,
+ g_signal_new (I_("activate"), G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GApplicationClass, activate),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
@@ -1413,7 +1413,7 @@ g_application_class_init (GApplicationClass *class)
* files to open. See g_application_open() for more information.
*/
g_application_signals[SIGNAL_OPEN] =
- g_signal_new ("open", G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST,
+ g_signal_new (I_("open"), G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GApplicationClass, open),
NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_INT, G_TYPE_STRING);
@@ -1432,7 +1432,7 @@ g_application_class_init (GApplicationClass *class)
* process. See g_application_command_line_set_exit_status().
*/
g_application_signals[SIGNAL_COMMAND_LINE] =
- g_signal_new ("command-line", G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST,
+ g_signal_new (I_("command-line"), G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GApplicationClass, command_line),
g_signal_accumulator_first_wins, NULL,
NULL,
@@ -1493,7 +1493,7 @@ g_application_class_init (GApplicationClass *class)
* Since: 2.40
**/
g_application_signals[SIGNAL_HANDLE_LOCAL_OPTIONS] =
- g_signal_new ("handle-local-options", G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST,
+ g_signal_new (I_("handle-local-options"), G_TYPE_APPLICATION, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GApplicationClass, handle_local_options),
g_application_handle_local_options_accumulator, NULL, NULL,
G_TYPE_INT, 1, G_TYPE_VARIANT_DICT);
diff --git a/gio/gdbusauthobserver.c b/gio/gdbusauthobserver.c
index 23e7f3179..ffa3c64d6 100644
--- a/gio/gdbusauthobserver.c
+++ b/gio/gdbusauthobserver.c
@@ -166,7 +166,7 @@ g_dbus_auth_observer_class_init (GDBusAuthObserverClass *klass)
* Since: 2.26
*/
signals[AUTHORIZE_AUTHENTICATED_PEER_SIGNAL] =
- g_signal_new ("authorize-authenticated-peer",
+ g_signal_new (I_("authorize-authenticated-peer"),
G_TYPE_DBUS_AUTH_OBSERVER,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusAuthObserverClass, authorize_authenticated_peer),
@@ -190,7 +190,7 @@ g_dbus_auth_observer_class_init (GDBusAuthObserverClass *klass)
* Since: 2.34
*/
signals[ALLOW_MECHANISM_SIGNAL] =
- g_signal_new ("allow-mechanism",
+ g_signal_new (I_("allow-mechanism"),
G_TYPE_DBUS_AUTH_OBSERVER,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusAuthObserverClass, allow_mechanism),
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index d3f3f5017..c0972eebb 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -1047,7 +1047,7 @@ g_dbus_connection_class_init (GDBusConnectionClass *klass)
*
* Since: 2.26
*/
- signals[CLOSED_SIGNAL] = g_signal_new ("closed",
+ signals[CLOSED_SIGNAL] = g_signal_new (I_("closed"),
G_TYPE_DBUS_CONNECTION,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusConnectionClass, closed),
diff --git a/gio/gdbusdaemon.c b/gio/gdbusdaemon.c
index 3631a9030..3e0b21459 100644
--- a/gio/gdbusdaemon.c
+++ b/gio/gdbusdaemon.c
@@ -1695,7 +1695,7 @@ g_dbus_daemon_class_init (GDBusDaemonClass *klass)
gobject_class->get_property = g_dbus_daemon_get_property;
g_dbus_daemon_signals[SIGNAL_IDLE_TIMEOUT] =
- g_signal_new ("idle-timeout",
+ g_signal_new (I_("idle-timeout"),
G_TYPE_DBUS_DAEMON,
G_SIGNAL_RUN_LAST,
0,
diff --git a/gio/gdbusinterfaceskeleton.c b/gio/gdbusinterfaceskeleton.c
index 0070e8b6c..e5f27aff3 100644
--- a/gio/gdbusinterfaceskeleton.c
+++ b/gio/gdbusinterfaceskeleton.c
@@ -242,7 +242,7 @@ g_dbus_interface_skeleton_class_init (GDBusInterfaceSkeletonClass *klass)
* Since: 2.30
*/
signals[G_AUTHORIZE_METHOD_SIGNAL] =
- g_signal_new ("g-authorize-method",
+ g_signal_new (I_("g-authorize-method"),
G_TYPE_DBUS_INTERFACE_SKELETON,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusInterfaceSkeletonClass, g_authorize_method),
diff --git a/gio/gdbusobject.c b/gio/gdbusobject.c
index 570d6b7c0..fe8fb3c6e 100644
--- a/gio/gdbusobject.c
+++ b/gio/gdbusobject.c
@@ -59,7 +59,7 @@ g_dbus_object_default_init (GDBusObjectIface *iface)
*
* Since: 2.30
*/
- g_signal_new ("interface-added",
+ g_signal_new (I_("interface-added"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectIface, interface_added),
@@ -79,7 +79,7 @@ g_dbus_object_default_init (GDBusObjectIface *iface)
*
* Since: 2.30
*/
- g_signal_new ("interface-removed",
+ g_signal_new (I_("interface-removed"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectIface, interface_removed),
diff --git a/gio/gdbusobjectmanager.c b/gio/gdbusobjectmanager.c
index eb837f0e1..d899c00cc 100644
--- a/gio/gdbusobjectmanager.c
+++ b/gio/gdbusobjectmanager.c
@@ -63,7 +63,7 @@ g_dbus_object_manager_default_init (GDBusObjectManagerIface *iface)
*
* Since: 2.30
*/
- g_signal_new ("object-added",
+ g_signal_new (I_("object-added"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, object_added),
@@ -83,7 +83,7 @@ g_dbus_object_manager_default_init (GDBusObjectManagerIface *iface)
*
* Since: 2.30
*/
- g_signal_new ("object-removed",
+ g_signal_new (I_("object-removed"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, object_removed),
@@ -107,7 +107,7 @@ g_dbus_object_manager_default_init (GDBusObjectManagerIface *iface)
*
* Since: 2.30
*/
- g_signal_new ("interface-added",
+ g_signal_new (I_("interface-added"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, interface_added),
@@ -132,7 +132,7 @@ g_dbus_object_manager_default_init (GDBusObjectManagerIface *iface)
*
* Since: 2.30
*/
- g_signal_new ("interface-removed",
+ g_signal_new (I_("interface-removed"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, interface_removed),
diff --git a/gio/gdbusobjectmanagerclient.c b/gio/gdbusobjectmanagerclient.c
index 1a287f36e..29bb1dbd0 100644
--- a/gio/gdbusobjectmanagerclient.c
+++ b/gio/gdbusobjectmanagerclient.c
@@ -511,7 +511,7 @@ g_dbus_object_manager_client_class_init (GDBusObjectManagerClientClass *klass)
* Since: 2.30
*/
signals[INTERFACE_PROXY_SIGNAL_SIGNAL] =
- g_signal_new ("interface-proxy-signal",
+ g_signal_new (I_("interface-proxy-signal"),
G_TYPE_DBUS_OBJECT_MANAGER_CLIENT,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerClientClass, interface_proxy_signal),
@@ -549,7 +549,7 @@ g_dbus_object_manager_client_class_init (GDBusObjectManagerClientClass *klass)
* Since: 2.30
*/
signals[INTERFACE_PROXY_PROPERTIES_CHANGED_SIGNAL] =
- g_signal_new ("interface-proxy-properties-changed",
+ g_signal_new (I_("interface-proxy-properties-changed"),
G_TYPE_DBUS_OBJECT_MANAGER_CLIENT,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerClientClass, interface_proxy_properties_changed),
diff --git a/gio/gdbusobjectskeleton.c b/gio/gdbusobjectskeleton.c
index e0d01669a..f740975de 100644
--- a/gio/gdbusobjectskeleton.c
+++ b/gio/gdbusobjectskeleton.c
@@ -184,7 +184,7 @@ g_dbus_object_skeleton_class_init (GDBusObjectSkeletonClass *klass)
* Since: 2.30
*/
signals[AUTHORIZE_METHOD_SIGNAL] =
- g_signal_new ("authorize-method",
+ g_signal_new (I_("authorize-method"),
G_TYPE_DBUS_OBJECT_SKELETON,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectSkeletonClass, authorize_method),
diff --git a/gio/gdbusproxy.c b/gio/gdbusproxy.c
index 120e0ab51..52a22fb2f 100644
--- a/gio/gdbusproxy.c
+++ b/gio/gdbusproxy.c
@@ -590,7 +590,7 @@ g_dbus_proxy_class_init (GDBusProxyClass *klass)
*
* Since: 2.26
*/
- signals[PROPERTIES_CHANGED_SIGNAL] = g_signal_new ("g-properties-changed",
+ signals[PROPERTIES_CHANGED_SIGNAL] = g_signal_new (I_("g-properties-changed"),
G_TYPE_DBUS_PROXY,
G_SIGNAL_RUN_LAST | G_SIGNAL_MUST_COLLECT,
G_STRUCT_OFFSET (GDBusProxyClass, g_properties_changed),
@@ -613,7 +613,7 @@ g_dbus_proxy_class_init (GDBusProxyClass *klass)
*
* Since: 2.26
*/
- signals[SIGNAL_SIGNAL] = g_signal_new ("g-signal",
+ signals[SIGNAL_SIGNAL] = g_signal_new (I_("g-signal"),
G_TYPE_DBUS_PROXY,
G_SIGNAL_RUN_LAST | G_SIGNAL_MUST_COLLECT,
G_STRUCT_OFFSET (GDBusProxyClass, g_signal),
diff --git a/gio/gdbusserver.c b/gio/gdbusserver.c
index cf821304c..dbafc188b 100644
--- a/gio/gdbusserver.c
+++ b/gio/gdbusserver.c
@@ -419,7 +419,7 @@ g_dbus_server_class_init (GDBusServerClass *klass)
*
* Since: 2.26
*/
- _signals[NEW_CONNECTION_SIGNAL] = g_signal_new ("new-connection",
+ _signals[NEW_CONNECTION_SIGNAL] = g_signal_new (I_("new-connection"),
G_TYPE_DBUS_SERVER,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusServerClass, new_connection),
diff --git a/gio/glistmodel.c b/gio/glistmodel.c
index b43f3a3af..573744995 100644
--- a/gio/glistmodel.c
+++ b/gio/glistmodel.c
@@ -23,6 +23,7 @@
#include "config.h"
#include "glistmodel.h"
+#include "glibintl.h"
G_DEFINE_INTERFACE (GListModel, g_list_model, G_TYPE_OBJECT);
@@ -119,7 +120,7 @@ g_list_model_default_init (GListModelInterface *iface)
*
* Since: 2.44
*/
- g_list_model_changed_signal = g_signal_new ("items-changed",
+ g_list_model_changed_signal = g_signal_new (I_("items-changed"),
G_TYPE_LIST_MODEL,
G_SIGNAL_RUN_LAST,
0,
diff --git a/gio/gmenumodel.c b/gio/gmenumodel.c
index 612f8e7ae..4ffe21f65 100644
--- a/gio/gmenumodel.c
+++ b/gio/gmenumodel.c
@@ -21,6 +21,8 @@
#include "gmenumodel.h"
+#include "glibintl.h"
+
/**
* SECTION:gmenumodel
* @title: GMenuModel
@@ -448,7 +450,7 @@ g_menu_model_class_init (GMenuModelClass *class)
* reported. The signal is emitted after the modification.
**/
g_menu_model_items_changed_signal =
- g_signal_new ("items-changed", G_TYPE_MENU_MODEL,
+ g_signal_new (I_("items-changed"), G_TYPE_MENU_MODEL,
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
g_cclosure_marshal_generic, G_TYPE_NONE,
3, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
diff --git a/gio/gsettings.c b/gio/gsettings.c
index 03aecde4e..e421e0caf 100644
--- a/gio/gsettings.c
+++ b/gio/gsettings.c
@@ -732,7 +732,7 @@ g_settings_class_init (GSettingsClass *class)
* when key "x" changes.
*/
g_settings_signals[SIGNAL_CHANGED] =
- g_signal_new ("changed", G_TYPE_SETTINGS,
+ g_signal_new (I_("changed"), G_TYPE_SETTINGS,
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
G_STRUCT_OFFSET (GSettingsClass, changed),
NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE,
@@ -765,7 +765,7 @@ g_settings_class_init (GSettingsClass *class)
* event. FALSE to propagate the event further.
*/
g_settings_signals[SIGNAL_CHANGE_EVENT] =
- g_signal_new ("change-event", G_TYPE_SETTINGS,
+ g_signal_new (I_("change-event"), G_TYPE_SETTINGS,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GSettingsClass, change_event),
g_signal_accumulator_true_handled, NULL,
@@ -786,7 +786,7 @@ g_settings_class_init (GSettingsClass *class)
* callbacks when the writability of "x" changes.
*/
g_settings_signals[SIGNAL_WRITABLE_CHANGED] =
- g_signal_new ("writable-changed", G_TYPE_SETTINGS,
+ g_signal_new (I_("writable-changed"), G_TYPE_SETTINGS,
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
G_STRUCT_OFFSET (GSettingsClass, writable_changed),
NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE,
@@ -820,7 +820,7 @@ g_settings_class_init (GSettingsClass *class)
* event. FALSE to propagate the event further.
*/
g_settings_signals[SIGNAL_WRITABLE_CHANGE_EVENT] =
- g_signal_new ("writable-change-event", G_TYPE_SETTINGS,
+ g_signal_new (I_("writable-change-event"), G_TYPE_SETTINGS,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GSettingsClass, writable_change_event),
g_signal_accumulator_true_handled, NULL,
diff --git a/gio/gsocketservice.c b/gio/gsocketservice.c
index 89bc72866..746dd8684 100644
--- a/gio/gsocketservice.c
+++ b/gio/gsocketservice.c
@@ -337,7 +337,7 @@ g_socket_service_class_init (GSocketServiceClass *class)
* Since: 2.22
*/
g_socket_service_incoming_signal =
- g_signal_new ("incoming", G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST,
+ g_signal_new (I_("incoming"), G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GSocketServiceClass, incoming),
g_signal_accumulator_true_handled, NULL,
NULL, G_TYPE_BOOLEAN,
diff --git a/gio/gthreadedsocketservice.c b/gio/gthreadedsocketservice.c
index ab4bd0050..c22d08b9a 100644
--- a/gio/gthreadedsocketservice.c
+++ b/gio/gthreadedsocketservice.c
@@ -231,7 +231,7 @@ g_threaded_socket_service_class_init (GThreadedSocketServiceClass *class)
* Returns: %TRUE to stop further signal handlers from being called
*/
g_threaded_socket_service_run_signal =
- g_signal_new ("run", G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST,
+ g_signal_new (I_("run"), G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GThreadedSocketServiceClass, run),
g_signal_accumulator_true_handled, NULL,
NULL, G_TYPE_BOOLEAN,
diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
index b83d442d1..2e2ff5efd 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -1481,7 +1481,7 @@ g_unix_mount_monitor_class_init (GUnixMountMonitorClass *klass)
* Emitted when the unix mounts have changed.
*/
signals[MOUNTS_CHANGED] =
- g_signal_new ("mounts-changed",
+ g_signal_new (I_("mounts-changed"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
@@ -1496,7 +1496,7 @@ g_unix_mount_monitor_class_init (GUnixMountMonitorClass *klass)
* Emitted when the unix mount points have changed.
*/
signals[MOUNTPOINTS_CHANGED] =
- g_signal_new ("mountpoints-changed",
+ g_signal_new (I_("mountpoints-changed"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,