texttag: avoid use of g_signal_emit_by_name()

This avoids looking up the signal by name and instead uses the saved
signal identifier from gtktexttagtable.c
This commit is contained in:
Christian Hergert
2019-09-04 19:39:24 -07:00
parent 4f0842c713
commit 2aba6f0ba4
3 changed files with 13 additions and 4 deletions

View File

@ -78,6 +78,7 @@
#include "gtktexttag.h"
#include "gtktexttypes.h"
#include "gtktexttagtable.h"
#include "gtktexttagtableprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
@ -2317,10 +2318,7 @@ gtk_text_tag_changed (GtkTextTag *tag,
* added, this would increase significantly the number of signal connections.
*/
if (priv->table != NULL)
g_signal_emit_by_name (priv->table,
"tag-changed",
tag,
size_changed);
_gtk_text_tag_table_tag_changed (priv->table, tag, size_changed);
}
static int

View File

@ -464,3 +464,11 @@ _gtk_text_tag_table_remove_buffer (GtkTextTagTable *table,
priv->buffers = g_slist_remove (priv->buffers, buffer);
}
void
_gtk_text_tag_table_tag_changed (GtkTextTagTable *table,
GtkTextTag *tag,
gboolean size_changed)
{
g_signal_emit (table, signals[TAG_CHANGED], 0, tag, size_changed);
}

View File

@ -33,6 +33,9 @@ void _gtk_text_tag_table_add_buffer (GtkTextTagTable *table,
gpointer buffer);
void _gtk_text_tag_table_remove_buffer (GtkTextTagTable *table,
gpointer buffer);
void _gtk_text_tag_table_tag_changed (GtkTextTagTable *table,
GtkTextTag *tag,
gboolean size_changed);
G_END_DECLS