aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-21 15:59:20 (GMT)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-28 11:19:24 (GMT)
commite8610bea69461b3523bc0b99fc40f1863fa3742a (patch)
tree531bc3c7d646c5199abc186a1ac8f6aacfe4cd3e
parent5658ac71b560651ac8f2fb45c6f4a94858fd4122 (diff)
camorama-stock-items: get rid of gnome-specific file location function
The only reason why gnome.h is included here is due to a function to locate an icon file. On other parts of Camorama, PACKAGE_DATA_DIR is used, instead, in order o get a pixmap. So, standardize it, by doing the same way here. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--src/camorama-stock-items.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/camorama-stock-items.c b/src/camorama-stock-items.c
index 8451476..f4681a4 100644
--- a/src/camorama-stock-items.c
+++ b/src/camorama-stock-items.c
@@ -4,7 +4,6 @@
#include <config.h>
#endif
-#include <gnome.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
@@ -13,7 +12,8 @@ static GtkStockItem camorama_items[] = {
};
static void
-add_default_image(const gchar* stock_id, gint size, gchar *pixfilename) {
+add_default_image(const gchar* stock_id, gint size, gchar *pixfilename)
+{
GdkPixbuf* buf = gdk_pixbuf_new_from_file(pixfilename, NULL);
g_return_if_fail(buf);
@@ -27,7 +27,7 @@ camorama_stock_init(void) {
GtkIconFactory* factory = gtk_icon_factory_new();
GtkIconSet * set = gtk_icon_set_new ();
GtkIconSource * source = gtk_icon_source_new();
-
+
gtk_stock_add_static(camorama_items, G_N_ELEMENTS(camorama_items));
gtk_icon_source_set_size_wildcarded(source, TRUE);
@@ -39,14 +39,11 @@ camorama_stock_init(void) {
gtk_icon_factory_add(factory, CAMORAMA_STOCK_WEBCAM, set);
- pixfilename = gnome_program_locate_file(NULL, GNOME_FILE_DOMAIN_APP_DATADIR, "pixmaps/camorama-webcam-16.png", TRUE, NULL);
- add_default_image(CAMORAMA_STOCK_WEBCAM, 16, pixfilename);
-
- pixfilename = gnome_program_locate_file(NULL, GNOME_FILE_DOMAIN_APP_DATADIR, "pixmaps/camorama-webcam-24.png", TRUE, NULL);
- add_default_image(CAMORAMA_STOCK_WEBCAM, 24, pixfilename);
+ add_default_image(CAMORAMA_STOCK_WEBCAM, 16, PACKAGE_DATA_DIR "/pixmaps/camorama-webcam-16.png");
+ add_default_image(CAMORAMA_STOCK_WEBCAM, 16, PACKAGE_DATA_DIR "/pixmaps/camorama-webcam-24.png");
gtk_icon_factory_add_default(factory);
-
+
gtk_icon_set_unref(set);
gtk_icon_source_free(source);
}

Privacy Policy