aboutsummaryrefslogtreecommitdiff
path: root/shell/stock.c
diff options
context:
space:
mode:
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);
}