[gtk+/pathbar: 6/8] Rename _gtk_path_bar_set_file to gtk_path_bar_set_location
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/pathbar: 6/8] Rename _gtk_path_bar_set_file to gtk_path_bar_set_location
- Date: Mon, 29 Apr 2013 21:05:05 +0000 (UTC)
commit 28a1759230de1f8c6c73f7af47ee78a21bad756b
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Apr 29 14:22:31 2013 -0500
Rename _gtk_path_bar_set_file to gtk_path_bar_set_location
For consistency with GtkPlacesSidebar, and this is not a private function anymore.
Signed-off-by: Federico Mena Quintero <federico gnome org>
gtk/gtkfilechooserdefault.c | 4 ++--
gtk/gtkpathbar.c | 21 +++++++++++++++------
gtk/gtkpathbar.h | 7 ++++---
3 files changed, 21 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index f867f6e..03d1771 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -2522,7 +2522,7 @@ put_recent_folder_in_pathbar (GtkFileChooserDefault *impl, GtkTreeIter *iter)
gtk_tree_model_get (GTK_TREE_MODEL (priv->recent_model), iter,
MODEL_COL_FILE, &file,
-1);
- _gtk_path_bar_set_file (GTK_PATH_BAR (priv->browse_path_bar), file, FALSE);
+ gtk_path_bar_set_location (GTK_PATH_BAR (priv->browse_path_bar), file, FALSE);
g_object_unref (file);
}
@@ -4615,7 +4615,7 @@ update_current_folder_get_info_cb (GCancellable *cancellable,
if (! _gtk_file_info_consider_as_directory (info))
goto out;
- _gtk_path_bar_set_file (GTK_PATH_BAR (priv->browse_path_bar), data->file, data->keep_trail);
+ gtk_path_bar_set_location (GTK_PATH_BAR (priv->browse_path_bar), data->file, data->keep_trail);
if (priv->current_folder != data->file)
{
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 012dd1b..faeb4a9 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -1973,24 +1973,33 @@ gtk_path_bar_get_info_callback (GCancellable *cancellable,
file_info);
}
+/**
+ * gtk_path_bar_set_location:
+ * @path_bar: a #GtkPathBar
+ * @location: (allow-none): location to show, or #NULL for no current path
+ *
+ * Sets the location that the path bar should show.
+ *
+ * Since: 3.10
+ */
void
-_gtk_path_bar_set_file (GtkPathBar *path_bar,
- GFile *file,
- const gboolean keep_trail)
+gtk_path_bar_set_location (GtkPathBar *path_bar,
+ GFile *location,
+ gboolean keep_trail)
{
struct SetFileInfo *info;
g_return_if_fail (GTK_IS_PATH_BAR (path_bar));
- g_return_if_fail (G_IS_FILE (file));
+ g_return_if_fail (G_IS_FILE (location));
/* Check whether the new path is already present in the pathbar as buttons.
* This could be a parent directory or a previous selected subdirectory.
*/
- if (keep_trail && gtk_path_bar_check_parent_path (path_bar, file))
+ if (keep_trail && gtk_path_bar_check_parent_path (path_bar, location))
return;
info = g_new0 (struct SetFileInfo, 1);
- info->file = g_object_ref (file);
+ info->file = g_object_ref (location);
info->path_bar = path_bar;
info->first_directory = TRUE;
info->parent_file = g_file_get_parent (info->file);
diff --git a/gtk/gtkpathbar.h b/gtk/gtkpathbar.h
index 30bb3e0..6ca93a2 100644
--- a/gtk/gtkpathbar.h
+++ b/gtk/gtkpathbar.h
@@ -64,11 +64,12 @@ GtkWidget *gtk_path_bar_new (void);
GtkPlacesOpenFlags gtk_path_bar_get_open_flags (GtkPathBar *path_bar);
void gtk_path_bar_set_open_flags (GtkPathBar *path_bar, GtkPlacesOpenFlags flags);
+void gtk_path_bar_set_location (GtkPathBar *path_bar,
+ GFile *location,
+ gboolean keep_trail);
+
void _gtk_path_bar_set_file_system (GtkPathBar *path_bar,
GtkFileSystem *file_system);
-void _gtk_path_bar_set_file (GtkPathBar *path_bar,
- GFile *file,
- gboolean keep_trail);
void _gtk_path_bar_up (GtkPathBar *path_bar);
void _gtk_path_bar_down (GtkPathBar *path_bar);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]