summaryrefslogtreecommitdiff
path: root/src/caja-pathbar.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-02-25 09:10:14 +0100
committerraveit65 <[email protected]>2021-03-11 08:07:35 +0100
commit58022791da71d950a715273063bce36aaeedcd0a (patch)
treea0f56dc7e6eeeee1f85874131597f551e3565f3e /src/caja-pathbar.c
parent1cbcf7ab18f45871b2bc280eb3ab79a333f77ee6 (diff)
downloadcaja-58022791da71d950a715273063bce36aaeedcd0a.tar.bz2
caja-58022791da71d950a715273063bce36aaeedcd0a.tar.xz
caja-pathbar: Fix cppcheck warning nullPointerRedundantCheck
Diffstat (limited to 'src/caja-pathbar.c')
-rw-r--r--src/caja-pathbar.c44
1 files changed, 19 insertions, 25 deletions
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c
index e0fb4b3b..a0789029 100644
--- a/src/caja-pathbar.c
+++ b/src/caja-pathbar.c
@@ -1610,21 +1610,18 @@ setup_file_path_mounted_mount (GFile *location, ButtonData *button_data)
{
result = TRUE;
/* set mount specific details in button_data */
- if (button_data)
+ icon = g_mount_get_icon (mount);
+ if (icon == NULL)
{
- icon = g_mount_get_icon (mount);
- if (icon == NULL)
- {
- icon = g_themed_icon_new (CAJA_ICON_FOLDER);
- }
- info = caja_icon_info_lookup (icon, CAJA_PATH_BAR_ICON_SIZE, scale);
- g_object_unref (icon);
- button_data->custom_icon = caja_icon_info_get_surface_at_size (info, CAJA_PATH_BAR_ICON_SIZE);
- g_object_unref (info);
- button_data->dir_name = g_mount_get_name (mount);
- button_data->type = MOUNT_BUTTON;
- button_data->fake_root = TRUE;
+ icon = g_themed_icon_new (CAJA_ICON_FOLDER);
}
+ info = caja_icon_info_lookup (icon, CAJA_PATH_BAR_ICON_SIZE, scale);
+ g_object_unref (icon);
+ button_data->custom_icon = caja_icon_info_get_surface_at_size (info, CAJA_PATH_BAR_ICON_SIZE);
+ g_object_unref (info);
+ button_data->dir_name = g_mount_get_name (mount);
+ button_data->type = MOUNT_BUTTON;
+ button_data->fake_root = TRUE;
g_object_unref (root);
break;
}
@@ -1634,20 +1631,17 @@ setup_file_path_mounted_mount (GFile *location, ButtonData *button_data)
{
result = TRUE;
/* set mount specific details in button_data */
- if (button_data)
+ icon = g_mount_get_icon (mount);
+ if (icon == NULL)
{
- icon = g_mount_get_icon (mount);
- if (icon == NULL)
- {
- icon = g_themed_icon_new (CAJA_ICON_FOLDER);
- }
- info = caja_icon_info_lookup (icon, CAJA_PATH_BAR_ICON_SIZE, scale);
- g_object_unref (icon);
- button_data->custom_icon = caja_icon_info_get_surface_at_size (info, CAJA_PATH_BAR_ICON_SIZE);
- g_object_unref (info);
- button_data->type = DEFAULT_LOCATION_BUTTON;
- button_data->fake_root = TRUE;
+ icon = g_themed_icon_new (CAJA_ICON_FOLDER);
}
+ info = caja_icon_info_lookup (icon, CAJA_PATH_BAR_ICON_SIZE, scale);
+ g_object_unref (icon);
+ button_data->custom_icon = caja_icon_info_get_surface_at_size (info, CAJA_PATH_BAR_ICON_SIZE);
+ g_object_unref (info);
+ button_data->type = DEFAULT_LOCATION_BUTTON;
+ button_data->fake_root = TRUE;
g_object_unref (default_location);
g_object_unref (root);
break;