summaryrefslogtreecommitdiff
path: root/plugins/filebrowser/pluma-file-browser-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/filebrowser/pluma-file-browser-store.c')
-rw-r--r--plugins/filebrowser/pluma-file-browser-store.c262
1 files changed, 131 insertions, 131 deletions
diff --git a/plugins/filebrowser/pluma-file-browser-store.c b/plugins/filebrowser/pluma-file-browser-store.c
index 6192c035..6a3feafc 100644
--- a/plugins/filebrowser/pluma-file-browser-store.c
+++ b/plugins/filebrowser/pluma-file-browser-store.c
@@ -1,5 +1,5 @@
/*
- * pluma-file-browser-store.c - Pluma plugin providing easy file access
+ * pluma-file-browser-store.c - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <[email protected]>
@@ -86,7 +86,7 @@ typedef struct {
GCancellable * cancellable;
} MountInfo;
-struct _FileBrowserNode
+struct _FileBrowserNode
{
GFile *file;
guint flags;
@@ -100,7 +100,7 @@ struct _FileBrowserNode
gboolean inserted;
};
-struct _FileBrowserNodeDir
+struct _FileBrowserNodeDir
{
FileBrowserNode node;
GSList *children;
@@ -110,7 +110,7 @@ struct _FileBrowserNodeDir
PlumaFileBrowserStore *model;
};
-struct _PlumaFileBrowserStorePrivate
+struct _PlumaFileBrowserStorePrivate
{
FileBrowserNode *root;
FileBrowserNode *virtual_root;
@@ -130,7 +130,7 @@ static FileBrowserNode *model_find_node (PlumaFileBrowserStore *model,
FileBrowserNode *node,
GFile *uri);
static void model_remove_node (PlumaFileBrowserStore * model,
- FileBrowserNode * node,
+ FileBrowserNode * node,
GtkTreePath * path,
gboolean free_nodes);
@@ -162,7 +162,7 @@ static gint pluma_file_browser_store_iter_n_children (GtkTreeModel * tree
GtkTreeIter * iter);
static gboolean pluma_file_browser_store_iter_nth_child (GtkTreeModel * tree_model,
GtkTreeIter * iter,
- GtkTreeIter * parent,
+ GtkTreeIter * parent,
gint n);
static gboolean pluma_file_browser_store_iter_parent (GtkTreeModel * tree_model,
GtkTreeIter * iter,
@@ -214,7 +214,7 @@ enum {
};
/* Signals */
-enum
+enum
{
BEGIN_LOADING,
END_LOADING,
@@ -254,10 +254,10 @@ pluma_file_browser_store_finalize (GObject * object)
{
AsyncData *data = (AsyncData *) (item->data);
g_cancellable_cancel (data->cancellable);
-
+
data->removed = TRUE;
}
-
+
cancel_mount_operation (obj);
g_slist_free (obj->priv->async_handles);
@@ -293,7 +293,7 @@ pluma_file_browser_store_get_property (GObject *object,
break;
case PROP_VIRTUAL_ROOT:
set_gvalue_from_node (value, obj->priv->virtual_root);
- break;
+ break;
case PROP_FILTER_MODE:
g_value_set_flags (value, obj->priv->filter_mode);
break;
@@ -391,7 +391,7 @@ pluma_file_browser_store_class_init (PlumaFileBrowserStoreClass * klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (PlumaFileBrowserStoreClass,
rename), NULL, NULL,
- pluma_file_browser_marshal_VOID__STRING_STRING,
+ pluma_file_browser_marshal_VOID__STRING_STRING,
G_TYPE_NONE, 2,
G_TYPE_STRING,
G_TYPE_STRING);
@@ -663,13 +663,13 @@ pluma_file_browser_store_get_path (GtkTreeModel * tree_model,
g_return_val_if_fail (iter != NULL, NULL);
g_return_val_if_fail (iter->user_data != NULL, NULL);
- return pluma_file_browser_store_get_path_real (PLUMA_FILE_BROWSER_STORE (tree_model),
+ return pluma_file_browser_store_get_path_real (PLUMA_FILE_BROWSER_STORE (tree_model),
(FileBrowserNode *) (iter->user_data));
}
static void
pluma_file_browser_store_get_value (GtkTreeModel * tree_model,
- GtkTreeIter * iter,
+ GtkTreeIter * iter,
gint column,
GValue * value)
{
@@ -778,7 +778,7 @@ filter_tree_model_iter_has_child_real (PlumaFileBrowserStore * model,
FileBrowserNode * node)
{
GSList *item;
-
+
if (!NODE_IS_DIR (node))
return FALSE;
@@ -914,7 +914,7 @@ pluma_file_browser_store_row_inserted (GtkTreeModel * tree_model,
GtkTreeIter * iter)
{
FileBrowserNode * node = (FileBrowserNode *)(iter->user_data);
-
+
node->inserted = TRUE;
}
@@ -1147,7 +1147,7 @@ row_changed (PlumaFileBrowserStore * model,
signal may alter the path */
gtk_tree_model_row_changed (GTK_TREE_MODEL(model), *path, iter);
gtk_tree_path_free (*path);
-
+
*path = gtk_tree_row_reference_get_path (ref);
gtk_tree_row_reference_free (ref);
}
@@ -1159,7 +1159,7 @@ row_inserted (PlumaFileBrowserStore * model,
{
/* This function creates a row reference for the path because it's
uncertain what might change the actual model/view when we insert
- a node, maybe another directory load is triggered for example.
+ a node, maybe another directory load is triggered for example.
Because functions that use this function rely on the notion that
the path remains pointed towards the inserted node, we use the
reference to keep track. */
@@ -1168,7 +1168,7 @@ row_inserted (PlumaFileBrowserStore * model,
gtk_tree_model_row_inserted (GTK_TREE_MODEL(model), copy, iter);
gtk_tree_path_free (copy);
-
+
if (ref)
{
gtk_tree_path_free (*path);
@@ -1188,7 +1188,7 @@ row_deleted (PlumaFileBrowserStore * model,
const GtkTreePath * path)
{
GtkTreePath *copy = gtk_tree_path_copy (path);
-
+
/* Delete a copy of the actual path here because the row-deleted
signal may alter the path */
gtk_tree_model_row_deleted (GTK_TREE_MODEL(model), copy);
@@ -1259,7 +1259,7 @@ model_refilter_node (PlumaFileBrowserStore * model,
gtk_tree_path_next (*path);
}
}
-
+
model_check_dummy (model, node);
if (tmppath)
@@ -1374,7 +1374,7 @@ file_browser_node_free (PlumaFileBrowserStore * model,
g_object_unref (dir->monitor);
}
}
-
+
if (node->file)
{
uri = g_file_get_uri (node->file);
@@ -1391,7 +1391,7 @@ file_browser_node_free (PlumaFileBrowserStore * model,
g_object_unref (node->emblem);
g_free (node->name);
-
+
if (NODE_IS_DIR (node))
g_slice_free (FileBrowserNodeDir, (FileBrowserNodeDir *)node);
else
@@ -1433,10 +1433,10 @@ model_remove_node_children (PlumaFileBrowserStore * model,
// be freed
if (free_nodes)
file_browser_node_free_children (model, node);
-
+
return;
}
-
+
if (path == NULL)
path_child =
pluma_file_browser_store_get_path_real (model, node);
@@ -1460,10 +1460,10 @@ model_remove_node_children (PlumaFileBrowserStore * model,
* model_remove_node:
* @model: the #PlumaFileBrowserStore
* @node: the FileBrowserNode to remove
- * @path: the path to use to remove this node, or NULL to use the path
+ * @path: the path to use to remove this node, or NULL to use the path
* calculated from the node itself
* @free_nodes: whether to also remove the nodes from memory
- *
+ *
* Removes this node and all its children from the model. This function is used
* to remove the node from the _model_. Don't use it to just free
* a node.
@@ -1506,7 +1506,7 @@ model_remove_node (PlumaFileBrowserStore * model,
(node->parent)->children,
node);
}
-
+
/* If this is the virtual root, than set the parent as the virtual root */
if (node == model->priv->virtual_root)
set_virtual_root_from_node (model, parent);
@@ -1549,7 +1549,7 @@ model_clear (PlumaFileBrowserStore * model, gboolean free_nodes)
if (NODE_IS_DUMMY (dummy)
&& model_node_visibility (model, dummy)) {
path = gtk_tree_path_new_first ();
-
+
dummy->inserted = FALSE;
row_deleted (model, path);
gtk_tree_path_free (path);
@@ -1563,7 +1563,7 @@ file_browser_node_unload (PlumaFileBrowserStore * model,
FileBrowserNode * node, gboolean remove_children)
{
FileBrowserNodeDir *dir;
-
+
if (node == NULL)
return;
@@ -1586,7 +1586,7 @@ file_browser_node_unload (PlumaFileBrowserStore * model,
if (dir->monitor) {
g_file_monitor_cancel (dir->monitor);
g_object_unref (dir->monitor);
-
+
dir->monitor = NULL;
}
@@ -1735,7 +1735,7 @@ model_check_dummy (PlumaFileBrowserStore * model, FileBrowserNode * node)
path =
pluma_file_browser_store_get_path_real
(model, dummy);
-
+
row_inserted (model, &path, &iter);
gtk_tree_path_free (path);
}
@@ -1751,7 +1751,7 @@ model_check_dummy (PlumaFileBrowserStore * model, FileBrowserNode * node)
(model, dummy);
dummy->flags |=
PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN;
-
+
dummy->inserted = FALSE;
row_deleted (model, path);
gtk_tree_path_free (path);
@@ -1893,15 +1893,15 @@ static gchar const *
backup_content_type (GFileInfo * info)
{
gchar const * content;
-
+
if (!g_file_info_get_is_backup (info))
return NULL;
-
+
content = g_file_info_get_content_type (info);
-
+
if (!content || g_content_type_equals (content, "application/x-trash"))
return "text/plain";
-
+
return content;
}
@@ -1918,12 +1918,12 @@ file_browser_node_set_from_info (PlumaFileBrowserStore * model,
GError * error = NULL;
if (info == NULL) {
- info = g_file_query_info (node->file,
+ info = g_file_query_info (node->file,
STANDARD_ATTRIBUTE_TYPES,
G_FILE_QUERY_INFO_NONE,
NULL,
&error);
-
+
if (!info) {
if (!(error->domain == G_IO_ERROR && error->code == G_IO_ERROR_NOT_FOUND)) {
uri = g_file_get_uri (node->file);
@@ -1934,7 +1934,7 @@ file_browser_node_set_from_info (PlumaFileBrowserStore * model,
return;
}
-
+
free_info = TRUE;
}
@@ -1946,13 +1946,13 @@ file_browser_node_set_from_info (PlumaFileBrowserStore * model,
else {
if (!(content = backup_content_type (info)))
content = g_file_info_get_content_type (info);
-
- if (!content ||
+
+ if (!content ||
g_content_type_is_unknown (content) ||
g_content_type_is_a (content, "text/plain"))
- node->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_TEXT;
+ node->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_TEXT;
}
-
+
model_recomposite_icon_real (model, node, info);
if (free_info)
@@ -1962,7 +1962,7 @@ file_browser_node_set_from_info (PlumaFileBrowserStore * model,
path = pluma_file_browser_store_get_path_real (model, node);
model_refilter_node (model, node, &path);
gtk_tree_path_free (path);
-
+
model_check_dummy (model, node->parent);
} else {
model_node_update_visibility (model, node);
@@ -2006,11 +2006,11 @@ model_add_node_from_file (PlumaFileBrowserStore * model,
&error);
free_info = TRUE;
}
-
+
if (!info) {
g_warning ("Error querying file info: %s", error->message);
g_error_free (error);
-
+
/* FIXME: What to do now then... */
node = file_browser_node_new (file, parent);
} else if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) {
@@ -2021,7 +2021,7 @@ model_add_node_from_file (PlumaFileBrowserStore * model,
file_browser_node_set_from_info (model, node, info, FALSE);
model_add_node (model, node, parent);
-
+
if (info && free_info)
g_object_unref (info);
}
@@ -2056,7 +2056,7 @@ model_add_nodes_from_files (PlumaFileBrowserStore * model,
type != G_FILE_TYPE_SYMBOLIC_LINK) {
g_object_unref (info);
continue;
- }
+ }
name = g_file_info_get_name (info);
@@ -2098,7 +2098,7 @@ model_add_node_from_dir (PlumaFileBrowserStore * model,
FileBrowserNode *node;
/* Check if it already exists */
- if ((node = node_list_contains_file (FILE_BROWSER_NODE_DIR (parent)->children, file)) == NULL) {
+ if ((node = node_list_contains_file (FILE_BROWSER_NODE_DIR (parent)->children, file)) == NULL) {
node = file_browser_node_dir_new (model, file, parent);
file_browser_node_set_from_info (model, node, NULL, FALSE);
@@ -2138,7 +2138,7 @@ on_directory_monitor_event (GFileMonitor * monitor,
if (g_file_query_exists (file, NULL)) {
model_add_node_from_file (dir->model, parent, file, NULL);
}
-
+
break;
default:
break;
@@ -2154,33 +2154,33 @@ async_node_free (AsyncNode *async)
}
static void
-model_iterate_next_files_cb (GFileEnumerator * enumerator,
- GAsyncResult * result,
+model_iterate_next_files_cb (GFileEnumerator * enumerator,
+ GAsyncResult * result,
AsyncNode * async)
{
GList * files;
GError * error = NULL;
FileBrowserNodeDir * dir = async->dir;
FileBrowserNode * parent = (FileBrowserNode *)dir;
-
+
files = g_file_enumerator_next_files_finish (enumerator, result, &error);
if (files == NULL) {
g_file_enumerator_close (enumerator, NULL, NULL);
async_node_free (async);
-
+
if (!error)
{
/* We're done loading */
g_object_unref (dir->cancellable);
dir->cancellable = NULL;
-
+
/*
* FIXME: This is temporarly, it is a bug in gio:
* http://bugzilla.gnome.org/show_bug.cgi?id=565924
*/
if (g_file_is_native (parent->file) && dir->monitor == NULL) {
- dir->monitor = g_file_monitor_directory (parent->file,
+ dir->monitor = g_file_monitor_directory (parent->file,
G_FILE_MONITOR_NONE,
NULL,
NULL);
@@ -2199,7 +2199,7 @@ model_iterate_next_files_cb (GFileEnumerator * enumerator,
/* Simply return if we were cancelled */
if (error->domain == G_IO_ERROR && error->code == G_IO_ERROR_CANCELLED)
return;
-
+
/* Otherwise handle the error appropriately */
g_signal_emit (dir->model,
model_signals[ERROR],
@@ -2216,7 +2216,7 @@ model_iterate_next_files_cb (GFileEnumerator * enumerator,
async_node_free (async);
} else {
model_add_nodes_from_files (dir->model, parent, async->original_children, files);
-
+
g_list_free (files);
next_files_async (enumerator, async);
}
@@ -2235,7 +2235,7 @@ next_files_async (GFileEnumerator * enumerator,
}
static void
-model_iterate_children_cb (GFile * file,
+model_iterate_children_cb (GFile * file,
GAsyncResult * result,
AsyncNode * async)
{
@@ -2247,13 +2247,13 @@ model_iterate_children_cb (GFile * file,
async_node_free (async);
return;
}
-
+
enumerator = g_file_enumerate_children_finish (file, result, &error);
if (enumerator == NULL) {
/* Simply return if we were cancelled or if the dir is not there */
FileBrowserNodeDir *dir = async->dir;
-
+
/* Otherwise handle the error appropriately */
g_signal_emit (dir->model,
model_signals[ERROR],
@@ -2289,7 +2289,7 @@ model_load_directory (PlumaFileBrowserStore * model,
model_begin_loading (model, node);
dir->cancellable = g_cancellable_new ();
-
+
async = g_new (AsyncNode, 1);
async->dir = dir;
async->cancellable = g_object_ref (dir->cancellable);
@@ -2309,7 +2309,7 @@ static GList *
get_parent_files (PlumaFileBrowserStore * model, GFile * file)
{
GList * result = NULL;
-
+
result = g_list_prepend (result, g_object_ref (file));
while ((file = g_file_get_parent (file))) {
@@ -2355,7 +2355,7 @@ model_fill (PlumaFileBrowserStore * model, FileBrowserNode * node,
if (node != model->priv->virtual_root) {
/* Insert node */
iter.user_data = node;
-
+
row_inserted(model, path, &iter);
}
@@ -2378,7 +2378,7 @@ model_fill (PlumaFileBrowserStore * model, FileBrowserNode * node,
/* Move back up to node path */
gtk_tree_path_up (*path);
}
-
+
model_check_dummy (model, node);
if (free_path)
@@ -2439,8 +2439,8 @@ set_virtual_root_from_node (PlumaFileBrowserStore * model,
for (item = FILE_BROWSER_NODE_DIR (node)->children; item;
item = item->next) {
check = (FileBrowserNode *) (item->data);
-
- if (NODE_IS_DIR (check)) {
+
+ if (NODE_IS_DIR (check)) {
for (copy =
FILE_BROWSER_NODE_DIR (check)->children; copy;
copy = copy->next) {
@@ -2491,7 +2491,7 @@ set_virtual_root_from_file (PlumaFileBrowserStore * model,
for (item = files; item; item = item->next) {
check = G_FILE (item->data);
-
+
parent = model_add_node_from_dir (model, parent, check);
g_object_unref (check);
}
@@ -2509,21 +2509,21 @@ model_find_node_children (PlumaFileBrowserStore * model,
FileBrowserNode *child;
FileBrowserNode *result;
GSList *children;
-
+
if (!NODE_IS_DIR (parent))
return NULL;
-
+
dir = FILE_BROWSER_NODE_DIR (parent);
-
+
for (children = dir->children; children; children = children->next) {
child = (FileBrowserNode *)(children->data);
-
+
result = model_find_node (model, child, file);
-
+
if (result)
return result;
}
-
+
return NULL;
}
@@ -2540,7 +2540,7 @@ model_find_node (PlumaFileBrowserStore * model,
if (NODE_IS_DIR (node) && g_file_has_prefix (file, node->file))
return model_find_node_children (model, node, file);
-
+
return NULL;
}
@@ -2603,40 +2603,40 @@ handle_root_error (PlumaFileBrowserStore * model, GError *error)
{
FileBrowserNode * root;
- g_signal_emit (model,
- model_signals[ERROR],
- 0,
+ g_signal_emit (model,
+ model_signals[ERROR],
+ 0,
PLUMA_FILE_BROWSER_ERROR_SET_ROOT,
error->message);
-
+
/* Set the virtual root to the root */
root = model->priv->root;
model->priv->virtual_root = root;
-
+
/* Set the root to be loaded */
root->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_LOADED;
-
+
/* Check the dummy */
model_check_dummy (model, root);
-
+
g_object_notify (G_OBJECT (model), "root");
g_object_notify (G_OBJECT (model), "virtual-root");
}
static void
-mount_cb (GFile * file,
- GAsyncResult * res,
+mount_cb (GFile * file,
+ GAsyncResult * res,
MountInfo * mount_info)
{
gboolean mounted;
GError * error = NULL;
PlumaFileBrowserStore * model = mount_info->model;
-
+
mounted = g_file_mount_enclosing_volume_finish (file, res, &error);
if (mount_info->model)
{
- model->priv->mount_info = NULL;
+ model->priv->mount_info = NULL;
model_end_loading (model, model->priv->root);
}
@@ -2653,7 +2653,7 @@ mount_cb (GFile * file,
{
handle_root_error (model, error);
}
-
+
if (error)
g_error_free (error);
@@ -2670,9 +2670,9 @@ model_mount_root (PlumaFileBrowserStore * model, gchar const * virtual_root)
GFileInfo * info;
GError * error = NULL;
MountInfo * mount_info;
-
- info = g_file_query_info (model->priv->root->file,
- G_FILE_ATTRIBUTE_STANDARD_TYPE,
+
+ info = g_file_query_info (model->priv->root->file,
+ G_FILE_ATTRIBUTE_STANDARD_TYPE,
G_FILE_QUERY_INFO_NONE,
NULL,
&error);
@@ -2681,23 +2681,23 @@ model_mount_root (PlumaFileBrowserStore * model, gchar const * virtual_root)
if (error->code == G_IO_ERROR_NOT_MOUNTED) {
/* Try to mount it */
FILE_BROWSER_NODE_DIR (model->priv->root)->cancellable = g_cancellable_new ();
-
+
mount_info = g_new(MountInfo, 1);
mount_info->model = model;
mount_info->virtual_root = g_strdup (virtual_root);
-
+
/* FIXME: we should be setting the correct window */
mount_info->operation = gtk_mount_operation_new (NULL);
mount_info->cancellable = g_object_ref (FILE_BROWSER_NODE_DIR (model->priv->root)->cancellable);
-
+
model_begin_loading (model, model->priv->root);
- g_file_mount_enclosing_volume (model->priv->root->file,
+ g_file_mount_enclosing_volume (model->priv->root->file,
G_MOUNT_MOUNT_NONE,
mount_info->operation,
mount_info->cancellable,
(GAsyncReadyCallback)mount_cb,
mount_info);
-
+
model->priv->mount_info = mount_info;
return PLUMA_FILE_BROWSER_STORE_RESULT_MOUNTING;
}
@@ -2705,14 +2705,14 @@ model_mount_root (PlumaFileBrowserStore * model, gchar const * virtual_root)
{
handle_root_error (model, error);
}
-
+
g_error_free (error);
} else {
g_object_unref (info);
-
+
return model_root_mounted (model, virtual_root);
}
-
+
return PLUMA_FILE_BROWSER_STORE_RESULT_OK;
}
@@ -2763,7 +2763,7 @@ pluma_file_browser_store_set_value (PlumaFileBrowserStore * tree_model,
model_recomposite_icon (tree_model, iter);
if (model_node_visibility (tree_model, node)) {
- path = pluma_file_browser_store_get_path (GTK_TREE_MODEL (tree_model),
+ path = pluma_file_browser_store_get_path (GTK_TREE_MODEL (tree_model),
iter);
row_changed (tree_model, &path, iter);
gtk_tree_path_free (path);
@@ -2921,7 +2921,7 @@ void
pluma_file_browser_store_cancel_mount_operation (PlumaFileBrowserStore *store)
{
g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (store));
-
+
cancel_mount_operation (store);
}
@@ -2968,7 +2968,7 @@ pluma_file_browser_store_set_root_and_virtual_root (PlumaFileBrowserStore *
g_object_unref (vfile);
}
-
+
/* make sure to cancel any previous mount operations */
cancel_mount_operation (model);
@@ -2982,7 +2982,7 @@ pluma_file_browser_store_set_root_and_virtual_root (PlumaFileBrowserStore *
if (file != NULL) {
/* Create the root node */
node = file_browser_node_dir_new (model, file, NULL);
-
+
g_object_unref (file);
model->priv->root = node;
@@ -3010,18 +3010,18 @@ gchar *
pluma_file_browser_store_get_root (PlumaFileBrowserStore * model)
{
g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), NULL);
-
+
if (model->priv->root == NULL || model->priv->root->file == NULL)
return NULL;
else
return g_file_get_uri (model->priv->root->file);
}
-gchar *
+gchar *
pluma_file_browser_store_get_virtual_root (PlumaFileBrowserStore * model)
{
g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), NULL);
-
+
if (model->priv->virtual_root == NULL || model->priv->virtual_root->file == NULL)
return NULL;
else
@@ -3147,7 +3147,7 @@ reparent_node (FileBrowserNode * node, gboolean reparent)
if (!node->file) {
return;
}
-
+
if (reparent) {
parent = node->parent->file;
base = g_file_get_basename (node->file);
@@ -3156,10 +3156,10 @@ reparent_node (FileBrowserNode * node, gboolean reparent)
node->file = g_file_get_child (parent, base);
g_free (base);
}
-
+
if (NODE_IS_DIR (node)) {
dir = FILE_BROWSER_NODE_DIR (node);
-
+
for (child = dir->children; child; child = child->next) {
reparent_node ((FileBrowserNode *)child->data, TRUE);
}
@@ -3205,7 +3205,7 @@ pluma_file_browser_store_rename (PlumaFileBrowserStore * model,
/* This makes sure the actual info for the node is requeried */
file_browser_node_set_name (node);
file_browser_node_set_from_info (model, node, NULL, TRUE);
-
+
reparent_node (node, FALSE);
if (model_node_visibility (model, node)) {
@@ -3217,7 +3217,7 @@ pluma_file_browser_store_rename (PlumaFileBrowserStore * model,
model_resort_node (model, node);
} else {
g_object_unref (previous);
-
+
if (error != NULL)
*error = g_error_new_literal (pluma_file_browser_store_error_quark (),
PLUMA_FILE_BROWSER_ERROR_RENAME,
@@ -3246,7 +3246,7 @@ pluma_file_browser_store_rename (PlumaFileBrowserStore * model,
PLUMA_FILE_BROWSER_ERROR_RENAME,
err->message);
}
-
+
g_error_free (err);
}
@@ -3258,13 +3258,13 @@ static void
async_data_free (AsyncData * data)
{
g_object_unref (data->cancellable);
-
+
g_list_foreach (data->files, (GFunc)g_object_unref, NULL);
g_list_free (data->files);
-
+
if (!data->removed)
data->model->priv->async_handles = g_slist_remove (data->model->priv->async_handles, data);
-
+
g_free (data);
}
@@ -3285,7 +3285,7 @@ delete_file_finished (GFile *file,
{
GError * error = NULL;
gboolean ok;
-
+
if (data->trash)
{
ok = g_file_trash_finish (file, res, &error);
@@ -3337,7 +3337,7 @@ delete_file_finished (GFile *file,
return;
}
}
-
+
/* Continue the job */
delete_files (data);
}
@@ -3387,7 +3387,7 @@ pluma_file_browser_store_delete_all (PlumaFileBrowserStore *model,
GtkTreePath * path;
g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE);
-
+
if (rows == NULL)
return PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE;
@@ -3401,17 +3401,17 @@ pluma_file_browser_store_delete_all (PlumaFileBrowserStore *model,
if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path))
continue;
-
+
/* Skip if the current path is actually a descendant of the
previous path */
if (prev != NULL && gtk_tree_path_is_descendant (path, prev))
continue;
-
+
prev = path;
node = (FileBrowserNode *)(iter.user_data);
files = g_list_prepend (files, g_object_ref (node->file));
}
-
+
data = g_new (AsyncData, 1);
data->model = model;
@@ -3420,13 +3420,13 @@ pluma_file_browser_store_delete_all (PlumaFileBrowserStore *model,
data->trash = trash;
data->iter = files;
data->removed = FALSE;
-
+
model->priv->async_handles =
g_slist_prepend (model->priv->async_handles, data);
delete_files (data);
g_list_free (rows);
-
+
return PLUMA_FILE_BROWSER_STORE_RESULT_OK;
}
@@ -3449,10 +3449,10 @@ pluma_file_browser_store_delete (PlumaFileBrowserStore * model,
rows = g_list_append(NULL, pluma_file_browser_store_get_path_real (model, node));
result = pluma_file_browser_store_delete_all (model, rows, trash);
-
+
g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
g_list_free (rows);
-
+
return result;
}
@@ -3481,7 +3481,7 @@ pluma_file_browser_store_new_file (PlumaFileBrowserStore * model,
file = unique_new_name (((FileBrowserNode *) parent_node)->file, _("file"));
stream = g_file_create (file, G_FILE_CREATE_NONE, NULL, &error);
-
+
if (!stream)
{
g_signal_emit (model, model_signals[ERROR], 0,
@@ -3490,9 +3490,9 @@ pluma_file_browser_store_new_file (PlumaFileBrowserStore * model,
g_error_free (error);
} else {
g_object_unref (stream);
- node = model_add_node_from_file (model,
- (FileBrowserNode *)parent_node,
- file,
+ node = model_add_node_from_file (model,
+ (FileBrowserNode *)parent_node,
+ file,
NULL);
if (model_node_visibility (model, node)) {
@@ -3539,9 +3539,9 @@ pluma_file_browser_store_new_directory (PlumaFileBrowserStore * model,
error->message);
g_error_free (error);
} else {
- node = model_add_node_from_file (model,
- (FileBrowserNode *)parent_node,
- file,
+ node = model_add_node_from_file (model,
+ (FileBrowserNode *)parent_node,
+ file,
NULL);
if (model_node_visibility (model, node)) {