diff options
author | rbuj <[email protected]> | 2021-02-25 09:10:14 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-21 19:33:51 +0200 |
commit | bba4e9f1ed5f5e658dd85f83a300eb6629796d68 (patch) | |
tree | 8c86c52a039cc65615ca6b4e1f73042221123245 /src | |
parent | 9f1fbcec3c113e2047a5b124798331571fcee2fb (diff) | |
download | caja-bba4e9f1ed5f5e658dd85f83a300eb6629796d68.tar.bz2 caja-bba4e9f1ed5f5e658dd85f83a300eb6629796d68.tar.xz |
caja-pathbar: Fix cppcheck warning nullPointerRedundantCheck
Diffstat (limited to 'src')
-rw-r--r-- | src/caja-pathbar.c | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c index 00b357f7..797182ff 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; |