summaryrefslogtreecommitdiff
path: root/plugins/filebrowser
diff options
context:
space:
mode:
authorLaurent Napias <[email protected]>2019-06-29 10:29:13 +0200
committerZenWalker <[email protected]>2019-07-06 21:46:58 +0200
commitdb655f3fb2f67b695d36369e584fcb598e0e1bea (patch)
treeff7a4404cb6f0d1d8ca3a08ee50c60641641f1b4 /plugins/filebrowser
parent5153fb08a2e26015d07e7b3805de15d38bd05a9d (diff)
downloadpluma-db655f3fb2f67b695d36369e584fcb598e0e1bea.tar.bz2
pluma-db655f3fb2f67b695d36369e584fcb598e0e1bea.tar.xz
Remove trailing whitespaces
Diffstat (limited to 'plugins/filebrowser')
-rw-r--r--plugins/filebrowser/pluma-file-bookmarks-store.c110
-rw-r--r--plugins/filebrowser/pluma-file-bookmarks-store.h10
-rw-r--r--plugins/filebrowser/pluma-file-browser-error.h2
-rw-r--r--plugins/filebrowser/pluma-file-browser-messages.c354
-rw-r--r--plugins/filebrowser/pluma-file-browser-messages.h2
-rw-r--r--plugins/filebrowser/pluma-file-browser-plugin.h6
-rw-r--r--plugins/filebrowser/pluma-file-browser-store.c262
-rw-r--r--plugins/filebrowser/pluma-file-browser-store.h34
-rw-r--r--plugins/filebrowser/pluma-file-browser-utils.c44
-rw-r--r--plugins/filebrowser/pluma-file-browser-view.c206
-rw-r--r--plugins/filebrowser/pluma-file-browser-view.h12
-rw-r--r--plugins/filebrowser/pluma-file-browser-widget.c384
-rw-r--r--plugins/filebrowser/pluma-file-browser-widget.h18
13 files changed, 722 insertions, 722 deletions
diff --git a/plugins/filebrowser/pluma-file-bookmarks-store.c b/plugins/filebrowser/pluma-file-bookmarks-store.c
index bcd550a2..1a8ce12c 100644
--- a/plugins/filebrowser/pluma-file-bookmarks-store.c
+++ b/plugins/filebrowser/pluma-file-bookmarks-store.c
@@ -1,5 +1,5 @@
/*
- * pluma-file-bookmarks-store.c - Pluma plugin providing easy file access
+ * pluma-file-bookmarks-store.c - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <[email protected]>
@@ -31,27 +31,27 @@
G_TYPE_INSTANCE_GET_PRIVATE((object), PLUMA_TYPE_FILE_BOOKMARKS_STORE, \
PlumaFileBookmarksStorePrivate))
-struct _PlumaFileBookmarksStorePrivate
+struct _PlumaFileBookmarksStorePrivate
{
GVolumeMonitor * volume_monitor;
GFileMonitor * bookmarks_monitor;
};
-static void remove_node (GtkTreeModel * model,
+static void remove_node (GtkTreeModel * model,
GtkTreeIter * iter);
static void on_fs_changed (GVolumeMonitor *monitor,
GObject *object,
PlumaFileBookmarksStore *model);
-
+
static void on_bookmarks_file_changed (GFileMonitor * monitor,
GFile * file,
GFile * other_file,
GFileMonitorEvent event_type,
PlumaFileBookmarksStore * model);
-static gboolean find_with_flags (GtkTreeModel * model,
+static gboolean find_with_flags (GtkTreeModel * model,
GtkTreeIter * iter,
- gpointer obj,
+ gpointer obj,
guint flags,
guint notflags);
@@ -110,11 +110,11 @@ pluma_file_bookmarks_store_init (PlumaFileBookmarksStore * obj)
/* Private */
static void
-add_node (PlumaFileBookmarksStore *model,
+add_node (PlumaFileBookmarksStore *model,
GdkPixbuf *pixbuf,
- const gchar *name,
- GObject *obj,
- guint flags,
+ const gchar *name,
+ GObject *obj,
+ guint flags,
GtkTreeIter *iter)
{
GtkTreeIter newiter;
@@ -133,10 +133,10 @@ add_node (PlumaFileBookmarksStore *model,
}
static gboolean
-add_file (PlumaFileBookmarksStore *model,
+add_file (PlumaFileBookmarksStore *model,
GFile *file,
- const gchar *name,
- guint flags,
+ const gchar *name,
+ guint flags,
GtkTreeIter *iter)
{
GdkPixbuf *pixbuf = NULL;
@@ -235,11 +235,11 @@ init_special_directories (PlumaFileBookmarksStore * model)
PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
g_object_unref (file);
}
-
+
file = g_file_new_for_uri ("file:///");
add_file (model, file, _("File System"), PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT, NULL);
g_object_unref (file);
-
+
check_mount_separator (model, PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT, TRUE);
}
@@ -254,36 +254,36 @@ get_fs_properties (gpointer fs,
*flags = PLUMA_FILE_BOOKMARKS_STORE_IS_FS;
*name = NULL;
*pixbuf = NULL;
-
+
if (G_IS_DRIVE (fs))
{
icon = g_drive_get_icon (G_DRIVE (fs));
*name = g_drive_get_name (G_DRIVE (fs));
-
+
*flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_DRIVE;
}
else if (G_IS_VOLUME (fs))
{
icon = g_volume_get_icon (G_VOLUME (fs));
*name = g_volume_get_name (G_VOLUME (fs));
-
+
*flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_VOLUME;
}
else if (G_IS_MOUNT (fs))
{
icon = g_mount_get_icon (G_MOUNT (fs));
*name = g_mount_get_name (G_MOUNT (fs));
-
+
*flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT;
}
-
+
if (icon)
{
*pixbuf = pluma_file_browser_utils_pixbuf_from_icon (icon, GTK_ICON_SIZE_MENU);
g_object_unref (icon);
}
}
-
+
static void
add_fs (PlumaFileBookmarksStore *model,
@@ -294,10 +294,10 @@ add_fs (PlumaFileBookmarksStore *model,
gchar *name;
GdkPixbuf *pixbuf;
guint fsflags;
-
+
get_fs_properties (fs, &name, &pixbuf, &fsflags);
add_node (model, pixbuf, name, fs, flags | fsflags, iter);
-
+
if (pixbuf)
g_object_unref (pixbuf);
@@ -312,7 +312,7 @@ process_volume_cb (GVolume *volume,
GMount *mount;
guint flags = PLUMA_FILE_BOOKMARKS_STORE_NONE;
mount = g_volume_get_mount (volume);
-
+
/* CHECK: should we use the LOCAL/REMOTE thing still? */
if (mount)
{
@@ -336,7 +336,7 @@ process_drive_novolumes (PlumaFileBookmarksStore *model,
!g_drive_is_media_check_automatic (drive) &&
g_drive_can_poll_for_media (drive))
{
- /* This can be the case for floppy drives or other
+ /* This can be the case for floppy drives or other
drives where media detection fails. We show the
drive and poll for media when the user activates
it */
@@ -361,14 +361,14 @@ process_drive_cb (GDrive *drive,
else
{
process_drive_novolumes (model, drive);
- }
+ }
}
static void
init_drives (PlumaFileBookmarksStore *model)
{
GList *drives;
-
+
drives = g_volume_monitor_get_connected_drives (model->priv->volume_monitor);
g_list_foreach (drives, (GFunc)process_drive_cb, model);
@@ -381,15 +381,15 @@ process_volume_nodrive_cb (GVolume *volume,
PlumaFileBookmarksStore *model)
{
GDrive *drive;
-
+
drive = g_volume_get_drive (volume);
-
+
if (drive)
{
g_object_unref (drive);
return;
}
-
+
process_volume_cb (volume, model);
}
@@ -397,9 +397,9 @@ static void
init_volumes (PlumaFileBookmarksStore *model)
{
GList *volumes;
-
+
volumes = g_volume_monitor_get_volumes (model->priv->volume_monitor);
-
+
g_list_foreach (volumes, (GFunc)process_volume_nodrive_cb, model);
g_list_foreach (volumes, (GFunc)g_object_unref, NULL);
g_list_free (volumes);
@@ -410,9 +410,9 @@ process_mount_novolume_cb (GMount *mount,
PlumaFileBookmarksStore *model)
{
GVolume *volume;
-
+
volume = g_mount_get_volume (mount);
-
+
if (volume)
{
g_object_unref (volume);
@@ -428,9 +428,9 @@ static void
init_mounts (PlumaFileBookmarksStore *model)
{
GList *mounts;
-
+
mounts = g_volume_monitor_get_mounts (model->priv->volume_monitor);
-
+
g_list_foreach (mounts, (GFunc)process_mount_novolume_cb, model);
g_list_foreach (mounts, (GFunc)g_object_unref, NULL);
g_list_free (mounts);
@@ -447,10 +447,10 @@ init_fs (PlumaFileBookmarksStore * model)
"mount-added", "mount-removed", "mount-changed",
NULL
};
-
+
model->priv->volume_monitor = g_volume_monitor_get ();
- /* Connect signals */
+ /* Connect signals */
for (ptr = signals; *ptr; ptr++)
{
g_signal_connect (model->priv->volume_monitor,
@@ -461,16 +461,16 @@ init_fs (PlumaFileBookmarksStore * model)
/* First go through all the connected drives */
init_drives (model);
-
+
/* Then add all volumes, not associated with a drive */
init_volumes (model);
-
+
/* Then finally add all mounts that have no volume */
init_mounts (model);
}
static gboolean
-add_bookmark (PlumaFileBookmarksStore * model,
+add_bookmark (PlumaFileBookmarksStore * model,
gchar const * name,
gchar const * uri)
{
@@ -478,9 +478,9 @@ add_bookmark (PlumaFileBookmarksStore * model,
gboolean ret;
guint flags = PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK;
GtkTreeIter iter;
-
+
file = g_file_new_for_uri (uri);
-
+
if (g_file_is_native (file)) {
flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK;
} else {
@@ -490,7 +490,7 @@ add_bookmark (PlumaFileBookmarksStore * model,
ret = add_file (model, file, name, flags, &iter);
g_object_unref (file);
-
+
return ret;
}
@@ -727,7 +727,7 @@ find_with_flags (GtkTreeModel * model, GtkTreeIter * iter, gpointer obj,
guint childflags = 0;
GObject * childobj;
gboolean fequal;
-
+
if (!gtk_tree_model_get_iter_first (model, &child))
return FALSE;
@@ -737,12 +737,12 @@ find_with_flags (GtkTreeModel * model, GtkTreeIter * iter, gpointer obj,
&childobj,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
&childflags, -1);
-
+
fequal = (obj == childobj);
-
+
if (childobj)
g_object_unref (childobj);
-
+
if ((obj == NULL || fequal) &&
(childflags & flags) == flags
&& !(childflags & notflags)) {
@@ -832,14 +832,14 @@ pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model,
guint flags;
gchar * ret = NULL;
gboolean isfs;
-
+
g_return_val_if_fail (PLUMA_IS_FILE_BOOKMARKS_STORE (model), NULL);
g_return_val_if_fail (iter != NULL, NULL);
gtk_tree_model_get (GTK_TREE_MODEL (model), iter,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
&flags,
- PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
+ PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
&obj,
-1);
@@ -847,7 +847,7 @@ pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model,
return NULL;
isfs = (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_FS);
-
+
if (isfs && (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT))
{
file = g_mount_get_root (G_MOUNT (obj));
@@ -856,15 +856,15 @@ pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model,
{
file = g_object_ref (obj);
}
-
+
g_object_unref (obj);
-
+
if (file)
{
ret = g_file_get_uri (file);
g_object_unref (file);
}
-
+
return ret;
}
@@ -888,7 +888,7 @@ on_fs_changed (GVolumeMonitor *monitor,
/* clear all fs items */
while (find_with_flags (tree_model, &iter, NULL, flags, noflags))
remove_node (tree_model, &iter);
-
+
/* then reinitialize */
init_fs (model);
}
diff --git a/plugins/filebrowser/pluma-file-bookmarks-store.h b/plugins/filebrowser/pluma-file-bookmarks-store.h
index 4c368db6..94dcb1e7 100644
--- a/plugins/filebrowser/pluma-file-bookmarks-store.h
+++ b/plugins/filebrowser/pluma-file-bookmarks-store.h
@@ -1,5 +1,5 @@
/*
- * pluma-file-bookmarks-store.h - Pluma plugin providing easy file access
+ * pluma-file-bookmarks-store.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <[email protected]>
@@ -37,7 +37,7 @@ typedef struct _PlumaFileBookmarksStore PlumaFileBookmarksStore;
typedef struct _PlumaFileBookmarksStoreClass PlumaFileBookmarksStoreClass;
typedef struct _PlumaFileBookmarksStorePrivate PlumaFileBookmarksStorePrivate;
-enum
+enum
{
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_ICON = 0,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME,
@@ -46,7 +46,7 @@ enum
PLUMA_FILE_BOOKMARKS_STORE_N_COLUMNS
};
-enum
+enum
{
PLUMA_FILE_BOOKMARKS_STORE_NONE = 0,
PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR = 1 << 0, /* Separator item */
@@ -64,14 +64,14 @@ enum
PLUMA_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK = 1 << 12 /* A local gtk bookmark */
};
-struct _PlumaFileBookmarksStore
+struct _PlumaFileBookmarksStore
{
GtkTreeStore parent;
PlumaFileBookmarksStorePrivate *priv;
};
-struct _PlumaFileBookmarksStoreClass
+struct _PlumaFileBookmarksStoreClass
{
GtkTreeStoreClass parent_class;
};
diff --git a/plugins/filebrowser/pluma-file-browser-error.h b/plugins/filebrowser/pluma-file-browser-error.h
index 798022f0..57f08292 100644
--- a/plugins/filebrowser/pluma-file-browser-error.h
+++ b/plugins/filebrowser/pluma-file-browser-error.h
@@ -1,5 +1,5 @@
/*
- * pluma-file-browser-error.h - Pluma plugin providing easy file access
+ * pluma-file-browser-error.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <[email protected]>
diff --git a/plugins/filebrowser/pluma-file-browser-messages.c b/plugins/filebrowser/pluma-file-browser-messages.c
index f4b20d05..2c703973 100644
--- a/plugins/filebrowser/pluma-file-browser-messages.c
+++ b/plugins/filebrowser/pluma-file-browser-messages.c
@@ -9,7 +9,7 @@
typedef struct
{
- PlumaWindow *window;
+ PlumaWindow *window;
PlumaMessage *message;
} MessageCacheData;
@@ -23,18 +23,18 @@ typedef struct
GList *merge_ids;
GtkActionGroup *merged_actions;
-
+
PlumaMessageBus *bus;
PlumaFileBrowserWidget *widget;
GHashTable *row_tracking;
-
+
GHashTable *filters;
} WindowData;
typedef struct
{
gulong id;
-
+
PlumaWindow *window;
PlumaMessage *message;
} FilterData;
@@ -46,10 +46,10 @@ window_data_new (PlumaWindow *window,
WindowData *data = g_slice_new (WindowData);
GtkUIManager *manager;
GList *groups;
-
+
data->bus = pluma_window_get_message_bus (window);
data->widget = widget;
- data->row_tracking = g_hash_table_new_full (g_str_hash,
+ data->row_tracking = g_hash_table_new_full (g_str_hash,
g_str_equal,
(GDestroyNotify)g_free,
(GDestroyNotify)gtk_tree_row_reference_free);
@@ -58,15 +58,15 @@ window_data_new (PlumaWindow *window,
g_str_equal,
(GDestroyNotify)g_free,
NULL);
-
+
manager = pluma_file_browser_widget_get_ui_manager (widget);
data->merge_ids = NULL;
data->merged_actions = gtk_action_group_new ("MessageMergedActions");
-
+
groups = gtk_ui_manager_get_action_groups (manager);
gtk_ui_manager_insert_action_group (manager, data->merged_actions, g_list_length (groups));
-
+
g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, data);
return data;
@@ -84,13 +84,13 @@ window_data_free (PlumaWindow *window)
WindowData *data = get_window_data (window);
GtkUIManager *manager;
GList *item;
-
- g_hash_table_destroy (data->row_tracking);
+
+ g_hash_table_destroy (data->row_tracking);
g_hash_table_destroy (data->filters);
manager = pluma_file_browser_widget_get_ui_manager (data->widget);
gtk_ui_manager_remove_action_group (manager, data->merged_actions);
-
+
for (item = data->merge_ids; item; item = item->next)
gtk_ui_manager_remove_ui (manager, GPOINTER_TO_INT (item->data));
@@ -103,19 +103,19 @@ window_data_free (PlumaWindow *window)
}
static FilterData *
-filter_data_new (PlumaWindow *window,
+filter_data_new (PlumaWindow *window,
PlumaMessage *message)
{
FilterData *data = g_slice_new (FilterData);
WindowData *wdata;
-
+
data->window = window;
data->id = 0;
data->message = message;
-
+
wdata = get_window_data (window);
-
- g_hash_table_insert (wdata->filters,
+
+ g_hash_table_insert (wdata->filters,
pluma_message_type_identifier (pluma_message_get_object_path (message),
pluma_message_get_method (message)),
data);
@@ -128,10 +128,10 @@ filter_data_free (FilterData *data)
{
WindowData *wdata = get_window_data (data->window);
gchar *identifier;
-
+
identifier = pluma_message_type_identifier (pluma_message_get_object_path (data->message),
pluma_message_get_method (data->message));
-
+
g_hash_table_remove (wdata->filters, identifier);
g_free (identifier);
@@ -140,16 +140,16 @@ filter_data_free (FilterData *data)
}
static GtkTreePath *
-track_row_lookup (WindowData *data,
+track_row_lookup (WindowData *data,
const gchar *id)
{
GtkTreeRowReference *ref;
-
+
ref = (GtkTreeRowReference *)g_hash_table_lookup (data->row_tracking, id);
-
+
if (!ref)
return NULL;
-
+
return gtk_tree_row_reference_get_path (ref);
}
@@ -165,10 +165,10 @@ message_cache_data_new (PlumaWindow *window,
PlumaMessage *message)
{
MessageCacheData *data = g_slice_new (MessageCacheData);
-
+
data->window = window;
data->message = message;
-
+
return data;
}
@@ -179,10 +179,10 @@ message_get_root_cb (PlumaMessageBus *bus,
{
PlumaFileBrowserStore *store;
gchar *uri;
-
+
store = pluma_file_browser_widget_get_browser_store (data->widget);
uri = pluma_file_browser_store_get_virtual_root (store);
-
+
pluma_message_set (message, "uri", uri, NULL);
g_free (uri);
}
@@ -194,12 +194,12 @@ message_set_root_cb (PlumaMessageBus *bus,
{
gchar *root = NULL;
gchar *virtual = NULL;
-
+
pluma_message_get (message, "uri", &root, NULL);
-
+
if (!root)
return;
-
+
if (pluma_message_has_key (message, "virtual"))
pluma_message_get (message, "virtual", &virtual, NULL);
@@ -207,7 +207,7 @@ message_set_root_cb (PlumaMessageBus *bus,
pluma_file_browser_widget_set_root_and_virtual_root (data->widget, root, virtual);
else
pluma_file_browser_widget_set_root (data->widget, root, TRUE);
-
+
g_free (root);
g_free (virtual);
}
@@ -221,57 +221,57 @@ message_set_emblem_cb (PlumaMessageBus *bus,
gchar *emblem = NULL;
GtkTreePath *path;
PlumaFileBrowserStore *store;
-
+
pluma_message_get (message, "id", &id, "emblem", &emblem, NULL);
-
+
if (!id || !emblem)
{
g_free (id);
g_free (emblem);
-
+
return;
}
-
+
path = track_row_lookup (data, id);
-
+
if (path != NULL)
{
GError *error = NULL;
GdkPixbuf *pixbuf;
-
- pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
- emblem,
- 10,
- 0,
+
+ pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
+ emblem,
+ 10,
+ 0,
&error);
-
+
if (pixbuf)
{
GValue value = { 0, };
GtkTreeIter iter;
-
+
store = pluma_file_browser_widget_get_browser_store (data->widget);
-
+
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path))
{
g_value_init (&value, GDK_TYPE_PIXBUF);
g_value_set_object (&value, pixbuf);
-
- pluma_file_browser_store_set_value (store,
+
+ pluma_file_browser_store_set_value (store,
&iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_EMBLEM,
&value);
-
+
g_value_unset (&value);
}
-
+
g_object_unref (pixbuf);
}
-
+
if (error)
g_error_free (error);
}
-
+
g_free (id);
g_free (emblem);
}
@@ -292,20 +292,20 @@ track_row (WindowData *data,
GtkTreeRowReference *ref;
gchar *id;
gchar *pathstr;
-
+
pathstr = gtk_tree_path_to_string (path);
id = item_id (pathstr, uri);
-
+
ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (store), path);
g_hash_table_insert (data->row_tracking, g_strdup (id), ref);
-
+
g_free (pathstr);
-
+
return id;
}
static void
-set_item_message (WindowData *data,
+set_item_message (WindowData *data,
GtkTreeIter *iter,
GtkTreePath *path,
PlumaMessage *message)
@@ -314,14 +314,14 @@ set_item_message (WindowData *data,
gchar *uri = NULL;
guint flags = 0;
gchar *track_id;
-
+
store = pluma_file_browser_widget_get_browser_store (data->widget);
-
+
gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
-
+
if (!uri)
return;
@@ -334,13 +334,13 @@ set_item_message (WindowData *data,
"id", track_id,
"uri", uri,
NULL);
-
+
if (pluma_message_has_key (message, "is_directory"))
{
- pluma_message_set (message,
+ pluma_message_set (message,
"is_directory", FILE_IS_DIR (flags),
NULL);
- }
+ }
g_free (uri);
g_free (track_id);
@@ -357,27 +357,27 @@ custom_message_filter_func (PlumaFileBrowserWidget *widget,
guint flags = 0;
gboolean filter = FALSE;
GtkTreePath *path;
-
- gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
+
+ gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
-
+
if (!uri || FILE_IS_DUMMY (flags))
{
g_free (uri);
return FALSE;
}
-
+
path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), iter);
set_item_message (wdata, iter, path, data->message);
gtk_tree_path_free (path);
-
+
pluma_message_set (data->message, "filter", filter, NULL);
pluma_message_bus_send_message_sync (wdata->bus, data->message);
pluma_message_get (data->message, "filter", &filter, NULL);
-
+
return !filter;
}
@@ -393,31 +393,31 @@ message_add_filter_cb (PlumaMessageBus *bus,
PlumaMessage *cbmessage;
FilterData *filter_data;
WindowData *data = get_window_data (window);
-
- pluma_message_get (message,
+
+ pluma_message_get (message,
"object_path", &object_path,
"method", &method,
NULL);
-
+
// Check if there exists such a 'callback' message
if (!object_path || !method)
{
g_free (object_path);
g_free (method);
-
+
return;
}
-
+
message_type = pluma_message_bus_lookup (bus, object_path, method);
-
+
if (!message_type)
{
g_free (object_path);
g_free (method);
-
+
return;
}
-
+
// Check if the message type has the correct arguments
if (pluma_message_type_lookup (message_type, "id") != G_TYPE_STRING ||
pluma_message_type_lookup (message_type, "uri") != G_TYPE_STRING ||
@@ -426,7 +426,7 @@ message_add_filter_cb (PlumaMessageBus *bus,
{
return;
}
-
+
cbmessage = pluma_message_type_instantiate (message_type,
"id", NULL,
"uri", NULL,
@@ -436,7 +436,7 @@ message_add_filter_cb (PlumaMessageBus *bus,
// Register the custom filter on the widget
filter_data = filter_data_new (window, cbmessage);
- id = pluma_file_browser_widget_add_filter (data->widget,
+ id = pluma_file_browser_widget_add_filter (data->widget,
(PlumaFileBrowserWidgetFilterFunc)custom_message_filter_func,
filter_data,
(GDestroyNotify)filter_data_free);
@@ -450,12 +450,12 @@ message_remove_filter_cb (PlumaMessageBus *bus,
WindowData *data)
{
gulong id = 0;
-
+
pluma_message_get (message, "id", &id, NULL);
-
+
if (!id)
return;
-
+
pluma_file_browser_widget_remove_filter (data->widget, id);
}
@@ -465,7 +465,7 @@ message_up_cb (PlumaMessageBus *bus,
WindowData *data)
{
PlumaFileBrowserStore *store = pluma_file_browser_widget_get_browser_store (data->widget);
-
+
pluma_file_browser_store_set_virtual_root_up (store);
}
@@ -501,12 +501,12 @@ message_set_show_hidden_cb (PlumaMessageBus *bus,
gboolean active = FALSE;
PlumaFileBrowserStore *store;
PlumaFileBrowserStoreFilterMode mode;
-
+
pluma_message_get (message, "active", &active, NULL);
-
+
store = pluma_file_browser_widget_get_browser_store (data->widget);
mode = pluma_file_browser_store_get_filter_mode (store);
-
+
if (active)
mode &= ~PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
else
@@ -523,12 +523,12 @@ message_set_show_binary_cb (PlumaMessageBus *bus,
gboolean active = FALSE;
PlumaFileBrowserStore *store;
PlumaFileBrowserStoreFilterMode mode;
-
+
pluma_message_get (message, "active", &active, NULL);
-
+
store = pluma_file_browser_widget_get_browser_store (data->widget);
mode = pluma_file_browser_store_get_filter_mode (store);
-
+
if (active)
mode &= ~PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
else
@@ -563,12 +563,12 @@ message_add_context_item_cb (PlumaMessageBus *bus,
gchar *name;
GtkUIManager *manager;
guint merge_id;
-
- pluma_message_get (message,
- "action", &action,
- "path", &path,
+
+ pluma_message_get (message,
+ "action", &action,
+ "path", &path,
NULL);
-
+
if (!action || !path)
{
if (action)
@@ -577,20 +577,20 @@ message_add_context_item_cb (PlumaMessageBus *bus,
g_free (path);
return;
}
-
+
gtk_action_group_add_action (data->merged_actions, action);
manager = pluma_file_browser_widget_get_ui_manager (data->widget);
name = g_strconcat (gtk_action_get_name (action), "MenuItem", NULL);
merge_id = gtk_ui_manager_new_merge_id (manager);
-
- gtk_ui_manager_add_ui (manager,
+
+ gtk_ui_manager_add_ui (manager,
merge_id,
path,
name,
gtk_action_get_name (action),
GTK_UI_MANAGER_AUTO,
FALSE);
-
+
if (gtk_ui_manager_get_widget (manager, path))
{
data->merge_ids = g_list_prepend (data->merge_ids, GINT_TO_POINTER (merge_id));
@@ -600,7 +600,7 @@ message_add_context_item_cb (PlumaMessageBus *bus,
{
pluma_message_set (message, "id", 0, NULL);
}
-
+
g_object_unref (action);
g_free (path);
g_free (name);
@@ -613,14 +613,14 @@ message_remove_context_item_cb (PlumaMessageBus *bus,
{
guint merge_id = 0;
GtkUIManager *manager;
-
+
pluma_message_get (message, "id", &merge_id, NULL);
-
+
if (merge_id == 0)
return;
-
+
manager = pluma_file_browser_widget_get_ui_manager (data->widget);
-
+
data->merge_ids = g_list_remove (data->merge_ids, GINT_TO_POINTER (merge_id));
gtk_ui_manager_remove_ui (manager, merge_id);
}
@@ -644,26 +644,26 @@ register_methods (PlumaWindow *window,
WindowData *data = get_window_data (window);
/* Register method calls */
- pluma_message_bus_register (bus,
- MESSAGE_OBJECT_PATH, "get_root",
+ pluma_message_bus_register (bus,
+ MESSAGE_OBJECT_PATH, "get_root",
1,
"uri", G_TYPE_STRING,
NULL);
-
- pluma_message_bus_register (bus,
- MESSAGE_OBJECT_PATH, "set_root",
- 1,
+
+ pluma_message_bus_register (bus,
+ MESSAGE_OBJECT_PATH, "set_root",
+ 1,
"uri", G_TYPE_STRING,
"virtual", G_TYPE_STRING,
NULL);
-
+
pluma_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "set_emblem",
0,
"id", G_TYPE_STRING,
"emblem", G_TYPE_STRING,
NULL);
-
+
pluma_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "add_filter",
1,
@@ -671,13 +671,13 @@ register_methods (PlumaWindow *window,
"method", G_TYPE_STRING,
"id", G_TYPE_ULONG,
NULL);
-
+
pluma_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "remove_filter",
0,
"id", G_TYPE_ULONG,
NULL);
-
+
pluma_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "add_context_item",
1,
@@ -691,22 +691,22 @@ register_methods (PlumaWindow *window,
0,
"id", G_TYPE_UINT,
NULL);
-
+
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "up", 0, NULL);
-
+
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_back", 0, NULL);
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_forward", 0, NULL);
-
+
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "refresh", 0, NULL);
- pluma_message_bus_register (bus,
- MESSAGE_OBJECT_PATH, "set_show_hidden",
- 0,
+ pluma_message_bus_register (bus,
+ MESSAGE_OBJECT_PATH, "set_show_hidden",
+ 0,
"active", G_TYPE_BOOLEAN,
NULL);
- pluma_message_bus_register (bus,
+ pluma_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "set_show_binary",
- 0,
+ 0,
"active", G_TYPE_BOOLEAN,
NULL);
@@ -733,10 +733,10 @@ register_methods (PlumaWindow *window,
BUS_CONNECT (bus, history_forward, data);
BUS_CONNECT (bus, refresh, data);
-
+
BUS_CONNECT (bus, set_show_hidden, data);
BUS_CONNECT (bus, set_show_binary, data);
-
+
BUS_CONNECT (bus, show_bookmarks, data);
BUS_CONNECT (bus, show_files, data);
@@ -752,19 +752,19 @@ store_row_inserted (PlumaFileBrowserStore *store,
gchar *uri = NULL;
guint flags = 0;
- gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
+ gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
-
+
if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags))
{
WindowData *wdata = get_window_data (data->window);
-
+
set_item_message (wdata, iter, path, data->message);
pluma_message_bus_send_message_sync (wdata->bus, data->message);
}
-
+
g_free (uri);
}
@@ -776,23 +776,23 @@ store_row_deleted (PlumaFileBrowserStore *store,
GtkTreeIter iter;
gchar *uri = NULL;
guint flags = 0;
-
+
if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path))
return;
-
- gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
+
+ gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
-
+
if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags))
{
WindowData *wdata = get_window_data (data->window);
-
+
set_item_message (wdata, &iter, path, data->message);
pluma_message_bus_send_message_sync (wdata->bus, data->message);
}
-
+
g_free (uri);
}
@@ -803,18 +803,18 @@ store_virtual_root_changed (PlumaFileBrowserStore *store,
{
WindowData *wdata = get_window_data (data->window);
gchar *uri;
-
+
uri = pluma_file_browser_store_get_virtual_root (store);
-
+
if (!uri)
return;
-
+
pluma_message_set (data->message,
"uri", uri,
NULL);
-
+
pluma_message_bus_send_message_sync (wdata->bus, data->message);
-
+
g_free (uri);
}
@@ -825,11 +825,11 @@ store_begin_loading (PlumaFileBrowserStore *store,
{
GtkTreePath *path;
WindowData *wdata = get_window_data (data->window);
-
+
path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), iter);
-
+
set_item_message (wdata, iter, path, data->message);
-
+
pluma_message_bus_send_message_sync (wdata->bus, data->message);
gtk_tree_path_free (path);
}
@@ -841,15 +841,15 @@ store_end_loading (PlumaFileBrowserStore *store,
{
GtkTreePath *path;
WindowData *wdata = get_window_data (data->window);
-
+
path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), iter);
-
+
set_item_message (wdata, iter, path, data->message);
-
+
pluma_message_bus_send_message_sync (wdata->bus, data->message);
gtk_tree_path_free (path);
}
-
+
static void
register_signals (PlumaWindow *window,
PlumaFileBrowserWidget *widget)
@@ -861,7 +861,7 @@ register_signals (PlumaWindow *window,
PlumaMessageType *begin_loading_type;
PlumaMessageType *end_loading_type;
PlumaMessageType *root_changed_type;
-
+
PlumaMessage *message;
WindowData *data;
@@ -872,7 +872,7 @@ register_signals (PlumaWindow *window,
"id", G_TYPE_STRING,
"uri", G_TYPE_STRING,
NULL);
-
+
begin_loading_type = pluma_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "begin_loading",
0,
@@ -904,41 +904,41 @@ register_signals (PlumaWindow *window,
NULL);
store = pluma_file_browser_widget_get_browser_store (widget);
-
- message = pluma_message_type_instantiate (inserted_type,
+
+ message = pluma_message_type_instantiate (inserted_type,
"id", NULL,
- "uri", NULL,
- "is_directory", FALSE,
+ "uri", NULL,
+ "is_directory", FALSE,
NULL);
data = get_window_data (window);
- data->row_inserted_id =
- g_signal_connect_data (store,
- "row-inserted",
- G_CALLBACK (store_row_inserted),
+ data->row_inserted_id =
+ g_signal_connect_data (store,
+ "row-inserted",
+ G_CALLBACK (store_row_inserted),
message_cache_data_new (window, message),
(GClosureNotify)message_cache_data_free,
0);
- message = pluma_message_type_instantiate (deleted_type,
- "id", NULL,
+ message = pluma_message_type_instantiate (deleted_type,
+ "id", NULL,
"uri", NULL,
- "is_directory", FALSE,
+ "is_directory", FALSE,
NULL);
- data->row_deleted_id =
- g_signal_connect_data (store,
- "row-deleted",
- G_CALLBACK (store_row_deleted),
+ data->row_deleted_id =
+ g_signal_connect_data (store,
+ "row-deleted",
+ G_CALLBACK (store_row_deleted),
message_cache_data_new (window, message),
(GClosureNotify)message_cache_data_free,
0);
-
+
message = pluma_message_type_instantiate (root_changed_type,
"id", NULL,
"uri", NULL,
NULL);
- data->root_changed_id =
+ data->root_changed_id =
g_signal_connect_data (store,
"notify::virtual-root",
G_CALLBACK (store_virtual_root_changed),
@@ -949,8 +949,8 @@ register_signals (PlumaWindow *window,
message = pluma_message_type_instantiate (begin_loading_type,
"id", NULL,
"uri", NULL,
- NULL);
- data->begin_loading_id =
+ NULL);
+ data->begin_loading_id =
g_signal_connect_data (store,
"begin_loading",
G_CALLBACK (store_begin_loading),
@@ -962,7 +962,7 @@ register_signals (PlumaWindow *window,
"id", NULL,
"uri", NULL,
NULL);
- data->end_loading_id =
+ data->end_loading_id =
g_signal_connect_data (store,
"end_loading",
G_CALLBACK (store_end_loading),
@@ -980,28 +980,28 @@ message_unregistered (PlumaMessageBus *bus,
pluma_message_type_get_method (message_type));
FilterData *data;
WindowData *wdata = get_window_data (window);
-
+
data = g_hash_table_lookup (wdata->filters, identifier);
-
+
if (data)
pluma_file_browser_widget_remove_filter (wdata->widget, data->id);
-
+
g_free (identifier);
}
-void
-pluma_file_browser_messages_register (PlumaWindow *window,
+void
+pluma_file_browser_messages_register (PlumaWindow *window,
PlumaFileBrowserWidget *widget)
{
window_data_new (window, widget);
-
+
register_methods (window, widget);
register_signals (window, widget);
-
+
g_signal_connect (pluma_window_get_message_bus (window),
"unregistered",
G_CALLBACK (message_unregistered),
- window);
+ window);
}
static void
@@ -1009,15 +1009,15 @@ cleanup_signals (PlumaWindow *window)
{
WindowData *data = get_window_data (window);
PlumaFileBrowserStore *store;
-
+
store = pluma_file_browser_widget_get_browser_store (data->widget);
-
+
g_signal_handler_disconnect (store, data->row_inserted_id);
g_signal_handler_disconnect (store, data->row_deleted_id);
g_signal_handler_disconnect (store, data->root_changed_id);
g_signal_handler_disconnect (store, data->begin_loading_id);
g_signal_handler_disconnect (store, data->end_loading_id);
-
+
g_signal_handlers_disconnect_by_func (data->bus, message_unregistered, window);
}
@@ -1025,7 +1025,7 @@ void
pluma_file_browser_messages_unregister (PlumaWindow *window)
{
PlumaMessageBus *bus = pluma_window_get_message_bus (window);
-
+
cleanup_signals (window);
pluma_message_bus_unregister_all (bus, MESSAGE_OBJECT_PATH);
diff --git a/plugins/filebrowser/pluma-file-browser-messages.h b/plugins/filebrowser/pluma-file-browser-messages.h
index 17b54f38..89598446 100644
--- a/plugins/filebrowser/pluma-file-browser-messages.h
+++ b/plugins/filebrowser/pluma-file-browser-messages.h
@@ -1,5 +1,5 @@
/*
- * pluma-file-browser-messages.h - Pluma plugin providing easy file access
+ * pluma-file-browser-messages.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2008 - Jesse van den Kieboom <[email protected]>
diff --git a/plugins/filebrowser/pluma-file-browser-plugin.h b/plugins/filebrowser/pluma-file-browser-plugin.h
index 89324c91..2c5026fc 100644
--- a/plugins/filebrowser/pluma-file-browser-plugin.h
+++ b/plugins/filebrowser/pluma-file-browser-plugin.h
@@ -1,5 +1,5 @@
/*
- * pluma-file-browser-plugin.h - Pluma plugin providing easy file access
+ * pluma-file-browser-plugin.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <[email protected]>
@@ -44,7 +44,7 @@ typedef struct _PlumaFileBrowserPluginPrivate PlumaFileBrowserPluginPrivate;
typedef struct _PlumaFileBrowserPlugin PlumaFileBrowserPlugin;
typedef struct _PlumaFileBrowserPluginClass PlumaFileBrowserPluginClass;
-struct _PlumaFileBrowserPlugin
+struct _PlumaFileBrowserPlugin
{
PeasExtensionBase parent_instance;
@@ -52,7 +52,7 @@ struct _PlumaFileBrowserPlugin
PlumaFileBrowserPluginPrivate *priv;
};
-struct _PlumaFileBrowserPluginClass
+struct _PlumaFileBrowserPluginClass
{
PeasExtensionBaseClass parent_class;
};
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)) {
diff --git a/plugins/filebrowser/pluma-file-browser-store.h b/plugins/filebrowser/pluma-file-browser-store.h
index da889dbd..362df820 100644
--- a/plugins/filebrowser/pluma-file-browser-store.h
+++ b/plugins/filebrowser/pluma-file-browser-store.h
@@ -1,5 +1,5 @@
/*
- * pluma-file-browser-store.h - Pluma plugin providing easy file access
+ * pluma-file-browser-store.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <[email protected]>
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
#define PLUMA_IS_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_FILE_BROWSER_STORE))
#define PLUMA_FILE_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_FILE_BROWSER_STORE, PlumaFileBrowserStoreClass))
-typedef enum
+typedef enum
{
PLUMA_FILE_BROWSER_STORE_COLUMN_ICON = 0,
PLUMA_FILE_BROWSER_STORE_COLUMN_NAME,
@@ -43,7 +43,7 @@ typedef enum
PLUMA_FILE_BROWSER_STORE_COLUMN_NUM
} PlumaFileBrowserStoreColumn;
-typedef enum
+typedef enum
{
PLUMA_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY = 1 << 0,
PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN = 1 << 1,
@@ -53,7 +53,7 @@ typedef enum
PLUMA_FILE_BROWSER_STORE_FLAG_IS_DUMMY = 1 << 5
} PlumaFileBrowserStoreFlag;
-typedef enum
+typedef enum
{
PLUMA_FILE_BROWSER_STORE_RESULT_OK,
PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE,
@@ -63,7 +63,7 @@ typedef enum
PLUMA_FILE_BROWSER_STORE_RESULT_NUM
} PlumaFileBrowserStoreResult;
-typedef enum
+typedef enum
{
PLUMA_FILE_BROWSER_STORE_FILTER_MODE_NONE = 0,
PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN = 1 << 0,
@@ -86,7 +86,7 @@ typedef gboolean (*PlumaFileBrowserStoreFilterFunc) (PlumaFileBrowserStore
GtkTreeIter * iter,
gpointer user_data);
-struct _PlumaFileBrowserStore
+struct _PlumaFileBrowserStore
{
GObject parent;
@@ -101,7 +101,7 @@ struct _PlumaFileBrowserStoreClass {
GtkTreeIter * iter);
void (*end_loading) (PlumaFileBrowserStore * model,
GtkTreeIter * iter);
- void (*error) (PlumaFileBrowserStore * model,
+ void (*error) (PlumaFileBrowserStore * model,
guint code,
gchar * message);
gboolean (*no_trash) (PlumaFileBrowserStore * model,
@@ -131,7 +131,7 @@ PlumaFileBrowserStoreResult
pluma_file_browser_store_set_virtual_root (PlumaFileBrowserStore * model,
GtkTreeIter * iter);
PlumaFileBrowserStoreResult
-pluma_file_browser_store_set_virtual_root_from_string (PlumaFileBrowserStore * model,
+pluma_file_browser_store_set_virtual_root_from_string (PlumaFileBrowserStore * model,
gchar const *root);
PlumaFileBrowserStoreResult
pluma_file_browser_store_set_virtual_root_up (PlumaFileBrowserStore * model);
@@ -139,25 +139,25 @@ PlumaFileBrowserStoreResult
pluma_file_browser_store_set_virtual_root_top (PlumaFileBrowserStore * model);
gboolean
-pluma_file_browser_store_get_iter_virtual_root (PlumaFileBrowserStore * model,
+pluma_file_browser_store_get_iter_virtual_root (PlumaFileBrowserStore * model,
GtkTreeIter * iter);
gboolean pluma_file_browser_store_get_iter_root (PlumaFileBrowserStore * model,
GtkTreeIter * iter);
gchar * pluma_file_browser_store_get_root (PlumaFileBrowserStore * model);
gchar * pluma_file_browser_store_get_virtual_root (PlumaFileBrowserStore * model);
-gboolean pluma_file_browser_store_iter_equal (PlumaFileBrowserStore * model,
+gboolean pluma_file_browser_store_iter_equal (PlumaFileBrowserStore * model,
GtkTreeIter * iter1,
GtkTreeIter * iter2);
-void pluma_file_browser_store_set_value (PlumaFileBrowserStore * tree_model,
+void pluma_file_browser_store_set_value (PlumaFileBrowserStore * tree_model,
GtkTreeIter * iter,
- gint column,
+ gint column,
GValue * value);
-void _pluma_file_browser_store_iter_expanded (PlumaFileBrowserStore * model,
+void _pluma_file_browser_store_iter_expanded (PlumaFileBrowserStore * model,
GtkTreeIter * iter);
-void _pluma_file_browser_store_iter_collapsed (PlumaFileBrowserStore * model,
+void _pluma_file_browser_store_iter_collapsed (PlumaFileBrowserStore * model,
GtkTreeIter * iter);
PlumaFileBrowserStoreFilterMode
@@ -165,7 +165,7 @@ pluma_file_browser_store_get_filter_mode (PlumaFileBrowserStore * m
void pluma_file_browser_store_set_filter_mode (PlumaFileBrowserStore * model,
PlumaFileBrowserStoreFilterMode mode);
void pluma_file_browser_store_set_filter_func (PlumaFileBrowserStore * model,
- PlumaFileBrowserStoreFilterFunc func,
+ PlumaFileBrowserStoreFilterFunc func,
gpointer user_data);
void pluma_file_browser_store_refilter (PlumaFileBrowserStore * model);
PlumaFileBrowserStoreFilterMode
@@ -178,11 +178,11 @@ gboolean pluma_file_browser_store_rename (PlumaFileBrowserStore * m
GError ** error);
PlumaFileBrowserStoreResult
pluma_file_browser_store_delete (PlumaFileBrowserStore * model,
- GtkTreeIter * iter,
+ GtkTreeIter * iter,
gboolean trash);
PlumaFileBrowserStoreResult
pluma_file_browser_store_delete_all (PlumaFileBrowserStore * model,
- GList *rows,
+ GList *rows,
gboolean trash);
gboolean pluma_file_browser_store_new_file (PlumaFileBrowserStore * model,
diff --git a/plugins/filebrowser/pluma-file-browser-utils.c b/plugins/filebrowser/pluma-file-browser-utils.c
index 8a2fbf64..1695a09a 100644
--- a/plugins/filebrowser/pluma-file-browser-utils.c
+++ b/plugins/filebrowser/pluma-file-browser-utils.c
@@ -1,5 +1,5 @@
/*
- * pluma-file-bookmarks-store.c - Pluma plugin providing easy file access
+ * pluma-file-bookmarks-store.c - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <[email protected]>
@@ -27,8 +27,8 @@
static GdkPixbuf *
process_icon_pixbuf (GdkPixbuf * pixbuf,
- gchar const * name,
- gint size,
+ gchar const * name,
+ gint size,
GError * error)
{
GdkPixbuf * scale;
@@ -39,11 +39,11 @@ process_icon_pixbuf (GdkPixbuf * pixbuf,
error->message);
g_error_free (error);
}
-
+
if (pixbuf && gdk_pixbuf_get_width (pixbuf) > size) {
- scale = gdk_pixbuf_scale_simple (pixbuf,
- size,
- size,
+ scale = gdk_pixbuf_scale_simple (pixbuf,
+ size,
+ size,
GDK_INTERP_BILINEAR);
g_object_unref (pixbuf);
pixbuf = scale;
@@ -62,10 +62,10 @@ pluma_file_browser_utils_pixbuf_from_theme (gchar const * name,
gtk_icon_size_lookup (size, &width, NULL);
- pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
- name,
- width,
- 0,
+ pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
+ name,
+ width,
+ 0,
&error);
pixbuf = process_icon_pixbuf (pixbuf, name, width, error);
@@ -87,7 +87,7 @@ pluma_file_browser_utils_pixbuf_from_icon (GIcon * icon,
theme = gtk_icon_theme_get_default ();
gtk_icon_size_lookup (size, &width, NULL);
-
+
info = gtk_icon_theme_lookup_by_gicon (theme,
icon,
width,
@@ -95,7 +95,7 @@ pluma_file_browser_utils_pixbuf_from_icon (GIcon * icon,
if (!info)
return NULL;
-
+
ret = gtk_icon_info_load_icon (info, NULL);
g_object_unref (info);
@@ -110,12 +110,12 @@ pluma_file_browser_utils_pixbuf_from_file (GFile * file,
GFileInfo * info;
GdkPixbuf * ret = NULL;
- info = g_file_query_info (file,
- G_FILE_ATTRIBUTE_STANDARD_ICON,
+ info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_STANDARD_ICON,
G_FILE_QUERY_INFO_NONE,
- NULL,
+ NULL,
NULL);
-
+
if (!info)
return NULL;
@@ -124,7 +124,7 @@ pluma_file_browser_utils_pixbuf_from_file (GFile * file,
ret = pluma_file_browser_utils_pixbuf_from_icon (icon, size);
g_object_unref (info);
-
+
return ret;
}
@@ -133,11 +133,11 @@ pluma_file_browser_utils_file_basename (GFile * file)
{
gchar *uri;
gchar *ret;
-
+
uri = g_file_get_uri (file);
ret = pluma_file_browser_utils_uri_basename (uri);
g_free (uri);
-
+
return ret;
}
@@ -181,13 +181,13 @@ pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
/* Add delete button */
button = gtk_button_new_with_mnemonic (_("_Delete"));
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name ("edit-delete", GTK_ICON_SIZE_BUTTON));
-
+
gtk_widget_show (button);
gtk_widget_set_can_default (button, TRUE);
gtk_dialog_add_action_widget (GTK_DIALOG (dlg),
button,
GTK_RESPONSE_OK);
-
+
ret = gtk_dialog_run (GTK_DIALOG (dlg));
gtk_widget_destroy (dlg);
diff --git a/plugins/filebrowser/pluma-file-browser-view.c b/plugins/filebrowser/pluma-file-browser-view.c
index 134bf922..1b97aaf9 100644
--- a/plugins/filebrowser/pluma-file-browser-view.c
+++ b/plugins/filebrowser/pluma-file-browser-view.c
@@ -1,5 +1,5 @@
/*
- * pluma-file-browser-view.c - Pluma plugin providing easy file access
+ * pluma-file-browser-view.c - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <[email protected]>
@@ -34,7 +34,7 @@
G_TYPE_INSTANCE_GET_PRIVATE((object), \
PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserViewPrivate))
-struct _PlumaFileBrowserViewPrivate
+struct _PlumaFileBrowserViewPrivate
{
GtkTreeViewColumn *column;
GtkCellRenderer *pixbuf_renderer;
@@ -54,7 +54,7 @@ struct _PlumaFileBrowserViewPrivate
gboolean selected_on_button_down;
gint drag_button;
gboolean drag_started;
-
+
gboolean restore_expand_state;
gboolean is_refresh;
GHashTable * expand_state;
@@ -64,7 +64,7 @@ struct _PlumaFileBrowserViewPrivate
enum
{
PROP_0,
-
+
PROP_CLICK_POLICY,
PROP_RESTORE_EXPAND_STATE
};
@@ -88,30 +88,30 @@ static const GtkTargetEntry drag_source_targets[] = {
G_DEFINE_DYNAMIC_TYPE (PlumaFileBrowserView, pluma_file_browser_view,
GTK_TYPE_TREE_VIEW)
-static void on_cell_edited (GtkCellRendererText * cell,
+static void on_cell_edited (GtkCellRendererText * cell,
gchar * path,
gchar * new_text,
PlumaFileBrowserView * tree_view);
-static void on_begin_refresh (PlumaFileBrowserStore * model,
+static void on_begin_refresh (PlumaFileBrowserStore * model,
PlumaFileBrowserView * view);
-static void on_end_refresh (PlumaFileBrowserStore * model,
+static void on_end_refresh (PlumaFileBrowserStore * model,
PlumaFileBrowserView * view);
-static void on_unload (PlumaFileBrowserStore * model,
+static void on_unload (PlumaFileBrowserStore * model,
gchar const * uri,
PlumaFileBrowserView * view);
-static void on_row_inserted (PlumaFileBrowserStore * model,
+static void on_row_inserted (PlumaFileBrowserStore * model,
GtkTreePath * path,
GtkTreeIter * iter,
PlumaFileBrowserView * view);
-
+
static void
pluma_file_browser_view_finalize (GObject * object)
{
PlumaFileBrowserView *obj = PLUMA_FILE_BROWSER_VIEW(object);
-
+
if (obj->priv->hand_cursor)
g_object_unref (obj->priv->hand_cursor);
@@ -135,12 +135,12 @@ add_expand_state (PlumaFileBrowserView * view,
gchar const * uri)
{
GFile * file;
-
+
if (!uri)
return;
file = g_file_new_for_uri (uri);
-
+
if (view->priv->expand_state)
g_hash_table_insert (view->priv->expand_state, file, file);
else
@@ -152,12 +152,12 @@ remove_expand_state (PlumaFileBrowserView * view,
gchar const * uri)
{
GFile * file;
-
+
if (!uri)
return;
file = g_file_new_for_uri (uri);
-
+
if (view->priv->expand_state)
g_hash_table_remove (view->priv->expand_state, file);
@@ -181,7 +181,7 @@ row_expanded (GtkTreeView * tree_view,
if (view->priv->restore_expand_state)
{
gtk_tree_model_get (view->priv->model,
- iter,
+ iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
&uri,
-1);
@@ -207,11 +207,11 @@ row_collapsed (GtkTreeView * tree_view,
if (!PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
return;
-
+
if (view->priv->restore_expand_state)
{
- gtk_tree_model_get (view->priv->model,
- iter,
+ gtk_tree_model_get (view->priv->model,
+ iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
&uri,
-1);
@@ -290,7 +290,7 @@ motion_notify_event (GtkWidget * widget,
if (old_hover_path != NULL)
gtk_tree_path_free (old_hover_path);
}
-
+
// Chainup
return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->motion_notify_event (widget, event);
}
@@ -324,7 +324,7 @@ set_click_policy_property (PlumaFileBrowserView *obj,
if (gtk_widget_get_realized (GTK_WIDGET (obj))) {
win = gtk_widget_get_window (GTK_WIDGET (obj));
gdk_window_set_cursor (win, NULL);
-
+
display = gtk_widget_get_display (GTK_WIDGET (obj));
if (display != NULL)
@@ -339,7 +339,7 @@ set_click_policy_property (PlumaFileBrowserView *obj,
}
static void
-directory_activated (PlumaFileBrowserView *view,
+directory_activated (PlumaFileBrowserView *view,
GtkTreeIter *iter)
{
pluma_file_browser_store_set_virtual_root (PLUMA_FILE_BROWSER_STORE (view->priv->model), iter);
@@ -356,30 +356,30 @@ activate_selected_files (PlumaFileBrowserView *view) {
PlumaFileBrowserStoreFlag flags;
rows = gtk_tree_selection_get_selected_rows (selection, &view->priv->model);
-
+
for (row = rows; row; row = row->next) {
path = (GtkTreePath *)(row->data);
-
+
/* Get iter from path */
if (!gtk_tree_model_get_iter (view->priv->model, &iter, path))
continue;
-
+
gtk_tree_model_get (view->priv->model, &iter, PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1);
if (FILE_IS_DIR (flags)) {
if (directory == NULL)
directory = path;
-
+
} else if (!FILE_IS_DUMMY (flags)) {
g_signal_emit (view, signals[FILE_ACTIVATED], 0, &iter);
}
}
-
+
if (directory != NULL) {
if (gtk_tree_model_get_iter (view->priv->model, &iter, directory))
g_signal_emit (view, signals[DIRECTORY_ACTIVATED], 0, &iter);
}
-
+
g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
g_list_free (rows);
}
@@ -429,10 +429,10 @@ drag_begin (GtkWidget *widget,
GdkDragContext *context)
{
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget);
-
+
view->priv->drag_button = 0;
view->priv->drag_started = TRUE;
-
+
/* Chain up */
GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->drag_begin (widget, context);
}
@@ -444,14 +444,14 @@ did_not_drag (PlumaFileBrowserView *view,
GtkTreeView *tree_view;
GtkTreeSelection *selection;
GtkTreePath *path;
-
+
tree_view = GTK_TREE_VIEW (view);
selection = gtk_tree_view_get_selection (tree_view);
if (gtk_tree_view_get_path_at_pos (tree_view, event->x, event->y,
&path, NULL, NULL, NULL)) {
if ((view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
- && !button_event_modifies_selection(event)
+ && !button_event_modifies_selection(event)
&& (event->button == 1 || event->button == 2)) {
/* Activate all selected items, and leave them selected */
activate_selected_items (view);
@@ -484,9 +484,9 @@ button_release_event (GtkWidget *widget,
!view->priv->ignore_release)
did_not_drag (view, event);
}
-
+
/* Chain up */
- return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->button_release_event (widget, event);
+ return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->button_release_event (widget, event);
}
static gboolean
@@ -512,7 +512,7 @@ button_press_event (GtkWidget *widget,
selection = gtk_tree_view_get_selection (tree_view);
/* Get double click time */
- g_object_get (G_OBJECT (gtk_widget_get_settings (widget)),
+ g_object_get (G_OBJECT (gtk_widget_get_settings (widget)),
"gtk-double-click-time", &double_click_time,
NULL);
@@ -521,11 +521,11 @@ button_press_event (GtkWidget *widget,
click_count++;
else
click_count = 0;
-
+
last_click_time = event->time;
/* Ignore double click if we are in single click mode */
- if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
+ if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
click_count >= 2) {
return TRUE;
}
@@ -537,7 +537,7 @@ button_press_event (GtkWidget *widget,
&path, NULL, NULL, NULL)) {
/* Keep track of path of last click so double clicks only happen
* on the same item */
- if ((event->button == 1 || event->button == 2) &&
+ if ((event->button == 1 || event->button == 2) &&
event->type == GDK_BUTTON_PRESS) {
if (view->priv->double_click_path[1])
gtk_tree_path_free (view->priv->double_click_path[1]);
@@ -550,7 +550,7 @@ button_press_event (GtkWidget *widget,
if (view->priv->double_click_path[1] &&
gtk_tree_path_compare (view->priv->double_click_path[0], view->priv->double_click_path[1]) == 0)
activate_selected_items (view);
-
+
/* Chain up */
widget_parent->button_press_event (widget, event);
} else {
@@ -586,14 +586,14 @@ button_press_event (GtkWidget *widget,
view->priv->ignore_release = on_expander;
}
}
-
+
if (call_parent) {
/* Chain up */
widget_parent->button_press_event (widget, event);
} else if (selected) {
gtk_widget_grab_focus (widget);
}
-
+
if ((event->button == 1 || event->button == 2) &&
event->type == GDK_BUTTON_PRESS) {
view->priv->drag_started = FALSE;
@@ -603,7 +603,7 @@ button_press_event (GtkWidget *widget,
gtk_tree_path_free (path);
} else {
- if ((event->button == 1 || event->button == 2) &&
+ if ((event->button == 1 || event->button == 2) &&
event->type == GDK_BUTTON_PRESS) {
if (view->priv->double_click_path[1])
gtk_tree_path_free (view->priv->double_click_path[1]);
@@ -669,7 +669,7 @@ key_press_event (GtkWidget *widget,
/* Chain up */
if (!handled)
return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->key_press_event (widget, event);
-
+
return TRUE;
}
@@ -679,31 +679,31 @@ fill_expand_state (PlumaFileBrowserView * view, GtkTreeIter * iter)
GtkTreePath * path;
GtkTreeIter child;
gchar * uri;
-
+
if (!gtk_tree_model_iter_has_child (view->priv->model, iter))
return;
-
+
path = gtk_tree_model_get_path (view->priv->model, iter);
-
+
if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), path))
{
- gtk_tree_model_get (view->priv->model,
- iter,
- PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
- &uri,
+ gtk_tree_model_get (view->priv->model,
+ iter,
+ PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
+ &uri,
-1);
add_expand_state (view, uri);
g_free (uri);
}
-
+
if (gtk_tree_model_iter_children (view->priv->model, &child, iter))
{
do {
fill_expand_state (view, &child);
} while (gtk_tree_model_iter_next (view->priv->model, &child));
}
-
+
gtk_tree_path_free (path);
}
@@ -711,20 +711,20 @@ static void
uninstall_restore_signals (PlumaFileBrowserView * tree_view,
GtkTreeModel * model)
{
- g_signal_handlers_disconnect_by_func (model,
- on_begin_refresh,
+ g_signal_handlers_disconnect_by_func (model,
+ on_begin_refresh,
tree_view);
-
- g_signal_handlers_disconnect_by_func (model,
- on_end_refresh,
+
+ g_signal_handlers_disconnect_by_func (model,
+ on_end_refresh,
tree_view);
-
- g_signal_handlers_disconnect_by_func (model,
- on_unload,
+
+ g_signal_handlers_disconnect_by_func (model,
+ on_unload,
tree_view);
- g_signal_handlers_disconnect_by_func (model,
- on_row_inserted,
+ g_signal_handlers_disconnect_by_func (model,
+ on_row_inserted,
tree_view);
}
@@ -732,24 +732,24 @@ static void
install_restore_signals (PlumaFileBrowserView * tree_view,
GtkTreeModel * model)
{
- g_signal_connect (model,
+ g_signal_connect (model,
"begin-refresh",
- G_CALLBACK (on_begin_refresh),
+ G_CALLBACK (on_begin_refresh),
tree_view);
- g_signal_connect (model,
+ g_signal_connect (model,
"end-refresh",
- G_CALLBACK (on_end_refresh),
+ G_CALLBACK (on_end_refresh),
tree_view);
- g_signal_connect (model,
+ g_signal_connect (model,
"unload",
- G_CALLBACK (on_unload),
+ G_CALLBACK (on_unload),
tree_view);
- g_signal_connect_after (model,
+ g_signal_connect_after (model,
"row-inserted",
- G_CALLBACK (on_row_inserted),
+ G_CALLBACK (on_row_inserted),
tree_view);
}
@@ -772,7 +772,7 @@ set_restore_expand_state (PlumaFileBrowserView * view,
(GEqualFunc)g_file_equal,
g_object_unref,
NULL);
-
+
if (view->priv->model && PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
{
fill_expand_state (view, NULL);
@@ -838,11 +838,11 @@ pluma_file_browser_view_class_init (PlumaFileBrowserViewClass * klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkTreeViewClass *tree_view_class = GTK_TREE_VIEW_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-
+
object_class->finalize = pluma_file_browser_view_finalize;
object_class->get_property = get_property;
object_class->set_property = set_property;
-
+
/* Event handlers */
widget_class->motion_notify_event = motion_notify_event;
widget_class->enter_notify_event = enter_notify_event;
@@ -855,7 +855,7 @@ pluma_file_browser_view_class_init (PlumaFileBrowserViewClass * klass)
/* Tree view handlers */
tree_view_class->row_expanded = row_expanded;
tree_view_class->row_collapsed = row_collapsed;
-
+
/* Default handlers */
klass->directory_activated = directory_activated;
@@ -929,18 +929,18 @@ cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell,
path = gtk_tree_model_get_path (tree_model, iter);
if (obj->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
- if (obj->priv->hover_path != NULL &&
+ if (obj->priv->hover_path != NULL &&
gtk_tree_path_compare (path, obj->priv->hover_path) == 0)
- underline = PANGO_UNDERLINE_SINGLE;
+ underline = PANGO_UNDERLINE_SINGLE;
}
if (PLUMA_IS_FILE_BROWSER_STORE (tree_model))
{
- if (obj->priv->editable != NULL &&
+ if (obj->priv->editable != NULL &&
gtk_tree_row_reference_valid (obj->priv->editable))
{
GtkTreePath *edpath = gtk_tree_row_reference_get_path (obj->priv->editable);
-
+
editable = edpath && gtk_tree_path_compare (path, edpath) == 0;
}
}
@@ -1028,7 +1028,7 @@ pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view,
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
if (PLUMA_IS_FILE_BOOKMARKS_STORE (model)) {
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
+ gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW
(tree_view),
bookmarks_separator_func,
@@ -1055,7 +1055,7 @@ pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view,
if (tree_view->priv->restore_expand_state)
install_restore_signals (tree_view, model);
-
+
}
if (tree_view->priv->hover_path != NULL) {
@@ -1065,7 +1065,7 @@ pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view,
if (PLUMA_IS_FILE_BROWSER_STORE (tree_view->priv->model)) {
if (tree_view->priv->restore_expand_state)
- uninstall_restore_signals (tree_view,
+ uninstall_restore_signals (tree_view,
tree_view->priv->model);
}
@@ -1098,18 +1098,18 @@ pluma_file_browser_view_start_rename (PlumaFileBrowserView * tree_view,
/* Start editing */
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
-
+
if (gtk_tree_path_up (path))
gtk_tree_view_expand_to_path (GTK_TREE_VIEW (tree_view),
path);
-
+
gtk_tree_path_free (path);
tree_view->priv->editable = rowref;
gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view),
gtk_tree_row_reference_get_path (tree_view->priv->editable),
tree_view->priv->column, TRUE);
-
+
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tree_view),
gtk_tree_row_reference_get_path (tree_view->priv->editable),
tree_view->priv->column,
@@ -1121,9 +1121,9 @@ pluma_file_browser_view_set_click_policy (PlumaFileBrowserView *tree_view,
PlumaFileBrowserViewClickPolicy policy)
{
g_return_if_fail (PLUMA_IS_FILE_BROWSER_VIEW (tree_view));
-
+
set_click_policy_property (tree_view, policy);
-
+
g_object_notify (G_OBJECT (tree_view), "click-policy");
}
@@ -1146,13 +1146,13 @@ on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text,
GtkTreeIter iter;
gboolean ret;
GError * error = NULL;
-
+
gtk_tree_row_reference_free (tree_view->priv->editable);
tree_view->priv->editable = NULL;
if (new_text == NULL || *new_text == '\0')
return;
-
+
treepath = gtk_tree_path_new_from_string (path);
ret = gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_view->priv->model), &iter, treepath);
gtk_tree_path_free (treepath);
@@ -1176,8 +1176,8 @@ on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text,
}
}
-static void
-on_begin_refresh (PlumaFileBrowserStore * model,
+static void
+on_begin_refresh (PlumaFileBrowserStore * model,
PlumaFileBrowserView * view)
{
/* Store the refresh state, so we can handle unloading of nodes while
@@ -1185,8 +1185,8 @@ on_begin_refresh (PlumaFileBrowserStore * model,
view->priv->is_refresh = TRUE;
}
-static void
-on_end_refresh (PlumaFileBrowserStore * model,
+static void
+on_end_refresh (PlumaFileBrowserStore * model,
PlumaFileBrowserView * view)
{
/* Store the refresh state, so we can handle unloading of nodes while
@@ -1195,14 +1195,14 @@ on_end_refresh (PlumaFileBrowserStore * model,
}
static void
-on_unload (PlumaFileBrowserStore * model,
+on_unload (PlumaFileBrowserStore * model,
gchar const * uri,
PlumaFileBrowserView * view)
{
/* Don't remove the expand state if we are refreshing */
if (!view->priv->restore_expand_state || view->priv->is_refresh)
return;
-
+
remove_expand_state (view, uri);
}
@@ -1215,10 +1215,10 @@ restore_expand_state (PlumaFileBrowserView * view,
GFile * file;
GtkTreePath * path;
- gtk_tree_model_get (GTK_TREE_MODEL (model),
- iter,
- PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
- &uri,
+ gtk_tree_model_get (GTK_TREE_MODEL (model),
+ iter,
+ PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
+ &uri,
-1);
if (!uri)
@@ -1233,15 +1233,15 @@ restore_expand_state (PlumaFileBrowserView * view,
path,
FALSE);
}
-
+
gtk_tree_path_free (path);
- g_object_unref (file);
+ g_object_unref (file);
g_free (uri);
}
-static void
-on_row_inserted (PlumaFileBrowserStore * model,
+static void
+on_row_inserted (PlumaFileBrowserStore * model,
GtkTreePath * path,
GtkTreeIter * iter,
PlumaFileBrowserView * view)
@@ -1269,5 +1269,5 @@ _pluma_file_browser_view_register_type (GTypeModule *type_module)
{
pluma_file_browser_view_register_type (type_module);
}
-
+
// ex:ts=8:noet:
diff --git a/plugins/filebrowser/pluma-file-browser-view.h b/plugins/filebrowser/pluma-file-browser-view.h
index 299d210c..2e92a50f 100644
--- a/plugins/filebrowser/pluma-file-browser-view.h
+++ b/plugins/filebrowser/pluma-file-browser-view.h
@@ -1,5 +1,5 @@
/*
- * pluma-file-browser-view.h - Pluma plugin providing easy file access
+ * pluma-file-browser-view.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <[email protected]>
@@ -39,22 +39,22 @@ typedef struct _PlumaFileBrowserViewPrivate PlumaFileBrowserViewPrivate;
typedef enum {
PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
- PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE
+ PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE
} PlumaFileBrowserViewClickPolicy;
-struct _PlumaFileBrowserView
+struct _PlumaFileBrowserView
{
GtkTreeView parent;
PlumaFileBrowserViewPrivate *priv;
};
-struct _PlumaFileBrowserViewClass
+struct _PlumaFileBrowserViewClass
{
GtkTreeViewClass parent_class;
/* Signals */
- void (*error) (PlumaFileBrowserView * filetree,
+ void (*error) (PlumaFileBrowserView * filetree,
guint code,
gchar const *message);
void (*file_activated) (PlumaFileBrowserView * filetree,
@@ -71,7 +71,7 @@ void _pluma_file_browser_view_register_type (GTypeModule * module);
GtkWidget *pluma_file_browser_view_new (void);
void pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view,
GtkTreeModel * model);
-void pluma_file_browser_view_start_rename (PlumaFileBrowserView * tree_view,
+void pluma_file_browser_view_start_rename (PlumaFileBrowserView * tree_view,
GtkTreeIter * iter);
void pluma_file_browser_view_set_click_policy (PlumaFileBrowserView * tree_view,
PlumaFileBrowserViewClickPolicy policy);
diff --git a/plugins/filebrowser/pluma-file-browser-widget.c b/plugins/filebrowser/pluma-file-browser-widget.c
index d8939ea8..367a575e 100644
--- a/plugins/filebrowser/pluma-file-browser-widget.c
+++ b/plugins/filebrowser/pluma-file-browser-widget.c
@@ -1,5 +1,5 @@
/*
- * pluma-file-browser-widget.c - Pluma plugin providing easy file access
+ * pluma-file-browser-widget.c - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <[email protected]>
@@ -49,7 +49,7 @@
#define XML_UI_FILE "pluma-file-browser-widget-ui.xml"
#define LOCATION_DATA_KEY "pluma-file-browser-widget-location"
-enum
+enum
{
BOOKMARKS_ID,
SEPARATOR_CUSTOM_ID,
@@ -58,7 +58,7 @@ enum
NUM_DEFAULT_IDS
};
-enum
+enum
{
COLUMN_INDENT,
COLUMN_ICON,
@@ -69,16 +69,16 @@ enum
};
/* Properties */
-enum
+enum
{
PROP_0,
-
+
PROP_FILTER_PATTERN,
PROP_ENABLE_DELETE
};
/* Signals */
-enum
+enum
{
URI_ACTIVATED,
ERROR,
@@ -89,7 +89,7 @@ enum
static guint signals[NUM_SIGNALS] = { 0 };
-typedef struct _SignalNode
+typedef struct _SignalNode
{
GObject *object;
gulong id;
@@ -103,7 +103,7 @@ typedef struct
GDestroyNotify destroy_notify;
} FilterFunc;
-typedef struct
+typedef struct
{
GFile *root;
GFile *virtual_root;
@@ -115,7 +115,7 @@ typedef struct
GdkPixbuf *icon;
} NameIcon;
-struct _PlumaFileBrowserWidgetPrivate
+struct _PlumaFileBrowserWidgetPrivate
{
PlumaFileBrowserView *treeview;
PlumaFileBrowserStore *file_store;
@@ -152,29 +152,29 @@ struct _PlumaFileBrowserWidgetPrivate
GtkWidget *location_previous_menu;
GtkWidget *location_next_menu;
GtkWidget *current_location_menu_item;
-
+
gboolean enable_delete;
-
+
GCancellable *cancellable;
-
+
GdkCursor *busy_cursor;
};
static void set_enable_delete (PlumaFileBrowserWidget *obj,
gboolean enable);
-static void on_model_set (GObject * gobject,
+static void on_model_set (GObject * gobject,
GParamSpec * arg1,
PlumaFileBrowserWidget * obj);
static void on_treeview_error (PlumaFileBrowserView * tree_view,
- guint code,
+ guint code,
gchar * message,
PlumaFileBrowserWidget * obj);
-static void on_file_store_error (PlumaFileBrowserStore * store,
+static void on_file_store_error (PlumaFileBrowserStore * store,
guint code,
gchar * message,
PlumaFileBrowserWidget * obj);
-static gboolean on_file_store_no_trash (PlumaFileBrowserStore * store,
- GList * files,
+static gboolean on_file_store_no_trash (PlumaFileBrowserStore * store,
+ GList * files,
PlumaFileBrowserWidget * obj);
static void on_combo_changed (GtkComboBox * combo,
PlumaFileBrowserWidget * obj);
@@ -183,7 +183,7 @@ static gboolean on_treeview_popup_menu (PlumaFileBrowserView * treeview,
static gboolean on_treeview_button_press_event (PlumaFileBrowserView * treeview,
GdkEventButton * event,
PlumaFileBrowserWidget * obj);
-static gboolean on_treeview_key_press_event (PlumaFileBrowserView * treeview,
+static gboolean on_treeview_key_press_event (PlumaFileBrowserView * treeview,
GdkEventKey * event,
PlumaFileBrowserWidget * obj);
static void on_selection_changed (GtkTreeSelection * selection,
@@ -196,11 +196,11 @@ static void on_virtual_root_changed (PlumaFileBrowserStore * model,
static gboolean on_entry_filter_activate (PlumaFileBrowserWidget * obj);
static void on_location_jump_activate (GtkMenuItem * item,
PlumaFileBrowserWidget * obj);
-static void on_bookmarks_row_changed (GtkTreeModel * model,
+static void on_bookmarks_row_changed (GtkTreeModel * model,
GtkTreePath * path,
GtkTreeIter * iter,
PlumaFileBrowserWidget * obj);
-static void on_bookmarks_row_deleted (GtkTreeModel * model,
+static void on_bookmarks_row_deleted (GtkTreeModel * model,
GtkTreePath * path,
PlumaFileBrowserWidget * obj);
static void on_filter_mode_changed (PlumaFileBrowserStore * model,
@@ -278,7 +278,7 @@ location_free (Location * loc)
{
if (loc->root)
g_object_unref (loc->root);
-
+
if (loc->virtual_root)
g_object_unref (loc->virtual_root);
@@ -322,7 +322,7 @@ cancel_async_operation (PlumaFileBrowserWidget *widget)
{
if (!widget->priv->cancellable)
return;
-
+
g_cancellable_cancel (widget->priv->cancellable);
g_object_unref (widget->priv->cancellable);
@@ -356,7 +356,7 @@ pluma_file_browser_widget_finalize (GObject * object)
g_list_free (obj->priv->locations);
g_hash_table_destroy (obj->priv->bookmarks_hash);
-
+
cancel_async_operation (obj);
g_object_unref (obj->priv->busy_cursor);
@@ -531,10 +531,10 @@ get_from_bookmark_file (PlumaFileBrowserWidget * obj, GFile * file,
NameIcon * item;
data = g_hash_table_lookup (obj->priv->bookmarks_hash, file);
-
+
if (data == NULL)
return FALSE;
-
+
item = (NameIcon *)data;
*name = g_strdup (item->name);
@@ -549,10 +549,10 @@ get_from_bookmark_file (PlumaFileBrowserWidget * obj, GFile * file,
}
static void
-insert_path_item (PlumaFileBrowserWidget * obj,
+insert_path_item (PlumaFileBrowserWidget * obj,
GFile * file,
- GtkTreeIter * after,
- GtkTreeIter * iter,
+ GtkTreeIter * after,
+ GtkTreeIter * iter,
guint indent)
{
gchar * unescape;
@@ -562,21 +562,21 @@ insert_path_item (PlumaFileBrowserWidget * obj,
if (!get_from_bookmark_file (obj, file, &unescape, &icon)) {
/* It's not a bookmark, fetch the name and the icon ourselves */
unescape = pluma_file_browser_utils_file_basename (file);
-
+
/* Get the icon */
icon = pluma_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU);
}
gtk_tree_store_insert_after (obj->priv->combo_model, iter, NULL,
after);
-
- gtk_tree_store_set (obj->priv->combo_model,
- iter,
+
+ gtk_tree_store_set (obj->priv->combo_model,
+ iter,
COLUMN_INDENT, indent,
- COLUMN_ICON, icon,
- COLUMN_NAME, unescape,
+ COLUMN_ICON, icon,
+ COLUMN_NAME, unescape,
COLUMN_FILE, file,
- COLUMN_ID, PATH_ID,
+ COLUMN_ID, PATH_ID,
-1);
if (icon)
@@ -618,15 +618,15 @@ uri_num_parents (GFile * from, GFile * to)
return 0;
g_object_ref (from);
-
+
while ((parent = g_file_get_parent (from)) && !(to && g_file_equal (from, to))) {
g_object_unref (from);
from = parent;
-
+
++parents;
}
-
- g_object_unref (from);
+
+ g_object_unref (from);
return parents;
}
@@ -639,7 +639,7 @@ insert_location_path (PlumaFileBrowserWidget * obj)
GtkTreeIter separator;
GtkTreeIter iter;
guint indent;
-
+
if (!obj->priv->current_location) {
g_message ("insert_location_path: no current location");
return;
@@ -649,7 +649,7 @@ insert_location_path (PlumaFileBrowserWidget * obj)
current = loc->virtual_root;
combo_find_by_id (obj, SEPARATOR_ID, &separator);
-
+
indent = uri_num_parents (loc->virtual_root, loc->root);
while (current != NULL) {
@@ -675,7 +675,7 @@ insert_location_path (PlumaFileBrowserWidget * obj)
}
tmp = g_file_get_parent (current);
-
+
if (current != loc->virtual_root)
g_object_unref (current);
@@ -723,22 +723,22 @@ fill_combo_model (PlumaFileBrowserWidget * obj)
}
static void
-indent_cell_data_func (GtkCellLayout * cell_layout,
+indent_cell_data_func (GtkCellLayout * cell_layout,
GtkCellRenderer * cell,
- GtkTreeModel * model,
- GtkTreeIter * iter,
+ GtkTreeModel * model,
+ GtkTreeIter * iter,
gpointer data)
{
gchar * indent;
guint num;
-
+
gtk_tree_model_get (model, iter, COLUMN_INDENT, &num, -1);
-
+
if (num == 0)
g_object_set (cell, "text", "", NULL);
else {
indent = g_strnfill (num * 2, ' ');
-
+
g_object_set (cell, "text", indent, NULL);
g_free (indent);
}
@@ -792,12 +792,12 @@ create_combo (PlumaFileBrowserWidget * obj)
gtk_widget_show (obj->priv->combo);
}
-static GtkActionEntry toplevel_actions[] =
+static GtkActionEntry toplevel_actions[] =
{
{"FilterMenuAction", NULL, N_("_Filter")}
};
-static const GtkActionEntry tree_actions_selection[] =
+static const GtkActionEntry tree_actions_selection[] =
{
{"FileMoveToTrash", "mate-stock-trash", N_("_Move to Trash"), NULL,
N_("Move selected file or folder to trash"),
@@ -829,14 +829,14 @@ static const GtkActionEntry tree_actions_single_most_selection[] =
N_("Add new empty file"), G_CALLBACK (on_action_file_new)}
};
-static const GtkActionEntry tree_actions_single_selection[] =
+static const GtkActionEntry tree_actions_single_selection[] =
{
{"FileRename", NULL, N_("_Rename"), NULL,
N_("Rename selected file or folder"),
G_CALLBACK (on_action_file_rename)}
};
-static const GtkActionEntry tree_actions_sensitive[] =
+static const GtkActionEntry tree_actions_sensitive[] =
{
{"DirectoryPrevious", "go-previous", N_("_Previous Location"),
NULL,
@@ -851,7 +851,7 @@ static const GtkActionEntry tree_actions_sensitive[] =
G_CALLBACK (on_action_directory_open)}
};
-static const GtkToggleActionEntry tree_actions_toggle[] =
+static const GtkToggleActionEntry tree_actions_toggle[] =
{
{"FilterHidden", "dialog-password",
N_("Show _Hidden"), NULL,
@@ -1036,24 +1036,24 @@ create_toolbar (PlumaFileBrowserWidget * obj,
gtk_box_pack_start (GTK_BOX (obj), toolbar, FALSE, FALSE, 0);
gtk_widget_show (toolbar);
-
+
set_enable_delete (obj, obj->priv->enable_delete);
}
-static void
+static void
set_enable_delete (PlumaFileBrowserWidget *obj,
gboolean enable)
{
GtkAction *action;
obj->priv->enable_delete = enable;
-
+
if (obj->priv->action_group_selection == NULL)
return;
-
+
action =
gtk_action_group_get_action (obj->priv->action_group_selection,
"FileDelete");
-
+
g_object_set (action, "visible", enable, "sensitive", enable, NULL);
}
@@ -1093,7 +1093,7 @@ add_bookmark_hash (PlumaFileBrowserWidget * obj,
if (uri == NULL)
return;
-
+
file = g_file_new_for_uri (uri);
g_free (uri);
@@ -1101,8 +1101,8 @@ add_bookmark_hash (PlumaFileBrowserWidget * obj,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_ICON,
&pixbuf,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME,
- &name, -1);
-
+ &name, -1);
+
item = g_new (NameIcon, 1);
item->name = name;
item->icon = pixbuf;
@@ -1119,14 +1119,14 @@ init_bookmarks_hash (PlumaFileBrowserWidget * obj)
GtkTreeModel *model;
model = GTK_TREE_MODEL (obj->priv->bookmarks_store);
-
+
if (!gtk_tree_model_get_iter_first (model, &iter))
return;
-
+
do {
add_bookmark_hash (obj, &iter);
} while (gtk_tree_model_iter_next (model, &iter));
-
+
g_signal_connect (obj->priv->bookmarks_store,
"row-changed",
G_CALLBACK (on_bookmarks_row_changed),
@@ -1139,7 +1139,7 @@ init_bookmarks_hash (PlumaFileBrowserWidget * obj)
}
static void
-on_begin_loading (PlumaFileBrowserStore *model,
+on_begin_loading (PlumaFileBrowserStore *model,
GtkTreeIter *iter,
PlumaFileBrowserWidget *obj)
{
@@ -1151,7 +1151,7 @@ on_begin_loading (PlumaFileBrowserStore *model,
}
static void
-on_end_loading (PlumaFileBrowserStore *model,
+on_end_loading (PlumaFileBrowserStore *model,
GtkTreeIter *iter,
PlumaFileBrowserWidget *obj)
{
@@ -1212,16 +1212,16 @@ create_tree (PlumaFileBrowserWidget * obj)
g_signal_connect (obj->priv->file_store, "notify::virtual-root",
G_CALLBACK (on_virtual_root_changed), obj);
-
+
g_signal_connect (obj->priv->file_store, "begin-loading",
G_CALLBACK (on_begin_loading), obj);
-
+
g_signal_connect (obj->priv->file_store, "end-loading",
G_CALLBACK (on_end_loading), obj);
g_signal_connect (obj->priv->file_store, "error",
G_CALLBACK (on_file_store_error), obj);
-
+
init_bookmarks_hash (obj);
gtk_widget_show (sw);
@@ -1275,7 +1275,7 @@ pluma_file_browser_widget_init (PlumaFileBrowserWidget * obj)
gtk_box_set_spacing (GTK_BOX (obj), 3);
gtk_orientable_set_orientation (GTK_ORIENTABLE (obj),
GTK_ORIENTATION_VERTICAL);
-
+
display = gtk_widget_get_display (GTK_WIDGET (obj));
obj->priv->busy_cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
}
@@ -1332,15 +1332,15 @@ pluma_file_browser_widget_get_first_selected (PlumaFileBrowserWidget *obj,
GtkTreeModel *model;
GList *rows = gtk_tree_selection_get_selected_rows (selection, &model);
gboolean result;
-
+
if (!rows)
return FALSE;
-
+
result = gtk_tree_model_get_iter(model, iter, (GtkTreePath *)(rows->data));
g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
g_list_free (rows);
-
+
return result;
}
@@ -1444,15 +1444,15 @@ get_deletable_files (PlumaFileBrowserWidget *obj) {
/* Get all selected files */
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview));
rows = gtk_tree_selection_get_selected_rows (selection, &model);
-
+
for (row = rows; row; row = row->next) {
path = (GtkTreePath *)(row->data);
-
+
if (!gtk_tree_model_get_iter (model, &iter, path))
continue;
-
- gtk_tree_model_get (model, &iter,
- PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS,
+
+ gtk_tree_model_get (model, &iter,
+ PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS,
&flags, -1);
if (FILE_IS_DUMMY (flags))
@@ -1460,10 +1460,10 @@ get_deletable_files (PlumaFileBrowserWidget *obj) {
paths = g_list_append (paths, gtk_tree_path_copy (path));
}
-
+
g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
g_list_free (rows);
-
+
return paths;
}
@@ -1479,7 +1479,7 @@ delete_selected_files (PlumaFileBrowserWidget * obj, gboolean trash)
if (!PLUMA_IS_FILE_BROWSER_STORE (model))
return FALSE;
-
+
rows = get_deletable_files (obj);
if (!rows)
@@ -1494,7 +1494,7 @@ delete_selected_files (PlumaFileBrowserWidget * obj, gboolean trash)
result = pluma_file_browser_store_delete_all (PLUMA_FILE_BROWSER_STORE (model),
rows, trash);
-
+
g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
g_list_free (rows);
@@ -1502,14 +1502,14 @@ delete_selected_files (PlumaFileBrowserWidget * obj, gboolean trash)
}
static gboolean
-on_file_store_no_trash (PlumaFileBrowserStore * store,
- GList * files,
+on_file_store_no_trash (PlumaFileBrowserStore * store,
+ GList * files,
PlumaFileBrowserWidget * obj)
{
gboolean confirm = FALSE;
-
+
g_signal_emit (obj, signals[CONFIRM_NO_TRASH], 0, files, &confirm);
-
+
return confirm;
}
@@ -1518,14 +1518,14 @@ get_topmost_file (GFile * file)
{
GFile * tmp;
GFile * current;
-
+
current = g_object_ref (file);
-
+
while ((tmp = g_file_get_parent (current)) != NULL) {
g_object_unref (current);
current = tmp;
}
-
+
return current;
}
@@ -1542,7 +1542,7 @@ create_goto_menu_item (PlumaFileBrowserWidget * obj, GList * item,
if (!get_from_bookmark_file (obj, loc->virtual_root, &unescape, &pixbuf)) {
unescape = pluma_file_browser_utils_file_basename (loc->virtual_root);
-
+
if (icon)
pixbuf = g_object_ref (icon);
}
@@ -1553,7 +1553,7 @@ create_goto_menu_item (PlumaFileBrowserWidget * obj, GList * item,
} else {
result = gtk_menu_item_new_with_label (unescape);
}
-
+
g_object_set_data (G_OBJECT (result), LOCATION_DATA_KEY, item);
g_signal_connect (result, "activate",
G_CALLBACK (on_location_jump_activate), obj);
@@ -1658,7 +1658,7 @@ jump_to_location (PlumaFileBrowserWidget * obj, GList * item,
/* Set the new root + virtual root */
root = g_file_get_uri (loc->root);
virtual_root = g_file_get_uri (loc->virtual_root);
-
+
pluma_file_browser_widget_set_root_and_virtual_root (obj,
root,
virtual_root);
@@ -1704,8 +1704,8 @@ clear_next_locations (PlumaFileBrowserWidget * obj)
}
static void
-update_filter_mode (PlumaFileBrowserWidget * obj,
- GtkAction * action,
+update_filter_mode (PlumaFileBrowserWidget * obj,
+ GtkAction * action,
PlumaFileBrowserStoreFilterMode mode)
{
gboolean active =
@@ -1744,8 +1744,8 @@ set_filter_pattern_real (PlumaFileBrowserWidget * obj,
if (pattern == NULL && obj->priv->filter_pattern_str == NULL)
return;
-
- if (pattern != NULL && obj->priv->filter_pattern_str != NULL &&
+
+ if (pattern != NULL && obj->priv->filter_pattern_str != NULL &&
strcmp (pattern, obj->priv->filter_pattern_str) == 0)
return;
@@ -1860,7 +1860,7 @@ pluma_file_browser_widget_set_root_and_virtual_root (PlumaFileBrowserWidget *obj
if (!virtual_root)
result =
- pluma_file_browser_store_set_root_and_virtual_root
+ pluma_file_browser_store_set_root_and_virtual_root
(obj->priv->file_store, root, root);
else
result =
@@ -1873,7 +1873,7 @@ pluma_file_browser_widget_set_root_and_virtual_root (PlumaFileBrowserWidget *obj
void
pluma_file_browser_widget_set_root (PlumaFileBrowserWidget * obj,
- gchar const *root,
+ gchar const *root,
gboolean virtual_root)
{
GFile *file;
@@ -1898,7 +1898,7 @@ pluma_file_browser_widget_set_root (PlumaFileBrowserWidget * obj,
(obj, str, root);
g_free (str);
-
+
g_object_unref (file);
g_object_unref (parent);
}
@@ -1935,7 +1935,7 @@ pluma_file_browser_widget_get_filter_entry (PlumaFileBrowserWidget * obj)
gulong
pluma_file_browser_widget_add_filter (PlumaFileBrowserWidget * obj,
- PlumaFileBrowserWidgetFilterFunc func,
+ PlumaFileBrowserWidgetFilterFunc func,
gpointer user_data,
GDestroyNotify notify)
{
@@ -1979,7 +1979,7 @@ pluma_file_browser_widget_remove_filter (PlumaFileBrowserWidget * obj,
}
}
-void
+void
pluma_file_browser_widget_set_filter_pattern (PlumaFileBrowserWidget * obj,
gchar const *pattern)
{
@@ -1987,7 +1987,7 @@ pluma_file_browser_widget_set_filter_pattern (PlumaFileBrowserWidget * obj,
}
gboolean
-pluma_file_browser_widget_get_selected_directory (PlumaFileBrowserWidget * obj,
+pluma_file_browser_widget_get_selected_directory (PlumaFileBrowserWidget * obj,
GtkTreeIter * iter)
{
GtkTreeModel *model =
@@ -2035,12 +2035,12 @@ pluma_file_browser_widget_get_num_selected_files_or_directories (PlumaFileBrowse
if (PLUMA_IS_FILE_BOOKMARKS_STORE (model))
return 0;
-
+
rows = gtk_tree_selection_get_selected_rows (selection, &model);
-
+
for (row = rows; row; row = row->next) {
path = (GtkTreePath *)(row->data);
-
+
/* Get iter from path */
if (!gtk_tree_model_get_iter (model, &iter, path))
continue;
@@ -2061,7 +2061,7 @@ pluma_file_browser_widget_get_num_selected_files_or_directories (PlumaFileBrowse
g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
g_list_free (rows);
-
+
return result;
}
@@ -2075,15 +2075,15 @@ static AsyncData *
async_data_new (PlumaFileBrowserWidget *widget)
{
AsyncData *ret;
-
+
ret = g_new (AsyncData, 1);
ret->widget = widget;
-
+
cancel_async_operation (widget);
widget->priv->cancellable = g_cancellable_new ();
-
+
ret->cancellable = g_object_ref (widget->priv->cancellable);
-
+
return ret;
}
@@ -2098,9 +2098,9 @@ static void
set_busy (PlumaFileBrowserWidget *obj, gboolean busy)
{
GdkWindow *window;
-
+
window = gtk_widget_get_window (GTK_WIDGET (obj->priv->treeview));
-
+
if (!GDK_IS_WINDOW (window))
return;
@@ -2129,31 +2129,31 @@ activate_mount (PlumaFileBrowserWidget *widget,
{
GFile *root;
gchar *uri;
-
+
if (!mount)
{
gchar *message;
gchar *name;
-
+
name = g_volume_get_name (volume);
message = g_strdup_printf (_("No mount object for mounted volume: %s"), name);
-
- g_signal_emit (widget,
- signals[ERROR],
- 0,
+
+ g_signal_emit (widget,
+ signals[ERROR],
+ 0,
PLUMA_FILE_BROWSER_ERROR_SET_ROOT,
message);
-
+
g_free (name);
g_free (message);
return;
}
-
+
root = g_mount_get_root (mount);
uri = g_file_get_uri (root);
-
+
pluma_file_browser_widget_set_root (widget, uri, FALSE);
-
+
g_free (uri);
g_object_unref (root);
}
@@ -2165,12 +2165,12 @@ try_activate_drive (PlumaFileBrowserWidget *widget,
GList *volumes;
GVolume *volume;
GMount *mount;
-
+
volumes = g_drive_get_volumes (drive);
-
+
volume = G_VOLUME (volumes->data);
mount = g_volume_get_mount (volume);
-
+
if (mount)
{
/* try set the root of the mount */
@@ -2182,7 +2182,7 @@ try_activate_drive (PlumaFileBrowserWidget *widget,
/* try to mount it then? */
try_mount_volume (widget, volume);
}
-
+
g_list_foreach (volumes, (GFunc)g_object_unref, NULL);
g_list_free (volumes);
}
@@ -2200,11 +2200,11 @@ poll_for_media_cb (GDrive *drive,
async_free (async);
return;
}
-
+
/* finish poll operation */
set_busy (async->widget, FALSE);
-
- if (g_drive_poll_for_media_finish (drive, res, &error) &&
+
+ if (g_drive_poll_for_media_finish (drive, res, &error) &&
g_drive_has_media (drive) &&
g_drive_has_volumes (drive))
{
@@ -2214,22 +2214,22 @@ poll_for_media_cb (GDrive *drive,
{
gchar *message;
gchar *name;
-
+
name = g_drive_get_name (drive);
message = g_strdup_printf (_("Could not open media: %s"), name);
- g_signal_emit (async->widget,
- signals[ERROR],
- 0,
+ g_signal_emit (async->widget,
+ signals[ERROR],
+ 0,
PLUMA_FILE_BROWSER_ERROR_SET_ROOT,
message);
g_free (name);
g_free (message);
-
+
g_error_free (error);
}
-
+
async_free (async);
}
@@ -2246,14 +2246,14 @@ mount_volume_cb (GVolume *volume,
async_free (async);
return;
}
-
+
if (g_volume_mount_finish (volume, res, &error))
{
GMount *mount;
-
+
mount = g_volume_get_mount (volume);
activate_mount (async->widget, volume, mount);
-
+
if (mount)
g_object_unref (mount);
}
@@ -2261,22 +2261,22 @@ mount_volume_cb (GVolume *volume,
{
gchar *message;
gchar *name;
-
+
name = g_volume_get_name (volume);
message = g_strdup_printf (_("Could not mount volume: %s"), name);
- g_signal_emit (async->widget,
- signals[ERROR],
- 0,
+ g_signal_emit (async->widget,
+ signals[ERROR],
+ 0,
PLUMA_FILE_BROWSER_ERROR_SET_ROOT,
message);
g_free (name);
g_free (message);
-
+
g_error_free (error);
}
-
+
set_busy (async->widget, FALSE);
async_free (async);
}
@@ -2295,8 +2295,8 @@ activate_drive (PlumaFileBrowserWidget *obj,
/* most common use case is a floppy drive, we'll poll for media and
go from there */
async = async_data_new (obj);
- g_drive_poll_for_media (drive,
- async->cancellable,
+ g_drive_poll_for_media (drive,
+ async->cancellable,
(GAsyncReadyCallback)poll_for_media_cb,
async);
@@ -2304,8 +2304,8 @@ activate_drive (PlumaFileBrowserWidget *obj,
set_busy (obj, TRUE);
}
-static void
-try_mount_volume (PlumaFileBrowserWidget *widget,
+static void
+try_mount_volume (PlumaFileBrowserWidget *widget,
GVolume *volume)
{
GMountOperation *operation;
@@ -2313,14 +2313,14 @@ try_mount_volume (PlumaFileBrowserWidget *widget,
operation = gtk_mount_operation_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (widget))));
async = async_data_new (widget);
-
+
g_volume_mount (volume,
G_MOUNT_MOUNT_NONE,
operation,
async->cancellable,
(GAsyncReadyCallback)mount_volume_cb,
async);
-
+
g_object_unref (operation);
set_busy (widget, TRUE);
}
@@ -2330,17 +2330,17 @@ activate_volume (PlumaFileBrowserWidget *obj,
GtkTreeIter *iter)
{
GVolume *volume;
-
+
gtk_tree_model_get (GTK_TREE_MODEL (obj->priv->bookmarks_store), iter,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
&volume, -1);
/* see if we can mount the volume */
- try_mount_volume (obj, volume);
+ try_mount_volume (obj, volume);
g_object_unref (volume);
}
-void
+void
pluma_file_browser_widget_refresh (PlumaFileBrowserWidget *obj)
{
GtkTreeModel *model =
@@ -2358,7 +2358,7 @@ pluma_file_browser_widget_refresh (PlumaFileBrowserWidget *obj)
}
}
-void
+void
pluma_file_browser_widget_history_back (PlumaFileBrowserWidget *obj)
{
if (obj->priv->locations) {
@@ -2391,7 +2391,7 @@ bookmark_open (PlumaFileBrowserWidget *obj,
gtk_tree_model_get (model, iter,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
&flags, -1);
-
+
if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_DRIVE)
{
/* handle a drive node */
@@ -2498,7 +2498,7 @@ on_bookmark_activated (PlumaFileBrowserView *tree_view,
}
static void
-on_file_activated (PlumaFileBrowserView *tree_view,
+on_file_activated (PlumaFileBrowserView *tree_view,
GtkTreeIter *iter,
PlumaFileBrowserWidget *obj)
{
@@ -2508,18 +2508,18 @@ on_file_activated (PlumaFileBrowserView *tree_view,
}
static gboolean
-virtual_root_is_root (PlumaFileBrowserWidget * obj,
+virtual_root_is_root (PlumaFileBrowserWidget * obj,
PlumaFileBrowserStore * model)
{
GtkTreeIter root;
GtkTreeIter virtual_root;
-
+
if (!pluma_file_browser_store_get_iter_root (model, &root))
return TRUE;
-
+
if (!pluma_file_browser_store_get_iter_virtual_root (model, &virtual_root))
return TRUE;
-
+
return pluma_file_browser_store_iter_equal (model, &root, &virtual_root);
}
@@ -2597,12 +2597,12 @@ on_virtual_root_changed (PlumaFileBrowserStore * model,
g_object_unref (pixbuf);
}
-
+
action =
gtk_action_group_get_action (obj->priv->
action_group,
"DirectoryUp");
- gtk_action_set_sensitive (action,
+ gtk_action_set_sensitive (action,
!virtual_root_is_root (obj, model));
action =
@@ -2727,11 +2727,11 @@ on_combo_changed (GtkComboBox * combo, PlumaFileBrowserWidget * obj)
gtk_tree_model_get (GTK_TREE_MODEL
(obj->priv->combo_model), &iter,
COLUMN_FILE, &file, -1);
-
+
uri = g_file_get_uri (file);
pluma_file_browser_store_set_virtual_root_from_string
(obj->priv->file_store, uri);
-
+
g_free (uri);
g_object_unref (file);
break;
@@ -2764,13 +2764,13 @@ do_change_directory (PlumaFileBrowserWidget * obj,
{
GtkAction * action = NULL;
- if ((event->state &
- (~GDK_CONTROL_MASK & ~GDK_SHIFT_MASK & ~GDK_MOD1_MASK)) ==
+ if ((event->state &
+ (~GDK_CONTROL_MASK & ~GDK_SHIFT_MASK & ~GDK_MOD1_MASK)) ==
event->state && event->keyval == GDK_KEY_BackSpace)
action = gtk_action_group_get_action (obj->priv->
action_group_sensitive,
"DirectoryPrevious");
- else if (!((event->state & GDK_MOD1_MASK) &&
+ else if (!((event->state & GDK_MOD1_MASK) &&
(event->state & (~GDK_CONTROL_MASK & ~GDK_SHIFT_MASK)) == event->state))
return FALSE;
@@ -2793,12 +2793,12 @@ do_change_directory (PlumaFileBrowserWidget * obj,
default:
break;
}
-
+
if (action != NULL) {
gtk_action_activate (action);
return TRUE;
}
-
+
return FALSE;
}
@@ -2903,7 +2903,7 @@ on_location_jump_activate (GtkMenuItem * item,
}
static void
-on_bookmarks_row_changed (GtkTreeModel * model,
+on_bookmarks_row_changed (GtkTreeModel * model,
GtkTreePath * path,
GtkTreeIter * iter,
PlumaFileBrowserWidget *obj)
@@ -2912,19 +2912,19 @@ on_bookmarks_row_changed (GtkTreeModel * model,
}
static void
-on_bookmarks_row_deleted (GtkTreeModel * model,
+on_bookmarks_row_deleted (GtkTreeModel * model,
GtkTreePath * path,
PlumaFileBrowserWidget *obj)
{
GtkTreeIter iter;
gchar * uri;
GFile * file;
-
+
if (!gtk_tree_model_get_iter (model, &iter, path))
return;
uri = pluma_file_bookmarks_store_get_uri (obj->priv->bookmarks_store, &iter);
-
+
if (!uri)
return;
@@ -2935,7 +2935,7 @@ on_bookmarks_row_deleted (GtkTreeModel * model,
g_free (uri);
}
-static void
+static void
on_filter_mode_changed (PlumaFileBrowserStore * model,
GParamSpec * param,
PlumaFileBrowserWidget * obj)
@@ -2945,20 +2945,20 @@ on_filter_mode_changed (PlumaFileBrowserStore * model,
gboolean active;
mode = pluma_file_browser_store_get_filter_mode (model);
-
- action = GTK_TOGGLE_ACTION (gtk_action_group_get_action (obj->priv->action_group,
+
+ action = GTK_TOGGLE_ACTION (gtk_action_group_get_action (obj->priv->action_group,
"FilterHidden"));
active = !(mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN);
-
+
if (active != gtk_toggle_action_get_active (action))
gtk_toggle_action_set_active (action, active);
- action = GTK_TOGGLE_ACTION (gtk_action_group_get_action (obj->priv->action_group,
+ action = GTK_TOGGLE_ACTION (gtk_action_group_get_action (obj->priv->action_group,
"FilterBinary"));
active = !(mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY);
-
+
if (active != gtk_toggle_action_get_active (action))
- gtk_toggle_action_set_active (action, active);
+ gtk_toggle_action_set_active (action, active);
}
static void
@@ -2974,7 +2974,7 @@ on_action_directory_previous (GtkAction * action,
pluma_file_browser_widget_history_back (obj);
}
-static void
+static void
on_action_directory_up (GtkAction * action,
PlumaFileBrowserWidget * obj)
{
@@ -2984,8 +2984,8 @@ on_action_directory_up (GtkAction * action,
if (!PLUMA_IS_FILE_BROWSER_STORE (model))
return;
-
- pluma_file_browser_store_set_virtual_root_up (PLUMA_FILE_BROWSER_STORE (model));
+
+ pluma_file_browser_store_set_virtual_root_up (PLUMA_FILE_BROWSER_STORE (model));
}
static void
@@ -3021,7 +3021,7 @@ on_action_file_open (GtkAction * action, PlumaFileBrowserWidget * obj)
GtkTreePath *path;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview));
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview));
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview));
if (!PLUMA_IS_FILE_BROWSER_STORE (model))
return;
@@ -3099,22 +3099,22 @@ on_action_directory_open (GtkAction * action, PlumaFileBrowserWidget * obj)
GtkTreePath *path;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview));
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview));
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview));
if (!PLUMA_IS_FILE_BROWSER_STORE (model))
return;
rows = gtk_tree_selection_get_selected_rows (selection, &model);
-
+
for (row = rows; row; row = row->next) {
path = (GtkTreePath *)(row->data);
if (gtk_tree_model_get_iter (model, &iter, path))
directory_opened |= directory_open (obj, model, &iter);
-
+
gtk_tree_path_free (path);
}
-
+
if (!directory_opened) {
if (pluma_file_browser_widget_get_selected_directory (obj, &iter))
directory_open (obj, model, &iter);
@@ -3126,16 +3126,16 @@ on_action_directory_open (GtkAction * action, PlumaFileBrowserWidget * obj)
static void
on_action_filter_hidden (GtkAction * action, PlumaFileBrowserWidget * obj)
{
- update_filter_mode (obj,
- action,
+ update_filter_mode (obj,
+ action,
PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN);
}
static void
on_action_filter_binary (GtkAction * action, PlumaFileBrowserWidget * obj)
{
- update_filter_mode (obj,
- action,
+ update_filter_mode (obj,
+ action,
PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY);
}
diff --git a/plugins/filebrowser/pluma-file-browser-widget.h b/plugins/filebrowser/pluma-file-browser-widget.h
index 8af73381..7bb8cc79 100644
--- a/plugins/filebrowser/pluma-file-browser-widget.h
+++ b/plugins/filebrowser/pluma-file-browser-widget.h
@@ -1,5 +1,5 @@
/*
- * pluma-file-browser-widget.h - Pluma plugin providing easy file access
+ * pluma-file-browser-widget.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <[email protected]>
@@ -46,21 +46,21 @@ gboolean (*PlumaFileBrowserWidgetFilterFunc) (PlumaFileBrowserWidget * obj,
model, GtkTreeIter * iter,
gpointer user_data);
-struct _PlumaFileBrowserWidget
+struct _PlumaFileBrowserWidget
{
GtkBox parent;
PlumaFileBrowserWidgetPrivate *priv;
};
-struct _PlumaFileBrowserWidgetClass
+struct _PlumaFileBrowserWidgetClass
{
GtkBoxClass parent_class;
/* Signals */
void (*uri_activated) (PlumaFileBrowserWidget * widget,
gchar const *uri);
- void (*error) (PlumaFileBrowserWidget * widget,
+ void (*error) (PlumaFileBrowserWidget * widget,
guint code,
gchar const *message);
gboolean (*confirm_delete) (PlumaFileBrowserWidget * widget,
@@ -87,23 +87,23 @@ pluma_file_browser_widget_set_root_and_virtual_root (PlumaFileBrowserWidget * ob
gchar const *virtual_root);
gboolean
-pluma_file_browser_widget_get_selected_directory (PlumaFileBrowserWidget * obj,
+pluma_file_browser_widget_get_selected_directory (PlumaFileBrowserWidget * obj,
GtkTreeIter * iter);
-PlumaFileBrowserStore *
+PlumaFileBrowserStore *
pluma_file_browser_widget_get_browser_store (PlumaFileBrowserWidget * obj);
-PlumaFileBookmarksStore *
+PlumaFileBookmarksStore *
pluma_file_browser_widget_get_bookmarks_store (PlumaFileBrowserWidget * obj);
PlumaFileBrowserView *
pluma_file_browser_widget_get_browser_view (PlumaFileBrowserWidget * obj);
GtkWidget *
pluma_file_browser_widget_get_filter_entry (PlumaFileBrowserWidget * obj);
-GtkUIManager *
+GtkUIManager *
pluma_file_browser_widget_get_ui_manager (PlumaFileBrowserWidget * obj);
gulong pluma_file_browser_widget_add_filter (PlumaFileBrowserWidget * obj,
- PlumaFileBrowserWidgetFilterFunc func,
+ PlumaFileBrowserWidgetFilterFunc func,
gpointer user_data,
GDestroyNotify notify);
void pluma_file_browser_widget_remove_filter (PlumaFileBrowserWidget * obj,