[easytag/wip/core-refactoring: 5/6] Use the GFile edit name in the file area entry
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/core-refactoring: 5/6] Use the GFile edit name in the file area entry
- Date: Sat, 16 Jan 2016 00:20:20 +0000 (UTC)
commit 063dbf2346aac6aa4aa29deb0f73bce0490f17ff
Author: David King <amigadave amigadave com>
Date: Fri Jan 15 23:43:16 2016 +0000
Use the GFile edit name in the file area entry
Avoid the situation that, when the encoding conversion fails, an
explanatory string is added to the filename for display by using the
edit name in the GtkEntry where the user can enter a new filename.
src/file_area.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/file_area.c b/src/file_area.c
index e14f584..dce7418 100644
--- a/src/file_area.c
+++ b/src/file_area.c
@@ -223,7 +223,8 @@ et_file_area_set_file_fields (EtFileArea *self,
file = g_file_new_for_path (cur_filename);
info = g_file_query_info (file, G_FILE_ATTRIBUTE_ACCESS_CAN_READ ","
- G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
+ G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE ","
+ G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME,
G_FILE_QUERY_INFO_NONE, NULL, &error);
/* Show/hide 'AccessStatusIcon' */
@@ -299,11 +300,12 @@ et_file_area_set_file_fields (EtFileArea *self,
_("File not found"));
g_object_unref (emblem_icon);
}
- g_object_unref (info);
}
+
/* Set filename into name_entry. */
- basename_utf8 = g_path_get_basename (((File_Name *)((GList *)ETFile->FileNameNew)->data)->value_utf8);
+ basename_utf8 = g_strdup (g_file_info_get_edit_name (info));
+ g_object_unref (info);
/* Remove the extension. */
if ((pos = g_utf8_strrchr (basename_utf8, -1, '.')) != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]