summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-ui-utilities.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-05-02 01:09:20 +0200
committerraveit65 <[email protected]>2019-05-06 13:53:37 +0200
commita110c542bd7a16625f03c97e2fefa3be8da50c85 (patch)
tree7af078f9084b33eb0d5df7f3657a1f8049ff6b83 /libcaja-private/caja-ui-utilities.c
parent476f56a25be636970b336d525a7766b6d1eb3fff (diff)
downloadcaja-a110c542bd7a16625f03c97e2fefa3be8da50c85.tar.bz2
caja-a110c542bd7a16625f03c97e2fefa3be8da50c85.tar.xz
libcaja-private: reduce the scope of some variables
Diffstat (limited to 'libcaja-private/caja-ui-utilities.c')
-rw-r--r--libcaja-private/caja-ui-utilities.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libcaja-private/caja-ui-utilities.c b/libcaja-private/caja-ui-utilities.c
index 0f9da559..0a83e3c6 100644
--- a/libcaja-private/caja-ui-utilities.c
+++ b/libcaja-private/caja-ui-utilities.c
@@ -93,7 +93,6 @@ caja_ui_string_get (const char *filename)
{
static GHashTable *ui_cache = NULL;
char *ui;
- char *path;
if (ui_cache == NULL)
{
@@ -104,6 +103,8 @@ caja_ui_string_get (const char *filename)
ui = g_hash_table_lookup (ui_cache, filename);
if (ui == NULL)
{
+ char *path;
+
path = caja_ui_file (filename);
if (path == NULL || !g_file_get_contents (path, &ui, NULL, NULL))
{
@@ -171,7 +172,6 @@ caja_action_from_menu_item (CajaMenuItem *item,
char *name, *label, *tip, *icon_name;
gboolean sensitive, priority;
GtkAction *action;
- cairo_surface_t *surface;
g_object_get (G_OBJECT (item),
"name", &name, "label", &label,
@@ -187,6 +187,8 @@ caja_action_from_menu_item (CajaMenuItem *item,
if (icon_name != NULL)
{
+ cairo_surface_t *surface;
+
surface = get_action_icon (icon_name,
caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU),
parent_widget);
@@ -220,7 +222,6 @@ caja_toolbar_action_from_menu_item (CajaMenuItem *item, GtkWidget *parent_widget
char *name, *label, *tip, *icon_name;
gboolean sensitive, priority;
GtkAction *action;
- cairo_surface_t *surface;
g_object_get (G_OBJECT (item),
"name", &name, "label", &label,
@@ -236,6 +237,8 @@ caja_toolbar_action_from_menu_item (CajaMenuItem *item, GtkWidget *parent_widget
if (icon_name != NULL)
{
+ cairo_surface_t *surface;
+
surface = get_action_icon (icon_name,
caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_LARGE_TOOLBAR),
parent_widget);
@@ -271,11 +274,12 @@ caja_toolbar_action_from_menu_item (CajaMenuItem *item, GtkWidget *parent_widget
static GdkPixbuf *
caja_get_thumbnail_frame (void)
{
- char *image_path;
static GdkPixbuf *thumbnail_frame = NULL;
if (thumbnail_frame == NULL)
{
+ char *image_path;
+
image_path = caja_pixmap_file ("thumbnail_frame.png");
if (image_path != NULL)
{