Commit 1ac6ace8 authored by Benjamin Otte's avatar Benjamin Otte

filechooserentry: Redo _gtk_file_chooser_entry_get_file_part()

The new version does not need to update any text, it just strips the
last part of the existing entry.
parent e2105c2b
......@@ -1719,8 +1719,16 @@ _gtk_file_chooser_entry_get_current_folder (GtkFileChooserEntry *chooser_entry)
const gchar *
_gtk_file_chooser_entry_get_file_part (GtkFileChooserEntry *chooser_entry)
{
commit_completion_and_refresh (chooser_entry);
return chooser_entry->file_part;
const char *last_slash, *text;
g_return_val_if_fail (GTK_IS_FILE_CHOOSER_ENTRY (chooser_entry), NULL);
text = gtk_entry_get_text (GTK_ENTRY (chooser_entry));
last_slash = strrchr (text, G_DIR_SEPARATOR);
if (last_slash)
return last_slash + 1;
else
return text;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment