[nautilus/269-nautilus-shows-size-null-on-file-transfer] operations-ui-manager: Use better default labels
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/269-nautilus-shows-size-null-on-file-transfer] operations-ui-manager: Use better default labels
- Date: Tue, 24 Apr 2018 19:29:16 +0000 (UTC)
commit f0df0f28da24c04623e67f2677d80923a5b1f659
Author: António Fernandes <antoniof gnome org>
Date: Tue Apr 24 20:07:21 2018 +0100
operations-ui-manager: Use better default labels
We are showing "(null)" in the conflict dialog.
Example: https://gitlab.gnome.org/GNOME/nautilus/issues/269
Exposes the programming concept of NULL is wrong in itself, and in this
context it may lead a person to think it means the folder is empty.
Instead, get the strings with good default fallbacks.
src/nautilus-operations-ui-manager.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/src/nautilus-operations-ui-manager.c b/src/nautilus-operations-ui-manager.c
index 33266830a..de20bcffa 100644
--- a/src/nautilus-operations-ui-manager.c
+++ b/src/nautilus-operations-ui-manager.c
@@ -258,15 +258,18 @@ set_file_labels (FileConflictDialogData *data)
should_show_type = !nautilus_file_is_mime_type (data->source,
destination_mime_type);
- destination_date = nautilus_file_get_string_attribute (data->destination,
- "date_modified");
- destination_size = nautilus_file_get_string_attribute (data->destination,
- "size");
+ destination_date =
+ nautilus_file_get_string_attribute_with_default (data->destination,
+ "date_modified");
+ destination_size =
+ nautilus_file_get_string_attribute_with_default (data->destination,
+ "size");
if (should_show_type)
{
- destination_type = nautilus_file_get_string_attribute (data->destination,
- "type");
+ destination_type =
+ nautilus_file_get_string_attribute_with_default (data->destination,
+ "type");
}
destination_label = g_string_new (NULL);
@@ -288,15 +291,18 @@ set_file_labels (FileConflictDialogData *data)
g_string_append_printf (destination_label, "%s %s", _("Last modified:"), destination_date);
- source_date = nautilus_file_get_string_attribute (data->source,
- "date_modified");
- source_size = nautilus_file_get_string_attribute (data->source,
- "size");
+ source_date =
+ nautilus_file_get_string_attribute_with_default (data->source,
+ "date_modified");
+ source_size =
+ nautilus_file_get_string_attribute_with_default (data->source,
+ "size");
if (should_show_type)
{
- source_type = nautilus_file_get_string_attribute (data->source,
- "type");
+ source_type =
+ nautilus_file_get_string_attribute_with_default (data->source,
+ "type");
}
source_label = g_string_new (NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]