Commit 02c65db5 authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Carlos Garnacho

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
parent aa435e02
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
......
This diff is collapsed.
......@@ -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
......
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