forked from AuroraMiddleware/gtk
Make GFile-oriented API public. Fixes #545978.
2008-08-04 Carlos Garnacho <carlos@imendio.com> * gtk/gtk.symbols: * gtk/gtkfilechooser.[ch]: Make GFile-oriented API public. Fixes #545978. * gtk/gtkfilechooserbutton.c: * gtk/gtkfilechooserdefault.c: * gtk/gtkfilechooserutils.c: Update to use public GFile API. svn path=/trunk/; revision=20971
This commit is contained in:
parent
aa435e024a
commit
02c65db5c0
@ -1,3 +1,12 @@
|
||||
2008-08-04 Carlos Garnacho <carlos@imendio.com>
|
||||
|
||||
* gtk/gtk.symbols:
|
||||
* gtk/gtkfilechooser.[ch]: Make GFile-oriented API public. Fixes
|
||||
#545978.
|
||||
* gtk/gtkfilechooserbutton.c:
|
||||
* gtk/gtkfilechooserdefault.c:
|
||||
* gtk/gtkfilechooserutils.c: Update to use public GFile API.
|
||||
|
||||
2008-08-04 Michael Natterer <mitch@imendio.com>
|
||||
|
||||
* gtk/Makefile.am: build with GTK_DISABLE_DEPRECATED again.
|
||||
|
@ -1357,11 +1357,13 @@ gtk_file_chooser_add_shortcut_folder_uri
|
||||
gtk_file_chooser_error_quark
|
||||
gtk_file_chooser_get_action
|
||||
gtk_file_chooser_get_current_folder PRIVATE
|
||||
gtk_file_chooser_get_current_folder_file
|
||||
#ifdef G_OS_WIN32
|
||||
gtk_file_chooser_get_current_folder_utf8
|
||||
#endif
|
||||
gtk_file_chooser_get_current_folder_uri
|
||||
gtk_file_chooser_get_extra_widget
|
||||
gtk_file_chooser_get_file
|
||||
gtk_file_chooser_get_filename PRIVATE
|
||||
#ifdef G_OS_WIN32
|
||||
gtk_file_chooser_get_filename_utf8
|
||||
@ -1370,8 +1372,10 @@ gtk_file_chooser_get_filenames PRIVATE
|
||||
#ifdef G_OS_WIN32
|
||||
gtk_file_chooser_get_filenames_utf8
|
||||
#endif
|
||||
gtk_file_chooser_get_files
|
||||
gtk_file_chooser_get_filter
|
||||
gtk_file_chooser_get_local_only
|
||||
gtk_file_chooser_get_preview_file
|
||||
gtk_file_chooser_get_preview_filename PRIVATE
|
||||
#ifdef G_OS_WIN32
|
||||
gtk_file_chooser_get_preview_filename_utf8
|
||||
@ -1400,6 +1404,7 @@ gtk_file_chooser_remove_shortcut_folder_utf8
|
||||
#endif
|
||||
gtk_file_chooser_remove_shortcut_folder_uri
|
||||
gtk_file_chooser_select_all
|
||||
gtk_file_chooser_select_file
|
||||
gtk_file_chooser_select_filename PRIVATE
|
||||
#ifdef G_OS_WIN32
|
||||
gtk_file_chooser_select_filename_utf8
|
||||
@ -1407,12 +1412,14 @@ gtk_file_chooser_select_filename_utf8
|
||||
gtk_file_chooser_select_uri
|
||||
gtk_file_chooser_set_action
|
||||
gtk_file_chooser_set_current_folder PRIVATE
|
||||
gtk_file_chooser_set_current_folder_file
|
||||
#ifdef G_OS_WIN32
|
||||
gtk_file_chooser_set_current_folder_utf8
|
||||
#endif
|
||||
gtk_file_chooser_set_current_folder_uri
|
||||
gtk_file_chooser_set_current_name
|
||||
gtk_file_chooser_set_extra_widget
|
||||
gtk_file_chooser_set_file
|
||||
gtk_file_chooser_set_filename PRIVATE
|
||||
#ifdef G_OS_WIN32
|
||||
gtk_file_chooser_set_filename_utf8
|
||||
@ -1426,6 +1433,7 @@ gtk_file_chooser_set_show_hidden
|
||||
gtk_file_chooser_set_uri
|
||||
gtk_file_chooser_set_use_preview_label
|
||||
gtk_file_chooser_unselect_all
|
||||
gtk_file_chooser_unselect_file
|
||||
gtk_file_chooser_unselect_filename PRIVATE
|
||||
#ifdef G_OS_WIN32
|
||||
gtk_file_chooser_unselect_filename_utf8
|
||||
|
@ -29,8 +29,6 @@
|
||||
|
||||
static void gtk_file_chooser_class_init (gpointer g_iface);
|
||||
|
||||
static GFile *gtk_file_chooser_get_file (GtkFileChooser *chooser);
|
||||
|
||||
GType
|
||||
gtk_file_chooser_get_type (void)
|
||||
{
|
||||
@ -540,7 +538,7 @@ gtk_file_chooser_select_filename (GtkFileChooser *chooser,
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
|
||||
file = g_file_new_for_path (filename);
|
||||
result = _gtk_file_chooser_select_file (chooser, file, NULL);
|
||||
result = gtk_file_chooser_select_file (chooser, file, NULL);
|
||||
g_object_unref (file);
|
||||
|
||||
return result;
|
||||
@ -567,7 +565,7 @@ gtk_file_chooser_unselect_filename (GtkFileChooser *chooser,
|
||||
g_return_if_fail (filename != NULL);
|
||||
|
||||
file = g_file_new_for_path (filename);
|
||||
_gtk_file_chooser_unselect_file (chooser, file);
|
||||
gtk_file_chooser_unselect_file (chooser, file);
|
||||
g_object_unref (file);
|
||||
}
|
||||
|
||||
@ -617,7 +615,7 @@ gtk_file_chooser_get_filenames (GtkFileChooser *chooser)
|
||||
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
|
||||
|
||||
files = _gtk_file_chooser_get_files (chooser);
|
||||
files = gtk_file_chooser_get_files (chooser);
|
||||
|
||||
result = files_to_strings (files, g_file_get_path);
|
||||
g_slist_foreach (files, (GFunc) g_object_unref, NULL);
|
||||
@ -651,7 +649,7 @@ gtk_file_chooser_set_current_folder (GtkFileChooser *chooser,
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
|
||||
file = g_file_new_for_path (filename);
|
||||
result = _gtk_file_chooser_set_current_folder_file (chooser, file, NULL);
|
||||
result = gtk_file_chooser_set_current_folder_file (chooser, file, NULL);
|
||||
g_object_unref (file);
|
||||
|
||||
return result;
|
||||
@ -688,7 +686,7 @@ gtk_file_chooser_get_current_folder (GtkFileChooser *chooser)
|
||||
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
|
||||
|
||||
file = _gtk_file_chooser_get_current_folder_file (chooser);
|
||||
file = gtk_file_chooser_get_current_folder_file (chooser);
|
||||
if (!file)
|
||||
return NULL;
|
||||
|
||||
@ -837,7 +835,7 @@ gtk_file_chooser_select_uri (GtkFileChooser *chooser,
|
||||
g_return_val_if_fail (uri != NULL, FALSE);
|
||||
|
||||
file = g_file_new_for_uri (uri);
|
||||
result = _gtk_file_chooser_select_file (chooser, file, NULL);
|
||||
result = gtk_file_chooser_select_file (chooser, file, NULL);
|
||||
g_object_unref (file);
|
||||
|
||||
return result;
|
||||
@ -864,7 +862,7 @@ gtk_file_chooser_unselect_uri (GtkFileChooser *chooser,
|
||||
g_return_if_fail (uri != NULL);
|
||||
|
||||
file = g_file_new_for_uri (uri);
|
||||
_gtk_file_chooser_unselect_file (chooser, file);
|
||||
gtk_file_chooser_unselect_file (chooser, file);
|
||||
g_object_unref (file);
|
||||
}
|
||||
|
||||
@ -921,7 +919,7 @@ gtk_file_chooser_get_uris (GtkFileChooser *chooser)
|
||||
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
|
||||
|
||||
files = _gtk_file_chooser_get_files (chooser);
|
||||
files = gtk_file_chooser_get_files (chooser);
|
||||
|
||||
result = files_to_strings (files, g_file_get_uri);
|
||||
g_slist_foreach (files, (GFunc) g_object_unref, NULL);
|
||||
@ -955,7 +953,7 @@ gtk_file_chooser_set_current_folder_uri (GtkFileChooser *chooser,
|
||||
g_return_val_if_fail (uri != NULL, FALSE);
|
||||
|
||||
file = g_file_new_for_uri (uri);
|
||||
result = _gtk_file_chooser_set_current_folder_file (chooser, file, NULL);
|
||||
result = gtk_file_chooser_set_current_folder_file (chooser, file, NULL);
|
||||
g_object_unref (file);
|
||||
|
||||
return result;
|
||||
@ -991,7 +989,7 @@ gtk_file_chooser_get_current_folder_uri (GtkFileChooser *chooser)
|
||||
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
|
||||
|
||||
file = _gtk_file_chooser_get_current_folder_file (chooser);
|
||||
file = gtk_file_chooser_get_current_folder_file (chooser);
|
||||
if (!file)
|
||||
return NULL;
|
||||
|
||||
@ -1002,7 +1000,7 @@ gtk_file_chooser_get_current_folder_uri (GtkFileChooser *chooser)
|
||||
}
|
||||
|
||||
/**
|
||||
* _gtk_file_chooser_set_current_folder_file:
|
||||
* gtk_file_chooser_set_current_folder_file:
|
||||
* @chooser: a #GtkFileChooser
|
||||
* @file: the #GFile for the new folder
|
||||
* @error: location to store error, or %NULL.
|
||||
@ -1013,12 +1011,12 @@ gtk_file_chooser_get_current_folder_uri (GtkFileChooser *chooser)
|
||||
* Return value: %TRUE if the folder could be changed successfully, %FALSE
|
||||
* otherwise.
|
||||
*
|
||||
* Since: 2.4
|
||||
* Since: 2.14
|
||||
**/
|
||||
gboolean
|
||||
_gtk_file_chooser_set_current_folder_file (GtkFileChooser *chooser,
|
||||
GFile *file,
|
||||
GError **error)
|
||||
gtk_file_chooser_set_current_folder_file (GtkFileChooser *chooser,
|
||||
GFile *file,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), FALSE);
|
||||
g_return_val_if_fail (G_IS_FILE (file), FALSE);
|
||||
@ -1028,7 +1026,7 @@ _gtk_file_chooser_set_current_folder_file (GtkFileChooser *chooser,
|
||||
}
|
||||
|
||||
/**
|
||||
* _gtk_file_chooser_get_current_folder_file:
|
||||
* gtk_file_chooser_get_current_folder_file:
|
||||
* @chooser: a #GtkFileChooser
|
||||
*
|
||||
* Gets the current folder of @chooser as #GFile.
|
||||
@ -1036,10 +1034,10 @@ _gtk_file_chooser_set_current_folder_file (GtkFileChooser *chooser,
|
||||
*
|
||||
* Return value: the #GFile for the current folder.
|
||||
*
|
||||
* Since: 2.4
|
||||
* Since: 2.14
|
||||
*/
|
||||
GFile *
|
||||
_gtk_file_chooser_get_current_folder_file (GtkFileChooser *chooser)
|
||||
gtk_file_chooser_get_current_folder_file (GtkFileChooser *chooser)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
|
||||
|
||||
@ -1047,23 +1045,23 @@ _gtk_file_chooser_get_current_folder_file (GtkFileChooser *chooser)
|
||||
}
|
||||
|
||||
/**
|
||||
* _gtk_file_chooser_select_file:
|
||||
* gtk_file_chooser_select_file:
|
||||
* @chooser: a #GtkFileChooser
|
||||
* @file: the file to select
|
||||
* @error: location to store error, or %NULL
|
||||
*
|
||||
* Selects the file referred to by @path. An internal function. See
|
||||
* Selects the file referred to by @file. An internal function. See
|
||||
* _gtk_file_chooser_select_uri().
|
||||
*
|
||||
* Return value: %TRUE if both the folder could be changed and the path was
|
||||
* selected successfully, %FALSE otherwise.
|
||||
*
|
||||
* Since: 2.4
|
||||
* Since: 2.14
|
||||
**/
|
||||
gboolean
|
||||
_gtk_file_chooser_select_file (GtkFileChooser *chooser,
|
||||
GFile *file,
|
||||
GError **error)
|
||||
gtk_file_chooser_select_file (GtkFileChooser *chooser,
|
||||
GFile *file,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), FALSE);
|
||||
g_return_val_if_fail (G_IS_FILE (file), FALSE);
|
||||
@ -1073,18 +1071,18 @@ _gtk_file_chooser_select_file (GtkFileChooser *chooser,
|
||||
}
|
||||
|
||||
/**
|
||||
* _gtk_file_chooser_unselect_path:
|
||||
* gtk_file_chooser_unselect_file:
|
||||
* @chooser: a #GtkFileChooser
|
||||
* @path: the filename to path
|
||||
* @file: a #GFile
|
||||
*
|
||||
* Unselects the file referred to by @path. An internal
|
||||
* function. See _gtk_file_chooser_unselect_uri().
|
||||
* Unselects the file referred to by @file. If the file is not in the current
|
||||
* directory, does not exist, or is otherwise not currently selected, does nothing.
|
||||
*
|
||||
* Since: 2.4
|
||||
* Since: 2.14
|
||||
**/
|
||||
void
|
||||
_gtk_file_chooser_unselect_file (GtkFileChooser *chooser,
|
||||
GFile *file)
|
||||
gtk_file_chooser_unselect_file (GtkFileChooser *chooser,
|
||||
GFile *file)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_FILE_CHOOSER (chooser));
|
||||
g_return_if_fail (G_IS_FILE (file));
|
||||
@ -1093,7 +1091,7 @@ _gtk_file_chooser_unselect_file (GtkFileChooser *chooser,
|
||||
}
|
||||
|
||||
/**
|
||||
* _gtk_file_chooser_get_files:
|
||||
* gtk_file_chooser_get_files:
|
||||
* @chooser: a #GtkFileChooser
|
||||
*
|
||||
* Lists all the selected files and subfolders in the current folder of @chooser
|
||||
@ -1103,17 +1101,88 @@ _gtk_file_chooser_unselect_file (GtkFileChooser *chooser,
|
||||
* file and subfolder in the current folder. Free the returned list
|
||||
* with g_slist_free(), and the files with g_object_unref().
|
||||
*
|
||||
* Since: 2.4
|
||||
* Since: 2.14
|
||||
**/
|
||||
GSList *
|
||||
_gtk_file_chooser_get_files (GtkFileChooser *chooser)
|
||||
gtk_file_chooser_get_files (GtkFileChooser *chooser)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
|
||||
|
||||
return GTK_FILE_CHOOSER_GET_IFACE (chooser)->get_files (chooser);
|
||||
}
|
||||
|
||||
static GFile *
|
||||
/**
|
||||
* gtk_file_chooser_set_file:
|
||||
* @chooser: a #GtkFileChooser
|
||||
* @file: the #GFile to set as current
|
||||
* @error: location to store the error, or %NULL to ignore errors.
|
||||
*
|
||||
* Sets @file as the current filename for the file chooser, by changing
|
||||
* to the file's parent folder and actually selecting the file in list. If
|
||||
* the @chooser is in #GTK_FILE_CHOOSER_ACTION_SAVE mode, the file's base name
|
||||
* will also appear in the dialog's file name entry.
|
||||
*
|
||||
* If the file name isn't in the current folder of @chooser, then the current
|
||||
* folder of @chooser will be changed to the folder containing @filename. This
|
||||
* is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by
|
||||
* gtk_file_chooser_select_filename().
|
||||
*
|
||||
* Note that the file must exist, or nothing will be done except
|
||||
* for the directory change.
|
||||
*
|
||||
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
|
||||
* you should use this function if you already have a file name to which the
|
||||
* user may save; for example, when the user opens an existing file and then
|
||||
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
|
||||
* a file name already — for example, if the user just created a new
|
||||
* file and is saving it for the first time, do not call this function.
|
||||
* Instead, use something similar to this:
|
||||
* |[
|
||||
* if (document_is_new)
|
||||
* {
|
||||
* /* the user just created a new document */
|
||||
* gtk_file_chooser_set_current_folder_file (chooser, default_file_for_saving);
|
||||
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
|
||||
* }
|
||||
* else
|
||||
* {
|
||||
* /* the user edited an existing document */
|
||||
* gtk_file_chooser_set_file (chooser, existing_file);
|
||||
* }
|
||||
* ]|
|
||||
*
|
||||
* Return value: %TRUE if both the folder could be changed and the file was
|
||||
* selected successfully, %FALSE otherwise.
|
||||
*
|
||||
* Since: 2.14
|
||||
**/
|
||||
gboolean
|
||||
gtk_file_chooser_set_file (GtkFileChooser *chooser,
|
||||
GFile *file,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), FALSE);
|
||||
g_return_val_if_fail (G_IS_FILE (file), FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
gtk_file_chooser_unselect_all (chooser);
|
||||
return gtk_file_chooser_select_file (chooser, file, error);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_file_chooser_get_file:
|
||||
* @chooser: a #GtkFileChooser
|
||||
*
|
||||
* Gets the #GFile for the currently selected file in
|
||||
* the file selector. If multiple files are selected,
|
||||
* one of the files will be returned at random.
|
||||
*
|
||||
* If the file chooser is in folder mode, this function returns the selected
|
||||
* folder.
|
||||
*
|
||||
* Returns: a selected #GFile
|
||||
**/
|
||||
GFile *
|
||||
gtk_file_chooser_get_file (GtkFileChooser *chooser)
|
||||
{
|
||||
GSList *list;
|
||||
@ -1121,7 +1190,7 @@ gtk_file_chooser_get_file (GtkFileChooser *chooser)
|
||||
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
|
||||
|
||||
list = _gtk_file_chooser_get_files (chooser);
|
||||
list = gtk_file_chooser_get_files (chooser);
|
||||
if (list)
|
||||
{
|
||||
result = list->data;
|
||||
@ -1312,16 +1381,16 @@ gtk_file_chooser_get_use_preview_label (GtkFileChooser *chooser)
|
||||
* gtk_file_chooser_get_preview_file:
|
||||
* @chooser: a #GtkFileChooser
|
||||
*
|
||||
* Gets the filename that should be previewed in a custom preview
|
||||
* Gets the #GFile that should be previewed in a custom preview
|
||||
* Internal function, see gtk_file_chooser_get_preview_uri().
|
||||
*
|
||||
* Return value: the #GFile for the file to preview, or %NULL if no file
|
||||
* is selected. Free with gtk_file_path_free().
|
||||
* is selected. Free with g_object_unref().
|
||||
*
|
||||
* Since: 2.4
|
||||
* Since: 2.14
|
||||
**/
|
||||
GFile *
|
||||
_gtk_file_chooser_get_preview_file (GtkFileChooser *chooser)
|
||||
gtk_file_chooser_get_preview_file (GtkFileChooser *chooser)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
|
||||
|
||||
@ -1399,7 +1468,7 @@ gtk_file_chooser_get_preview_filename (GtkFileChooser *chooser)
|
||||
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
|
||||
|
||||
file =_gtk_file_chooser_get_preview_file (chooser);
|
||||
file = gtk_file_chooser_get_preview_file (chooser);
|
||||
if (file)
|
||||
{
|
||||
result = g_file_get_path (file);
|
||||
@ -1429,7 +1498,7 @@ gtk_file_chooser_get_preview_uri (GtkFileChooser *chooser)
|
||||
|
||||
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
|
||||
|
||||
file = _gtk_file_chooser_get_preview_file (chooser);
|
||||
file = gtk_file_chooser_get_preview_file (chooser);
|
||||
if (file)
|
||||
{
|
||||
result = g_file_get_uri (file);
|
||||
|
@ -135,6 +135,22 @@ gboolean gtk_file_chooser_set_current_folder_uri (GtkFileChooser *chooser,
|
||||
const gchar *uri);
|
||||
gchar * gtk_file_chooser_get_current_folder_uri (GtkFileChooser *chooser);
|
||||
|
||||
/* GFile manipulation */
|
||||
GFile * gtk_file_chooser_get_file (GtkFileChooser *chooser);
|
||||
gboolean gtk_file_chooser_set_file (GtkFileChooser *chooser,
|
||||
GFile *file,
|
||||
GError **error);
|
||||
gboolean gtk_file_chooser_select_file (GtkFileChooser *chooser,
|
||||
GFile *file,
|
||||
GError **error);
|
||||
void gtk_file_chooser_unselect_file (GtkFileChooser *chooser,
|
||||
GFile *file);
|
||||
GSList * gtk_file_chooser_get_files (GtkFileChooser *chooser);
|
||||
gboolean gtk_file_chooser_set_current_folder_file (GtkFileChooser *chooser,
|
||||
GFile *file,
|
||||
GError **error);
|
||||
GFile * gtk_file_chooser_get_current_folder_file (GtkFileChooser *chooser);
|
||||
|
||||
/* Preview widget
|
||||
*/
|
||||
void gtk_file_chooser_set_preview_widget (GtkFileChooser *chooser,
|
||||
@ -147,8 +163,9 @@ void gtk_file_chooser_set_use_preview_label (GtkFileChooser *chooser,
|
||||
gboolean use_label);
|
||||
gboolean gtk_file_chooser_get_use_preview_label (GtkFileChooser *chooser);
|
||||
|
||||
char *gtk_file_chooser_get_preview_filename (GtkFileChooser *chooser);
|
||||
char *gtk_file_chooser_get_preview_uri (GtkFileChooser *chooser);
|
||||
char *gtk_file_chooser_get_preview_filename (GtkFileChooser *chooser);
|
||||
char *gtk_file_chooser_get_preview_uri (GtkFileChooser *chooser);
|
||||
GFile *gtk_file_chooser_get_preview_file (GtkFileChooser *chooser);
|
||||
|
||||
/* Extra widget
|
||||
*/
|
||||
|
@ -1020,8 +1020,8 @@ dnd_select_folder_get_info_cb (GCancellable *cancellable,
|
||||
data->selected =
|
||||
(((data->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER && is_folder) ||
|
||||
(data->action == GTK_FILE_CHOOSER_ACTION_OPEN && !is_folder)) &&
|
||||
_gtk_file_chooser_select_file (GTK_FILE_CHOOSER (data->button->priv->dialog),
|
||||
data->file, NULL));
|
||||
gtk_file_chooser_select_file (GTK_FILE_CHOOSER (data->button->priv->dialog),
|
||||
data->file, NULL));
|
||||
}
|
||||
else
|
||||
data->selected = FALSE;
|
||||
@ -1109,8 +1109,8 @@ gtk_file_chooser_button_drag_data_received (GtkWidget *widget,
|
||||
case TEXT_PLAIN:
|
||||
text = (char*) gtk_selection_data_get_text (data);
|
||||
file = g_file_new_for_uri (text);
|
||||
_gtk_file_chooser_select_file (GTK_FILE_CHOOSER (priv->dialog), file,
|
||||
NULL);
|
||||
gtk_file_chooser_select_file (GTK_FILE_CHOOSER (priv->dialog), file,
|
||||
NULL);
|
||||
g_object_unref (file);
|
||||
g_free (text);
|
||||
break;
|
||||
@ -2185,7 +2185,7 @@ update_combo_box (GtkFileChooserButton *button)
|
||||
|
||||
gtk_tree_model_get_iter_first (priv->filter_model, &iter);
|
||||
|
||||
files = _gtk_file_chooser_get_files (GTK_FILE_CHOOSER (priv->dialog));
|
||||
files = gtk_file_chooser_get_files (GTK_FILE_CHOOSER (priv->dialog));
|
||||
|
||||
row_found = FALSE;
|
||||
|
||||
@ -2312,7 +2312,7 @@ update_label_and_image (GtkFileChooserButton *button)
|
||||
gchar *label_text;
|
||||
GSList *files;
|
||||
|
||||
files = _gtk_file_chooser_get_files (GTK_FILE_CHOOSER (priv->dialog));
|
||||
files = gtk_file_chooser_get_files (GTK_FILE_CHOOSER (priv->dialog));
|
||||
label_text = NULL;
|
||||
pixbuf = NULL;
|
||||
|
||||
@ -2483,7 +2483,7 @@ open_dialog (GtkFileChooserButton *button)
|
||||
priv->dialog_file_activated_id);
|
||||
g_signal_handler_block (priv->dialog,
|
||||
priv->dialog_selection_changed_id);
|
||||
files = _gtk_file_chooser_get_files (GTK_FILE_CHOOSER (priv->dialog));
|
||||
files = gtk_file_chooser_get_files (GTK_FILE_CHOOSER (priv->dialog));
|
||||
if (files)
|
||||
{
|
||||
if (files->data)
|
||||
@ -2530,8 +2530,8 @@ combo_box_changed_cb (GtkComboBox *combo_box,
|
||||
case ROW_TYPE_CURRENT_FOLDER:
|
||||
gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER (priv->dialog));
|
||||
if (data)
|
||||
_gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (priv->dialog),
|
||||
data, NULL);
|
||||
gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (priv->dialog),
|
||||
data, NULL);
|
||||
break;
|
||||
case ROW_TYPE_VOLUME:
|
||||
{
|
||||
@ -2541,8 +2541,8 @@ combo_box_changed_cb (GtkComboBox *combo_box,
|
||||
base_file = _gtk_file_system_volume_get_root (data);
|
||||
if (base_file)
|
||||
{
|
||||
_gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (priv->dialog),
|
||||
base_file, NULL);
|
||||
gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (priv->dialog),
|
||||
base_file, NULL);
|
||||
g_object_unref (base_file);
|
||||
}
|
||||
}
|
||||
@ -2674,12 +2674,12 @@ dialog_response_cb (GtkDialog *dialog,
|
||||
switch (gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)))
|
||||
{
|
||||
case GTK_FILE_CHOOSER_ACTION_OPEN:
|
||||
_gtk_file_chooser_select_file (GTK_FILE_CHOOSER (dialog), priv->old_file,
|
||||
NULL);
|
||||
gtk_file_chooser_select_file (GTK_FILE_CHOOSER (dialog), priv->old_file,
|
||||
NULL);
|
||||
break;
|
||||
case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER:
|
||||
_gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (dialog),
|
||||
priv->old_file, NULL);
|
||||
gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (dialog),
|
||||
priv->old_file, NULL);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
|
@ -1137,7 +1137,7 @@ change_folder_and_display_error (GtkFileChooserDefault *impl,
|
||||
* list_row_activated()
|
||||
* fetches path from model; path belongs to the model (*)
|
||||
* calls change_folder_and_display_error()
|
||||
* calls _gtk_file_chooser_set_current_folder_file()
|
||||
* calls gtk_file_chooser_set_current_folder_file()
|
||||
* changing folders fails, sets model to NULL, thus freeing the path in (*)
|
||||
*/
|
||||
|
||||
@ -5296,7 +5296,7 @@ set_local_only (GtkFileChooserDefault *impl,
|
||||
|
||||
home_file = g_file_new_for_path (home);
|
||||
|
||||
_gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (impl), home_file, NULL);
|
||||
gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (impl), home_file, NULL);
|
||||
|
||||
g_object_unref (home_file);
|
||||
}
|
||||
@ -7071,7 +7071,7 @@ gtk_file_chooser_default_select_file (GtkFileChooser *chooser,
|
||||
parent_file = g_file_get_parent (file);
|
||||
|
||||
if (!parent_file)
|
||||
return _gtk_file_chooser_set_current_folder_file (chooser, file, error);
|
||||
return gtk_file_chooser_set_current_folder_file (chooser, file, error);
|
||||
|
||||
if (impl->operation_mode == OPERATION_MODE_SEARCH ||
|
||||
impl->operation_mode == OPERATION_MODE_RECENT ||
|
||||
@ -7105,7 +7105,7 @@ gtk_file_chooser_default_select_file (GtkFileChooser *chooser,
|
||||
{
|
||||
gboolean result;
|
||||
|
||||
result = _gtk_file_chooser_set_current_folder_file (chooser, parent_file, error);
|
||||
result = gtk_file_chooser_set_current_folder_file (chooser, parent_file, error);
|
||||
g_object_unref (parent_file);
|
||||
return result;
|
||||
}
|
||||
@ -7412,7 +7412,7 @@ gtk_file_chooser_default_get_files (GtkFileChooser *chooser)
|
||||
{
|
||||
GFile *current_folder;
|
||||
|
||||
current_folder = _gtk_file_chooser_get_current_folder_file (chooser);
|
||||
current_folder = gtk_file_chooser_get_current_folder_file (chooser);
|
||||
|
||||
if (current_folder)
|
||||
info.result = g_slist_prepend (info.result, current_folder);
|
||||
@ -7421,7 +7421,7 @@ gtk_file_chooser_default_get_files (GtkFileChooser *chooser)
|
||||
return g_slist_reverse (info.result);
|
||||
}
|
||||
|
||||
static GFile *
|
||||
GFile *
|
||||
gtk_file_chooser_default_get_preview_file (GtkFileChooser *chooser)
|
||||
{
|
||||
GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser);
|
||||
|
@ -207,14 +207,14 @@ delegate_select_file (GtkFileChooser *chooser,
|
||||
GFile *file,
|
||||
GError **error)
|
||||
{
|
||||
return _gtk_file_chooser_select_file (get_delegate (chooser), file, error);
|
||||
return gtk_file_chooser_select_file (get_delegate (chooser), file, error);
|
||||
}
|
||||
|
||||
static void
|
||||
delegate_unselect_file (GtkFileChooser *chooser,
|
||||
GFile *file)
|
||||
{
|
||||
_gtk_file_chooser_unselect_file (get_delegate (chooser), file);
|
||||
gtk_file_chooser_unselect_file (get_delegate (chooser), file);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -232,13 +232,13 @@ delegate_unselect_all (GtkFileChooser *chooser)
|
||||
static GSList *
|
||||
delegate_get_files (GtkFileChooser *chooser)
|
||||
{
|
||||
return _gtk_file_chooser_get_files (get_delegate (chooser));
|
||||
return gtk_file_chooser_get_files (get_delegate (chooser));
|
||||
}
|
||||
|
||||
static GFile *
|
||||
delegate_get_preview_file (GtkFileChooser *chooser)
|
||||
{
|
||||
return _gtk_file_chooser_get_preview_file (get_delegate (chooser));
|
||||
return gtk_file_chooser_get_preview_file (get_delegate (chooser));
|
||||
}
|
||||
|
||||
static GtkFileSystem *
|
||||
@ -294,13 +294,13 @@ delegate_set_current_folder (GtkFileChooser *chooser,
|
||||
GFile *file,
|
||||
GError **error)
|
||||
{
|
||||
return _gtk_file_chooser_set_current_folder_file (get_delegate (chooser), file, error);
|
||||
return gtk_file_chooser_set_current_folder_file (get_delegate (chooser), file, error);
|
||||
}
|
||||
|
||||
static GFile *
|
||||
delegate_get_current_folder (GtkFileChooser *chooser)
|
||||
{
|
||||
return _gtk_file_chooser_get_current_folder_file (get_delegate (chooser));
|
||||
return gtk_file_chooser_get_current_folder_file (get_delegate (chooser));
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user