diff options
author | Alexandru Pandelea <alexandru.pandelea@gmail.com> | 2016-06-08 22:52:28 +0300 |
---|---|---|
committer | Alexandru Pandelea <alexandru.pandelea@gmail.com> | 2016-07-02 14:57:16 +0300 |
commit | bafc2b5285a341813351c92e702b5c6a67b8fc99 (patch) | |
tree | 2eedfee5139ed9e30d35b38c6fe78cefe7d69793 | |
parent | b340772ef4b46cdf005271c805cfe78937bb2a3f (diff) | |
download | nautilus-bafc2b5285a341813351c92e702b5c6a67b8fc99.tar.gz |
Limit the label size
Use predefined label functions to limit the label size instead of
using memcpy to limit the label size.
https://bugzilla.gnome.org/show_bug.cgi?id=768311
-rw-r--r-- | src/nautilus-batch-rename.c | 4 | ||||
-rw-r--r-- | src/nautilus-rename-utilities.c | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/nautilus-batch-rename.c b/src/nautilus-batch-rename.c index ec137ccc4..c3c2da30e 100644 --- a/src/nautilus-batch-rename.c +++ b/src/nautilus-batch-rename.c @@ -27,6 +27,7 @@ #define ADD_TEXT_ENTRY_SIZE 550 #define REPLACE_ENTRY_SIZE 275 +#define MAX_DISPLAY_LEN 40 struct _NautilusBatchRename { @@ -287,6 +288,9 @@ nautilus_batch_rename_new (NautilusFilesView *view) gtk_widget_grab_focus (dialog->name_entry); + gtk_label_set_ellipsize (GTK_LABEL (dialog->error_label), PANGO_ELLIPSIZE_END); + gtk_label_set_max_width_chars (GTK_LABEL (dialog->error_label), MAX_DISPLAY_LEN); + /* update display text */ file_names_widget_entry_on_changed (dialog); diff --git a/src/nautilus-rename-utilities.c b/src/nautilus-rename-utilities.c index c9ec0f62f..6db7ccb7f 100644 --- a/src/nautilus-rename-utilities.c +++ b/src/nautilus-rename-utilities.c @@ -159,8 +159,5 @@ get_new_display_name (NautilusBatchRenameModes mode, result = get_new_name (mode, file_name, entry_text, replace_text); - if (strlen (result) >= MAX_DISPLAY_LEN) - memcpy (result + MAX_DISPLAY_LEN, "...\0",4); - return result; }
\ No newline at end of file |