aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/misc')
-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 *