aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-12-26 13:26:18 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-12-26 13:26:18 +0800
commitbd31f49bac99f21656dc7d0352d5b3f7385f71b2 (patch)
treeb693ad7ec135bd8031458611b5ec485abd866463 /widgets/misc/e-attachment.c
parent5f83c587b2da0b9578117796253b7726e98748cc (diff)
downloadgsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.tar.gz
gsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.tar.zst
gsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets/misc/e-attachment.c')
-rw-r--r--widgets/misc/e-attachment.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index dc9b533fcc..44dd467967 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -107,6 +107,7 @@ static gboolean
create_system_thumbnail (EAttachment *attachment, GIcon **icon)
{
GFile *file;
+ GFile *icon_file;
gchar *thumbnail = NULL;
g_return_val_if_fail (attachment != NULL, FALSE);
@@ -122,27 +123,33 @@ create_system_thumbnail (EAttachment *attachment, GIcon **icon)
}
}
- if (thumbnail) {
- GFile *gf = g_file_new_for_path (thumbnail);
+ if (thumbnail == NULL)
+ return FALSE;
- g_return_val_if_fail (gf != NULL, FALSE);
- if (*icon)
- g_object_unref (*icon);
+ icon_file = g_file_new_for_path (thumbnail);
- *icon = g_file_icon_new (gf);
- g_object_unref (gf);
+ if (*icon)
+ g_object_unref (*icon);
- if (file) {
- GFileInfo *fi = e_attachment_get_file_info (attachment);
+ *icon = g_file_icon_new (icon_file);
- if (fi)
- g_file_info_set_attribute_byte_string (fi, G_FILE_ATTRIBUTE_THUMBNAIL_PATH, thumbnail);
- }
+ g_object_unref (icon_file);
+
+ if (file) {
+ GFileInfo *file_info;
+ const gchar *attribute;
+
+ file_info = e_attachment_get_file_info (attachment);
+ attribute = G_FILE_ATTRIBUTE_THUMBNAIL_PATH;
+
+ if (file_info != NULL)
+ g_file_info_set_attribute_byte_string (
+ file_info, attribute, thumbnail);
}
g_free (thumbnail);
- return thumbnail != NULL;
+ return TRUE;
}
static gchar *