Generate and set the tooltip text only if it is actually necessary.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3289 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
13682cfd10
commit
e34b38bbbe
@ -1004,7 +1004,6 @@ static void add_tree_tag(GeanyDocument *doc, const TMTag *tag, GHashTable *paren
|
|||||||
{
|
{
|
||||||
const gchar *name;
|
const gchar *name;
|
||||||
const gchar *parent_name = get_parent_name(tag, ft_id);
|
const gchar *parent_name = get_parent_name(tag, ft_id);
|
||||||
gchar *tooltip;
|
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
GtkTreeIter *icon_iter = NULL, *child = NULL;
|
GtkTreeIter *icon_iter = NULL, *child = NULL;
|
||||||
GdkPixbuf *icon = NULL;
|
GdkPixbuf *icon = NULL;
|
||||||
@ -1041,15 +1040,19 @@ static void add_tree_tag(GeanyDocument *doc, const TMTag *tag, GHashTable *paren
|
|||||||
gtk_tree_store_append(tree_store, child, parent);
|
gtk_tree_store_append(tree_store, child, parent);
|
||||||
|
|
||||||
name = get_symbol_name(doc, tag, (parent_name != NULL));
|
name = get_symbol_name(doc, tag, (parent_name != NULL));
|
||||||
tooltip = get_symbol_tooltip(doc, tag);
|
|
||||||
gtk_tree_store_set(tree_store, child,
|
gtk_tree_store_set(tree_store, child,
|
||||||
SYMBOLS_COLUMN_ICON, icon,
|
SYMBOLS_COLUMN_ICON, icon,
|
||||||
SYMBOLS_COLUMN_NAME, name,
|
SYMBOLS_COLUMN_NAME, name,
|
||||||
SYMBOLS_COLUMN_TAG, tag,
|
SYMBOLS_COLUMN_TAG, tag,
|
||||||
SYMBOLS_COLUMN_TOOLTIP, tooltip,
|
|
||||||
-1);
|
-1);
|
||||||
|
|
||||||
|
if (gtk_check_version(2, 12, 0) == NULL)
|
||||||
|
{
|
||||||
|
gchar *tooltip = get_symbol_tooltip(doc, tag);
|
||||||
|
gtk_tree_store_set(tree_store, child, SYMBOLS_COLUMN_TOOLTIP, tooltip, -1);
|
||||||
g_free(tooltip);
|
g_free(tooltip);
|
||||||
|
}
|
||||||
|
|
||||||
if (G_LIKELY(G_IS_OBJECT(icon)))
|
if (G_LIKELY(G_IS_OBJECT(icon)))
|
||||||
g_object_unref(icon);
|
g_object_unref(icon);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user