From d12302def2b23e124509f54afd0d9da49651d9f3 Mon Sep 17 00:00:00 2001 From: monsta Date: Fri, 22 Dec 2017 21:01:59 +0300 Subject: libslab: remove a bunch of unused code --- libslab/slab-mate-util.c | 90 ------------------------------------------------ 1 file changed, 90 deletions(-) (limited to 'libslab/slab-mate-util.c') diff --git a/libslab/slab-mate-util.c b/libslab/slab-mate-util.c index 15a61ddb..efb4a535 100644 --- a/libslab/slab-mate-util.c +++ b/libslab/slab-mate-util.c @@ -139,96 +139,6 @@ open_desktop_item_help (MateDesktopItem * desktop_item) return TRUE; } -gboolean -slab_load_image (GtkImage * image, GtkIconSize size, const gchar * image_id) -{ - GdkPixbuf *pixbuf; - gint width; - gint height; - - gchar *id; - - if (!image_id) - return FALSE; - - id = g_strdup (image_id); - - gtk_icon_size_lookup (size, &width, &height); - - if (g_path_is_absolute (id)) - pixbuf = gdk_pixbuf_new_from_file_at_size (id, width, height, NULL); - else - { - if ( /* file extensions are not copesetic with loading by "name" */ - g_str_has_suffix (id, ".png") || - g_str_has_suffix (id, ".svg") || - g_str_has_suffix (id, ".xpm") - ) - - id[strlen (id) - 4] = '\0'; - - pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), id, width, 0, - NULL); - } - - if (pixbuf) - { - gtk_image_set_from_pixbuf (image, pixbuf); - - g_object_unref (pixbuf); - - g_free (id); - - return TRUE; - } - else - { /* This will make it show the "broken image" icon */ - gtk_image_set_from_file (image, id); - - g_free (id); - - return FALSE; - } -} - -gchar * -string_replace_once (const gchar * str_template, const gchar * key, const gchar * value) -{ - GString *str_built; - gint pivot; - - pivot = strstr (str_template, key) - str_template; - - str_built = g_string_new_len (str_template, pivot); - g_string_append (str_built, value); - g_string_append (str_built, &str_template[pivot + strlen (key)]); - - return g_string_free (str_built, FALSE); -} - -void -spawn_process (const gchar *command) -{ - gchar **argv; - GError *error = NULL; - - if (!command || strlen (command) < 1) - return; - - argv = g_strsplit (command, " ", -1); - - g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error); - - if (error) - { - g_warning ("error spawning [%s]: [%s]\n", command, error->message); - - g_error_free (error); - } - - g_strfreev (argv); -} - void copy_file (const gchar * src_uri, const gchar * dst_uri) { -- cgit v1.2.1