Commit 063d0a8f authored by Paolo Maggi's avatar Paolo Maggi Committed by Paolo Maggi

use gnome_vfs_format_uri_for_display instead of

2004-03-05  Paolo Maggi  <paolo.maggi@polito.it>

	* gedit-document.c (gedit_document_get_uri): use gnome_vfs_format_uri_for_display
	instead of eel_vfs_format_uri_for_display

	* gedit-file-selector-util.c (create_gtk_selector): uses
	gtk_file_chooser_set_current_folder_uri istead of gtk_file_chooser_set_current_folder
	because now the default_path must be an URI. Fixes bug #135987

	* gedit-file.c (get_dirname_from_uri): returns an URI
	(gedit_file_open): uses gedit_default_path when default_path is NULL
parent 9c6d6067
2004-03-05 Paolo Maggi <paolo.maggi@polito.it>
* gedit-document.c (gedit_document_get_uri): use gnome_vfs_format_uri_for_display
instead of eel_vfs_format_uri_for_display
* gedit-file-selector-util.c (create_gtk_selector): uses
gtk_file_chooser_set_current_folder_uri istead of gtk_file_chooser_set_current_folder
because now the default_path must be an URI. Fixes bug #135987
* gedit-file.c (get_dirname_from_uri): returns an URI
(gedit_file_open): uses gedit_default_path when default_path is NULL
2004-03-05 Paolo Borelli <pborelli@katamail.com>
* gedit-mdi.c: restore Higlight Mode menu to the proper sensitivity.
......
......@@ -639,7 +639,7 @@ gedit_document_get_uri (const GeditDocument* doc)
{
gchar *res;
res = eel_format_uri_for_display (doc->priv->uri);
res = gnome_vfs_format_uri_for_display (doc->priv->uri);
g_return_val_if_fail (res != NULL, g_strdup (_("Invalid file name")));
return res;
......
......@@ -411,9 +411,8 @@ create_gtk_selector (GtkWindow *parent,
}
/* FIXME: enable the use of URIs - Paolo */
if (default_path)
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filesel), default_path);
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (filesel), default_path);
if (default_filename)
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (filesel), default_filename);
......@@ -481,7 +480,7 @@ run_file_selector (GtkWindow *parent,
* @parent: optional window the dialog should be a transient for.
* @enable_vfs: if FALSE, restrict files to local paths.
* @title: optional window title to use
* @default_path: optional directory to start in
* @default_path: optional directory to start in (must be an URI)
*
* Creates and shows a modal open file dialog, waiting for the user to
* select a file or cancel before returning.
......@@ -506,7 +505,7 @@ gedit_file_selector_open (GtkWindow *parent,
* @parent: optional window the dialog should be a transient for
* @enable_vfs: if FALSE, restrict files to local paths.
* @title: optional window title to use
* @default_path: optional directory to start in
* @default_path: optional directory to start in (must be an URI)
*
* Creates and shows a modal open file dialog, waiting for the user to
* select a file or cancel before returning.
......@@ -532,7 +531,7 @@ gedit_file_selector_open_multi (GtkWindow *parent,
* @parent: optional window the dialog should be a transient for
* @enable_vfs: if FALSE, restrict files to local paths.
* @title: optional window title to use
* @default_path: optional directory to start in
* @default_path: optional directory to start in (must be an URI)
* @default_filename: optional file name to default to
*
* Creates and shows a modal save file dialog, waiting for the user to
......
......@@ -101,7 +101,8 @@ static gchar *
get_dirname_from_uri (const char *uri)
{
GnomeVFSURI *vfs_uri;
char *name;
gchar *name;
gchar *res;
/* Make VFS version of URI. */
vfs_uri = gnome_vfs_uri_new (uri);
......@@ -113,7 +114,10 @@ get_dirname_from_uri (const char *uri)
name = gnome_vfs_uri_extract_dirname (vfs_uri);
gnome_vfs_uri_unref (vfs_uri);
return name;
res = g_strdup_printf ("file:///%s", name);
g_free (name);
return res;
}
void
......@@ -202,6 +206,10 @@ gedit_file_open (GeditMDIChild *active_child)
g_free (raw_uri);
}
if (default_path == NULL)
default_path = (gedit_default_path != NULL) ?
g_strdup (gedit_default_path) : NULL;
files = gedit_file_selector_open_multi (
GTK_WINDOW (gedit_get_active_window ()),
TRUE,
......
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