summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@novell.com>2010-06-16 16:34:19 -0500
committerFederico Mena Quintero <federico@novell.com>2010-08-25 12:14:24 -0500
commitd2f5fbbf4e12f7fcb1f2fa1b401ddc9cb9faafd8 (patch)
treeb96ff20cd635ef5ad41f6b85105869aab68a8ca3
parent39986f06ab627abd56c64255a297dbbaaa76fa71 (diff)
downloadgtk+-d2f5fbbf4e12f7fcb1f2fa1b401ddc9cb9faafd8.tar.gz
s/in_root/in_roots everywhere, as we support multiple roots
Signed-off-by: Federico Mena Quintero <federico@novell.com>
-rw-r--r--gtk/gtkfilechooser.c15
-rw-r--r--gtk/gtkfilechooserbutton.c13
-rw-r--r--gtk/gtkfilechooserdefault.c27
-rw-r--r--gtk/gtkfilechooserentry.c9
-rw-r--r--gtk/gtkfilechooserprivate.h8
-rw-r--r--gtk/gtkpathbar.c6
6 files changed, 36 insertions, 42 deletions
diff --git a/gtk/gtkfilechooser.c b/gtk/gtkfilechooser.c
index 66178e65f4..80383cbddf 100644
--- a/gtk/gtkfilechooser.c
+++ b/gtk/gtkfilechooser.c
@@ -1832,7 +1832,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);
}
@@ -2906,8 +2906,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;
@@ -2920,8 +2920,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;
@@ -2930,7 +2930,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;
@@ -2990,8 +2990,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 739446b290..c0fde9eaab 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 5ea2fb3cac..9dab4265f0 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -1882,7 +1882,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);
@@ -1931,7 +1931,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);
@@ -2020,7 +2020,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)
@@ -2156,8 +2156,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)
@@ -2339,7 +2339,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);
@@ -5536,8 +5536,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,
@@ -7425,8 +7424,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;
@@ -7576,7 +7574,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,
@@ -8150,8 +8148,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);
@@ -9133,7 +9130,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;
@@ -9680,7 +9677,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 877b0b53d2..7df5e90a38 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 7341649d60..7ab7583805 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 24ef20acf3..9d2a77cd26 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;