[nautilus/wip/ernestask/gtk4-continued: 2/2] properties-window: Tweak code style
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/ernestask/gtk4-continued: 2/2] properties-window: Tweak code style
- Date: Sat, 9 Feb 2019 16:01:10 +0000 (UTC)
commit 090495bb18bbdec8fb19318897e71340f5813d8b
Author: Ernestas Kulik <ekulik redhat com>
Date: Sat Feb 9 17:00:07 2019 +0100
properties-window: Tweak code style
src/nautilus-properties-window.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index ecb9154aa..d0ac412ce 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -328,11 +328,9 @@ static GdkTexture *
get_texture_for_selection (NautilusPropertiesWindow *window)
{
g_autoptr (NautilusIconInfo) icon = NULL;
- NautilusIconInfo *new_icon;
GList *l;
gint icon_scale;
- icon = NULL;
icon_scale = gtk_widget_get_scale_factor (GTK_WIDGET (window->notebook));
for (l = window->original_files; l != NULL; l = l->next)
@@ -341,7 +339,7 @@ get_texture_for_selection (NautilusPropertiesWindow *window)
file = NAUTILUS_FILE (l->data);
- if (!icon)
+ if (icon == NULL)
{
icon = nautilus_file_get_icon (file, NAUTILUS_CANVAS_ICON_SIZE_SMALL, icon_scale,
NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS |
@@ -349,21 +347,20 @@ get_texture_for_selection (NautilusPropertiesWindow *window)
}
else
{
+ g_autoptr (NautilusIconInfo) new_icon = NULL;
+
new_icon = nautilus_file_get_icon (file, NAUTILUS_CANVAS_ICON_SIZE_SMALL, icon_scale,
NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS |
NAUTILUS_FILE_ICON_FLAGS_IGNORE_VISITING);
- if (!new_icon || new_icon != icon)
+ if (new_icon == NULL || new_icon != icon)
{
- g_object_unref (icon);
- g_object_unref (new_icon);
- icon = NULL;
+ g_clear_object (&icon);
break;
}
- g_object_unref (new_icon);
}
}
- if (!icon)
+ if (icon == NULL)
{
icon = nautilus_icon_info_lookup_from_name ("text-x-generic",
NAUTILUS_CANVAS_ICON_SIZE_STANDARD,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]