aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
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
parent5f83c587b2da0b9578117796253b7726e98748cc (diff)
downloadgsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.tar
gsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.tar.gz
gsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.tar.bz2
gsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.tar.lz
gsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.tar.xz
gsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.tar.zst
gsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-attachment-button.c6
-rw-r--r--widgets/misc/e-attachment.c33
2 files changed, 24 insertions, 15 deletions
diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c
index a6af71e216..adf40d4df4 100644
--- a/widgets/misc/e-attachment-button.c
+++ b/widgets/misc/e-attachment-button.c
@@ -109,11 +109,13 @@ attachment_button_menu_position (GtkMenu *menu,
else if (menu_requisition.width > widget->allocation.width)
*x -= menu_requisition.width - widget->allocation.width;
- if ((*y + toggle_button->allocation.height + menu_requisition.height) <= monitor.y + monitor.height)
+ if ((*y + toggle_button->allocation.height +
+ menu_requisition.height) <= monitor.y + monitor.height)
*y += toggle_button->allocation.height;
else if ((*y - menu_requisition.height) >= monitor.y)
*y -= menu_requisition.height;
- else if (monitor.y + monitor.height - (*y + toggle_button->allocation.height) > *y)
+ else if (monitor.y + monitor.height -
+ (*y + toggle_button->allocation.height) > *y)
*y += toggle_button->allocation.height;
else
*y -= menu_requisition.height;
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 *