summaryrefslogtreecommitdiff
path: root/shell/stock.c
diff options
context:
space:
mode:
authorSimon Quigley <tsimonq2@ubuntu.com>2017-11-25 13:35:47 -0600
committerSimon Quigley <tsimonq2@ubuntu.com>2017-11-25 13:35:47 -0600
commit11e616945340e87a1f567ab92e6dfac3068875b1 (patch)
tree451c1385230f29d3f4deef777b41609bed6e8090 /shell/stock.c
parent9a9db98089717990cd5e0eef529f6bb0819ebe46 (diff)
New upstream version 0.5.1+git20171103
Diffstat (limited to 'shell/stock.c')
-rw-r--r--shell/stock.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/shell/stock.c b/shell/stock.c
index ad1a0135..86d66778 100644
--- a/shell/stock.c
+++ b/shell/stock.c
@@ -38,6 +38,8 @@ static GtkIconFactory *icon_factory;
void stock_icon_register(gchar * filename, gchar * stock_id)
{
+#if GTK_CHECK_VERSION(3, 0, 0)
+#else
GtkIconSet *icon_set;
GtkIconSource *icon_source;
@@ -52,10 +54,13 @@ void stock_icon_register(gchar * filename, gchar * stock_id)
gtk_icon_factory_add(icon_factory, stock_id, icon_set);
gtk_icon_set_unref(icon_set);
+#endif
}
void stock_icon_register_pixbuf(GdkPixbuf * pixbuf, gchar * stock_id)
{
+#if GTK_CHECK_VERSION(3, 0, 0)
+#else
GtkIconSet *icon_set;
GtkIconSource *icon_source;
@@ -69,6 +74,7 @@ void stock_icon_register_pixbuf(GdkPixbuf * pixbuf, gchar * stock_id)
gtk_icon_factory_add(icon_factory, stock_id, icon_set);
gtk_icon_set_unref(icon_set);
+#endif
}
void stock_icons_init(void)
@@ -78,14 +84,20 @@ void stock_icons_init(void)
DEBUG("initializing stock icons");
+#if GTK_CHECK_VERSION(3, 0, 0)
+#else
icon_factory = gtk_icon_factory_new();
+#endif
for (i = 0; i < n_stock_icons; i++) {
stock_icon_register(stock_icons[i].filename,
stock_icons[i].stock_id);
}
+#if GTK_CHECK_VERSION(3, 0, 0)
+#else
gtk_icon_factory_add_default(icon_factory);
+#endif
g_object_unref(icon_factory);
}