[gtk+/multiroot-filechooser: 15/15] s/in_root/in_roots everywhere, as we support multiple roots
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/multiroot-filechooser: 15/15] s/in_root/in_roots everywhere, as we support multiple roots
- Date: Thu, 17 Jun 2010 17:31:28 +0000 (UTC)
commit 6f37191690da3fbaa220e2c1735d9fcceceaf448
Author: Federico Mena Quintero <federico novell com>
Date: Wed Jun 16 16:34:19 2010 -0500
s/in_root/in_roots everywhere, as we support multiple roots
Signed-off-by: Federico Mena Quintero <federico novell com>
gtk/gtkfilechooser.c | 15 +++++++--------
gtk/gtkfilechooserbutton.c | 13 ++++++-------
gtk/gtkfilechooserdefault.c | 27 ++++++++++++---------------
gtk/gtkfilechooserentry.c | 9 ++++-----
gtk/gtkfilechooserprivate.h | 8 ++++----
gtk/gtkpathbar.c | 6 +++---
6 files changed, 36 insertions(+), 42 deletions(-)
---
diff --git a/gtk/gtkfilechooser.c b/gtk/gtkfilechooser.c
index 5ba01b4..841ceb6 100644
--- a/gtk/gtkfilechooser.c
+++ b/gtk/gtkfilechooser.c
@@ -1831,7 +1831,7 @@ gtk_file_chooser_get_files (GtkFileChooser *chooser)
{
GFile *file = (GFile *)l->data;
- g_return_val_if_fail (_gtk_file_chooser_is_file_in_root (chooser, file),
+ g_return_val_if_fail (_gtk_file_chooser_is_file_in_roots (chooser, file),
NULL);
}
@@ -2905,8 +2905,8 @@ _gtk_file_chooser_uri_has_prefix (const char *uri, GSList *prefixes)
}
gboolean
-_gtk_file_chooser_is_uri_in_root (GtkFileChooser *chooser,
- const char *uri)
+_gtk_file_chooser_is_uri_in_roots (GtkFileChooser *chooser,
+ const char *uri)
{
GSList *root_uris;
@@ -2919,8 +2919,8 @@ _gtk_file_chooser_is_uri_in_root (GtkFileChooser *chooser,
}
gboolean
-_gtk_file_chooser_is_file_in_root (GtkFileChooser *chooser,
- GFile *file)
+_gtk_file_chooser_is_file_in_roots (GtkFileChooser *chooser,
+ GFile *file)
{
char *uri;
gboolean result;
@@ -2929,7 +2929,7 @@ _gtk_file_chooser_is_file_in_root (GtkFileChooser *chooser,
g_return_val_if_fail (file != NULL, FALSE);
uri = g_file_get_uri (file);
- result = _gtk_file_chooser_is_uri_in_root (chooser, uri);
+ result = _gtk_file_chooser_is_uri_in_roots (chooser, uri);
g_free (uri);
return result;
@@ -2989,8 +2989,7 @@ _gtk_file_chooser_get_visible_roots (GtkFileChooser *chooser)
if (fs_root != NULL)
{
- if (_gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (chooser),
- fs_root))
+ if (_gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (chooser), fs_root))
{
// This is going to be listed already. Ignore it for now.
skip = TRUE;
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c
index 74b7a02..b74ecb8 100644
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@ -617,7 +617,7 @@ reload_shortcuts (GtkFileChooserButton *button)
{
GFile *shortcut = (GFile *)l->data;
- if (_gtk_file_chooser_is_file_in_root (filechooser, shortcut))
+ if (_gtk_file_chooser_is_file_in_roots (filechooser, shortcut))
{
add_shortcut_to_list (button, shortcut);
}
@@ -649,8 +649,8 @@ gtk_file_chooser_button_add_shortcut_folder (GtkFileChooser *chooser,
g_object_ref (G_OBJECT (file));
priv->shortcuts = g_slist_append (priv->shortcuts, file);
- if (_gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (priv->dialog),
- file))
+ if (_gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (priv->dialog),
+ file))
{
add_shortcut_to_list (button, file);
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (priv->filter_model));
@@ -922,8 +922,7 @@ gtk_file_chooser_button_set_property (GObject *object,
case GTK_FILE_CHOOSER_PROP_ROOT_URIS:
g_object_set_property (G_OBJECT (priv->dialog), pspec->name, value);
- if (!_gtk_file_chooser_is_file_in_root (filechooser,
- gtk_file_chooser_get_current_folder_file (filechooser)))
+ if (!_gtk_file_chooser_is_file_in_roots (filechooser, gtk_file_chooser_get_current_folder_file (filechooser)))
{
GSList *root_uris = gtk_file_chooser_get_root_uris (filechooser);
@@ -1921,7 +1920,7 @@ model_add_volumes (GtkFileChooserButton *button,
skip = TRUE;
else if (root_uris != NULL &&
(base_file == NULL ||
- !_gtk_file_chooser_is_file_in_root (filechooser, base_file)))
+ !_gtk_file_chooser_is_file_in_roots (filechooser, base_file)))
skip = TRUE;
if (base_file != NULL)
@@ -1984,7 +1983,7 @@ model_add_bookmarks (GtkFileChooserButton *button,
file = l->data;
- if (!_gtk_file_chooser_is_file_in_root (filechooser, file))
+ if (!_gtk_file_chooser_is_file_in_roots (filechooser, file))
continue;
if (g_file_is_native (file))
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 335a666..902baf4 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -1893,7 +1893,7 @@ shortcuts_append_home (GtkFileChooserDefault *impl)
home = g_file_new_for_path (home_path);
- if (_gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (impl), home))
+ if (_gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (impl), home))
{
shortcuts_insert_file (impl, start_row, SHORTCUT_TYPE_FILE, NULL, home,
NULL, FALSE, SHORTCUTS_HOME);
@@ -1942,7 +1942,7 @@ shortcuts_append_desktop (GtkFileChooserDefault *impl)
file = g_file_new_for_path (name);
- if (_gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (impl), file))
+ if (_gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (impl), file))
{
shortcuts_insert_file (impl, start_row, SHORTCUT_TYPE_FILE, NULL,
file, _("Desktop"), FALSE, SHORTCUTS_DESKTOP);
@@ -2031,7 +2031,7 @@ shortcuts_append_bookmarks (GtkFileChooserDefault *impl,
if (local_only && !g_file_is_native (file))
continue;
- if (!_gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (impl), file))
+ if (!_gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (impl), file))
continue;
if (shortcut_find_position (impl, file) != -1)
@@ -2167,8 +2167,8 @@ shortcuts_add_volumes (GtkFileChooserDefault *impl)
skip = TRUE;
else if (impl->root_uris != NULL &&
(base_file == NULL ||
- !_gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (impl),
- base_file)))
+ !_gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (impl),
+ base_file)))
skip = TRUE;
if (base_file != NULL)
@@ -2343,7 +2343,7 @@ shortcuts_add_custom_folders (GtkFileChooserDefault *impl)
GFile *file = (GFile *)l->data;
if (impl->root_uris != NULL &&
- _gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (impl), file))
+ _gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (impl), file))
{
int pos = shortcuts_get_pos_for_shortcut_folder (impl,
impl->num_shortcuts);
@@ -5543,8 +5543,7 @@ set_root_uris (GtkFileChooserDefault *impl,
}
}
else if (impl->root_uris != NULL &&
- !_gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (impl),
- impl->current_folder))
+ !_gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (impl), impl->current_folder))
{
/*
* If we are pointing to a folder outside of the root URI,
@@ -7431,8 +7430,7 @@ update_current_folder_get_info_cb (GCancellable *cancellable,
/* get parent path and try to change the folder to that */
if (parent_file &&
- _gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (impl),
- parent_file))
+ _gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (impl), parent_file))
{
g_object_unref (data->file);
data->file = parent_file;
@@ -7582,7 +7580,7 @@ gtk_file_chooser_default_update_current_folder (GtkFileChooser *chooser,
return FALSE;
}
- if (!_gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (impl), file))
+ if (!_gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (impl), file))
{
g_set_error_literal (error,
GTK_FILE_CHOOSER_ERROR,
@@ -8156,8 +8154,7 @@ add_shortcut_get_info_cb (GCancellable *cancellable,
g_object_ref (data->file);
data->impl->shortcuts = g_slist_append (data->impl->shortcuts, data->file);
- if (_gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (data->impl),
- data->file))
+ if (_gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (data->impl), data->file))
{
shortcuts_insert_file (data->impl, pos, SHORTCUT_TYPE_FILE, NULL,
data->file, NULL, FALSE, SHORTCUTS_SHORTCUTS);
@@ -9131,7 +9128,7 @@ search_add_hit (GtkFileChooserDefault *impl,
return;
if (!g_file_is_native (file) ||
- !_gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (impl), file))
+ !_gtk_file_chooser_is_file_in_roots (GTK_FILE_CHOOSER (impl), file))
{
g_object_unref (file);
return;
@@ -9678,7 +9675,7 @@ recent_idle_load (gpointer data)
GtkRecentInfo *info = walk->data;
const char *uri = gtk_recent_info_get_uri (info);
- if (_gtk_file_chooser_is_uri_in_root (GTK_FILE_CHOOSER (impl), uri))
+ if (_gtk_file_chooser_is_uri_in_roots (GTK_FILE_CHOOSER (impl), uri))
{
// We'll sort this later, so prepend for efficiency.
load_data->items = g_list_prepend(load_data->items, info);
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 5b35bd5..553c6bb 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -450,8 +450,8 @@ beep (GtkFileChooserEntry *chooser_entry)
}
static gboolean
-is_file_in_root (GtkFileChooserEntry *chooser_entry,
- GFile *file)
+is_file_in_roots (GtkFileChooserEntry *chooser_entry,
+ GFile *file)
{
char *uri = g_file_get_uri (file);
gboolean result = _gtk_file_chooser_uri_has_prefix (uri, chooser_entry->root_uris);
@@ -1338,7 +1338,7 @@ populate_completion_store (GtkFileChooserEntry *chooser_entry)
file = tmp_list->data;
- if (!is_file_in_root (chooser_entry, file))
+ if (!is_file_in_roots (chooser_entry, file))
continue;
info = _gtk_folder_get_info (chooser_entry->current_folder, file);
@@ -1484,8 +1484,7 @@ start_loading_current_folder (GtkFileChooserEntry *chooser_entry)
if ((chooser_entry->local_only
&& !g_file_is_native (chooser_entry->current_folder_file)) ||
(chooser_entry->root_uris != NULL
- && !is_file_in_root (chooser_entry,
- chooser_entry->current_folder_file)))
+ && !is_file_in_roots (chooser_entry, chooser_entry->current_folder_file)))
{
g_object_unref (chooser_entry->current_folder_file);
chooser_entry->current_folder_file = NULL;
diff --git a/gtk/gtkfilechooserprivate.h b/gtk/gtkfilechooserprivate.h
index 7341649..7ab7583 100644
--- a/gtk/gtkfilechooserprivate.h
+++ b/gtk/gtkfilechooserprivate.h
@@ -106,10 +106,10 @@ GSList * _gtk_file_chooser_list_shortcut_folder_files (GtkFileChooser *cho
GSList * _gtk_file_chooser_list_shortcut_folder_files (GtkFileChooser *chooser);
-gboolean _gtk_file_chooser_is_uri_in_root (GtkFileChooser *chooser,
- const char *uri);
-gboolean _gtk_file_chooser_is_file_in_root (GtkFileChooser *chooser,
- GFile *file);
+gboolean _gtk_file_chooser_is_uri_in_roots (GtkFileChooser *chooser,
+ const char *uri);
+gboolean _gtk_file_chooser_is_file_in_roots (GtkFileChooser *chooser,
+ GFile *file);
GSList * _gtk_file_chooser_get_visible_roots (GtkFileChooser *chooser);
gboolean _gtk_file_chooser_uri_has_prefix (const char *uri,
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index c2f1150..6539d22 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -1662,8 +1662,8 @@ struct SetFileInfo
};
static gboolean
-is_file_in_root (GtkPathBar *path_bar,
- GFile *file)
+is_file_in_roots (GtkPathBar *path_bar,
+ GFile *file)
{
char *uri = g_file_get_uri (file);
gboolean result = _gtk_file_chooser_uri_has_prefix (uri, path_bar->root_uris);
@@ -1743,7 +1743,7 @@ gtk_path_bar_get_info_callback (GCancellable *cancellable,
display_name = g_file_info_get_display_name (info);
is_hidden = g_file_info_get_is_hidden (info) || g_file_info_get_is_backup (info);
- if (!is_file_in_root (file_info->path_bar, file_info->file))
+ if (!is_file_in_roots (file_info->path_bar, file_info->file))
{
gtk_path_bar_set_file_finish (file_info, TRUE);
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]