mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
Desktop directory is not translated. (set_tree_model): There might not be
2004-02-20 Alexander Larsson <alexl@redhat.com> * gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop): Desktop directory is not translated. (set_tree_model): There might not be volumes for all paths. * gtk/gtkfilechooserwidget.c: (gtk_file_chooser_widget_constructor): Use gtk_file_chooser_set_current_folder to set cwd.
This commit is contained in:
parent
87ce33548f
commit
0300bfdc32
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
2004-02-20 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop):
|
||||
Desktop directory is not translated.
|
||||
(set_tree_model):
|
||||
There might not be volumes for all paths.
|
||||
* gtk/gtkfilechooserwidget.c:
|
||||
(gtk_file_chooser_widget_constructor):
|
||||
Use gtk_file_chooser_set_current_folder to set cwd.
|
||||
|
||||
Thu Feb 19 19:58:53 2004 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* gtk/gtkpathbar.[ch]: New widget to handle the path in the
|
||||
|
@ -1,3 +1,13 @@
|
||||
2004-02-20 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop):
|
||||
Desktop directory is not translated.
|
||||
(set_tree_model):
|
||||
There might not be volumes for all paths.
|
||||
* gtk/gtkfilechooserwidget.c:
|
||||
(gtk_file_chooser_widget_constructor):
|
||||
Use gtk_file_chooser_set_current_folder to set cwd.
|
||||
|
||||
Thu Feb 19 19:58:53 2004 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* gtk/gtkpathbar.[ch]: New widget to handle the path in the
|
||||
|
@ -1,3 +1,13 @@
|
||||
2004-02-20 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop):
|
||||
Desktop directory is not translated.
|
||||
(set_tree_model):
|
||||
There might not be volumes for all paths.
|
||||
* gtk/gtkfilechooserwidget.c:
|
||||
(gtk_file_chooser_widget_constructor):
|
||||
Use gtk_file_chooser_set_current_folder to set cwd.
|
||||
|
||||
Thu Feb 19 19:58:53 2004 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* gtk/gtkpathbar.[ch]: New widget to handle the path in the
|
||||
|
@ -1,3 +1,13 @@
|
||||
2004-02-20 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop):
|
||||
Desktop directory is not translated.
|
||||
(set_tree_model):
|
||||
There might not be volumes for all paths.
|
||||
* gtk/gtkfilechooserwidget.c:
|
||||
(gtk_file_chooser_widget_constructor):
|
||||
Use gtk_file_chooser_set_current_folder to set cwd.
|
||||
|
||||
Thu Feb 19 19:58:53 2004 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* gtk/gtkpathbar.[ch]: New widget to handle the path in the
|
||||
|
@ -1,3 +1,13 @@
|
||||
2004-02-20 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop):
|
||||
Desktop directory is not translated.
|
||||
(set_tree_model):
|
||||
There might not be volumes for all paths.
|
||||
* gtk/gtkfilechooserwidget.c:
|
||||
(gtk_file_chooser_widget_constructor):
|
||||
Use gtk_file_chooser_set_current_folder to set cwd.
|
||||
|
||||
Thu Feb 19 19:58:53 2004 Jonathan Blandford <jrb@gnome.org>
|
||||
|
||||
* gtk/gtkpathbar.[ch]: New widget to handle the path in the
|
||||
|
@ -649,9 +649,7 @@ shortcuts_append_desktop (GtkFileChooserDefault *impl)
|
||||
char *name;
|
||||
GtkFilePath *path;
|
||||
|
||||
/* FIXME: What is the Right Way of finding the desktop directory? */
|
||||
|
||||
name = g_build_filename (g_get_home_dir (), _("Desktop"), NULL);
|
||||
name = g_build_filename (g_get_home_dir (), "Desktop", NULL);
|
||||
path = gtk_file_system_filename_to_path (impl->file_system, name);
|
||||
g_free (name);
|
||||
|
||||
@ -2127,18 +2125,36 @@ static void
|
||||
set_tree_model (GtkFileChooserDefault *impl, const GtkFilePath *path)
|
||||
{
|
||||
GtkFileSystemVolume *volume;
|
||||
GtkFilePath *volume_path;
|
||||
GtkFilePath *base_path, *parent_path;
|
||||
|
||||
base_path = NULL;
|
||||
|
||||
volume = gtk_file_system_get_volume_for_path (impl->file_system, path);
|
||||
volume_path = gtk_file_system_volume_get_base_path (impl->file_system, volume);
|
||||
|
||||
if (volume)
|
||||
base_path = gtk_file_system_volume_get_base_path (impl->file_system, volume);
|
||||
|
||||
if (base_path == NULL)
|
||||
{
|
||||
base_path = gtk_file_path_copy (path);
|
||||
while (gtk_file_system_get_parent (impl->file_system,
|
||||
base_path,
|
||||
&parent_path,
|
||||
NULL) &&
|
||||
parent_path != NULL)
|
||||
{
|
||||
gtk_file_path_free (base_path);
|
||||
base_path = parent_path;
|
||||
}
|
||||
}
|
||||
|
||||
if (impl->current_volume_path && gtk_file_path_compare (volume_path, impl->current_volume_path) == 0)
|
||||
if (impl->current_volume_path && gtk_file_path_compare (base_path, impl->current_volume_path) == 0)
|
||||
goto out;
|
||||
|
||||
if (impl->tree_model)
|
||||
g_object_unref (impl->tree_model);
|
||||
|
||||
impl->current_volume_path = gtk_file_path_copy (volume_path);
|
||||
impl->current_volume_path = gtk_file_path_copy (base_path);
|
||||
|
||||
impl->tree_model = _gtk_file_system_model_new (impl->file_system, impl->current_volume_path, -1,
|
||||
GTK_FILE_INFO_DISPLAY_NAME);
|
||||
@ -2150,8 +2166,9 @@ set_tree_model (GtkFileChooserDefault *impl, const GtkFilePath *path)
|
||||
|
||||
out:
|
||||
|
||||
gtk_file_path_free (volume_path);
|
||||
gtk_file_system_volume_free (impl->file_system, volume);
|
||||
gtk_file_path_free (base_path);
|
||||
if (volume)
|
||||
gtk_file_system_volume_free (impl->file_system, volume);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -144,12 +144,7 @@ gtk_file_chooser_widget_constructor (GType type,
|
||||
gtk_widget_show (priv->impl);
|
||||
|
||||
current_folder = g_get_current_dir ();
|
||||
current_folder_uri = g_filename_to_uri (current_folder, NULL, NULL);
|
||||
if (current_folder_uri)
|
||||
{
|
||||
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (priv->impl), current_folder_uri);
|
||||
g_free (current_folder_uri);
|
||||
}
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (priv->impl), current_folder);
|
||||
g_free (current_folder);
|
||||
|
||||
_gtk_file_chooser_set_delegate (GTK_FILE_CHOOSER (object),
|
||||
|
Loading…
Reference in New Issue
Block a user