[gedit] Bug 616964 - Update coding style again in file browser plugin
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Bug 616964 - Update coding style again in file browser plugin
- Date: Tue, 4 May 2010 06:50:01 +0000 (UTC)
commit 2cfb5f7a9a41c6e643dee8060549d4d7570cb591
Author: Garrett Regier <alias301 gmail com>
Date: Mon May 3 23:10:14 2010 -0700
Bug 616964 - Update coding style again in file browser plugin
plugins/filebrowser/gedit-file-bookmarks-store.c | 23 +++++--
plugins/filebrowser/gedit-file-browser-messages.c | 2 -
plugins/filebrowser/gedit-file-browser-plugin.c | 12 ++++
plugins/filebrowser/gedit-file-browser-store.c | 74 ++++++++++++++-------
plugins/filebrowser/gedit-file-browser-utils.c | 2 +
plugins/filebrowser/gedit-file-browser-view.c | 21 +++++-
plugins/filebrowser/gedit-file-browser-widget.c | 55 ++++++++++++++-
7 files changed, 150 insertions(+), 39 deletions(-)
---
diff --git a/plugins/filebrowser/gedit-file-bookmarks-store.c b/plugins/filebrowser/gedit-file-bookmarks-store.c
index 9f6b441..3abf764 100644
--- a/plugins/filebrowser/gedit-file-bookmarks-store.c
+++ b/plugins/filebrowser/gedit-file-bookmarks-store.c
@@ -143,9 +143,7 @@ add_file (GeditFileBookmarksStore *model,
native = g_file_is_native (file);
if (native && !g_file_query_exists (file, NULL))
- {
return FALSE;
- }
if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_HOME)
pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("user-home", GTK_ICON_SIZE_MENU);
@@ -188,16 +186,20 @@ check_mount_separator (GeditFileBookmarksStore *model,
found =
find_with_flags (GTK_TREE_MODEL (model), &iter, NULL,
- flags |
- GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, 0);
+ flags | GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR,
+ 0);
if (added && !found)
+ {
/* Add the separator */
add_node (model, NULL, NULL, NULL,
flags | GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR,
NULL);
+ }
else if (!added && found)
+ {
remove_node (GTK_TREE_MODEL (model), &iter);
+ }
}
static void
@@ -444,9 +446,11 @@ init_fs (GeditFileBookmarksStore *model)
/* Connect signals */
for (ptr = signals; *ptr; ptr++)
+ {
g_signal_connect (model->priv->volume_monitor,
*ptr,
G_CALLBACK (on_fs_changed), model);
+ }
}
/* First go through all the connected drives */
@@ -722,10 +726,12 @@ find_with_flags (GtkTreeModel *model,
g_object_unref (childobj);
if ((obj == NULL || fequal) &&
- (childflags & flags) == flags
- && !(childflags & notflags))
+ (childflags & flags) == flags &&
+ !(childflags & notflags))
+ {
*iter = child;
return TRUE;
+ }
}
while (gtk_tree_model_iter_next (model, &child));
@@ -743,9 +749,11 @@ remove_node (GtkTreeModel *model, GtkTreeIter *iter)
if (!(flags & GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR) &&
flags & GEDIT_FILE_BOOKMARKS_STORE_IS_FS)
+ {
check_mount_separator (GEDIT_FILE_BOOKMARKS_STORE (model),
flags & GEDIT_FILE_BOOKMARKS_STORE_IS_FS,
FALSE);
+ }
gtk_tree_store_remove (GTK_TREE_STORE (model), iter);
}
@@ -757,7 +765,8 @@ remove_bookmarks (GeditFileBookmarksStore *model)
while (find_with_flags (GTK_TREE_MODEL (model), &iter, NULL,
GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK,
- 0)) {
+ 0))
+ {
remove_node (GTK_TREE_MODEL (model), &iter);
}
}
diff --git a/plugins/filebrowser/gedit-file-browser-messages.c b/plugins/filebrowser/gedit-file-browser-messages.c
index 7364198..f48bdf1 100644
--- a/plugins/filebrowser/gedit-file-browser-messages.c
+++ b/plugins/filebrowser/gedit-file-browser-messages.c
@@ -388,9 +388,7 @@ custom_message_filter_func (GeditFileBrowserWidget *widget,
-1);
if (!location || FILE_IS_DUMMY (flags))
- {
return FALSE;
- }
path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), iter);
set_item_message (wdata, iter, path, data->message);
diff --git a/plugins/filebrowser/gedit-file-browser-plugin.c b/plugins/filebrowser/gedit-file-browser-plugin.c
index 77d5e3a..9a0754e 100644
--- a/plugins/filebrowser/gedit-file-browser-plugin.c
+++ b/plugins/filebrowser/gedit-file-browser-plugin.c
@@ -959,25 +959,33 @@ on_filter_mode_changed_cb (GeditFileBrowserStore *model,
if ((mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) &&
(mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY))
+ {
gconf_client_set_string (client,
FILE_BROWSER_BASE_KEY "/filter_mode",
"hidden_and_binary",
NULL);
+ }
else if (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN)
+ {
gconf_client_set_string (client,
FILE_BROWSER_BASE_KEY "/filter_mode",
"hidden",
NULL);
+ }
else if (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY)
+ {
gconf_client_set_string (client,
FILE_BROWSER_BASE_KEY "/filter_mode",
"binary",
NULL);
+ }
else
+ {
gconf_client_set_string (client,
FILE_BROWSER_BASE_KEY "/filter_mode",
"none",
NULL);
+ }
g_object_unref (client);
@@ -1053,15 +1061,19 @@ on_filter_pattern_changed_cb (GeditFileBrowserWidget *widget,
g_object_get (G_OBJECT (widget), "filter-pattern", &pattern, NULL);
if (pattern == NULL)
+ {
gconf_client_set_string (client,
FILE_BROWSER_BASE_KEY "/filter_pattern",
"",
NULL);
+ }
else
+ {
gconf_client_set_string (client,
FILE_BROWSER_BASE_KEY "/filter_pattern",
pattern,
NULL);
+ }
g_free (pattern);
}
diff --git a/plugins/filebrowser/gedit-file-browser-store.c b/plugins/filebrowser/gedit-file-browser-store.c
index 040ae3a..e1629e1 100644
--- a/plugins/filebrowser/gedit-file-browser-store.c
+++ b/plugins/filebrowser/gedit-file-browser-store.c
@@ -847,8 +847,10 @@ gedit_file_browser_store_iter_n_children (GtkTreeModel *tree_model,
return 0;
for (item = FILE_BROWSER_NODE_DIR (node)->children; item; item = item->next)
+ {
if (model_node_inserted (model, (FileBrowserNode *) (item->data)))
++num;
+ }
return num;
}
@@ -1035,7 +1037,9 @@ model_node_update_visibility (GeditFileBrowserStore *model,
if (!model->priv->filter_func (model, &iter,
model->priv->filter_user_data))
+ {
node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED;
+ }
}
}
@@ -1366,8 +1370,10 @@ file_browser_node_free_children (GeditFileBrowserStore *model,
{
for (item = FILE_BROWSER_NODE_DIR (node)->children; item;
item = item->next)
+ {
file_browser_node_free (model,
(FileBrowserNode *) (item->data));
+ }
g_slist_free (FILE_BROWSER_NODE_DIR (node)->children);
FILE_BROWSER_NODE_DIR (node)->children = NULL;
@@ -1481,8 +1487,10 @@ model_remove_node_children (GeditFileBrowserStore *model,
list = g_slist_copy (dir->children);
for (item = list; item; item = item->next)
+ {
model_remove_node (model, (FileBrowserNode *) (item->data),
path_child, free_nodes);
+ }
g_slist_free (list);
gtk_tree_path_free (path_child);
@@ -1534,10 +1542,12 @@ model_remove_node (GeditFileBrowserStore *model,
{
/* Remove the node from the parents children list */
if (parent)
+ {
FILE_BROWSER_NODE_DIR (node->parent)->children =
g_slist_remove (FILE_BROWSER_NODE_DIR
(node->parent)->children,
node);
+ }
}
/* If this is the virtual root, than set the parent as the virtual root */
@@ -1796,21 +1806,18 @@ model_check_dummy (GeditFileBrowserStore *model,
gtk_tree_path_free (path);
}
}
- else
+ else if (!FILE_IS_HIDDEN (flags))
{
- if (!FILE_IS_HIDDEN (flags))
- {
- /* Was shown, needs to be removed */
+ /* Was shown, needs to be removed */
- /* To get the path we need to set it to visible temporarily */
- dummy->flags &= ~GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN;
- path = gedit_file_browser_store_get_path_real (model, dummy);
- dummy->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN;
-
- dummy->inserted = FALSE;
- row_deleted (model, path);
- gtk_tree_path_free (path);
- }
+ /* To get the path we need to set it to visible temporarily */
+ dummy->flags &= ~GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN;
+ path = gedit_file_browser_store_get_path_real (model, dummy);
+ dummy->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN;
+
+ dummy->inserted = FALSE;
+ row_deleted (model, path);
+ gtk_tree_path_free (path);
}
}
}
@@ -1825,11 +1832,15 @@ insert_node_sorted (GeditFileBrowserStore *model,
dir = FILE_BROWSER_NODE_DIR (parent);
if (model->priv->sort_func == NULL)
+ {
dir->children = g_slist_append (dir->children, child);
+ }
else
+ {
dir->children =
g_slist_insert_sorted (dir->children, child,
(GCompareFunc) (model->priv->sort_func));
+ }
}
static void
@@ -2012,10 +2023,14 @@ file_browser_node_set_from_info (GeditFileBrowserStore *model,
name = g_file_info_get_name (info);
if (g_file_info_get_is_hidden (info) || g_file_info_get_is_backup (info))
+ {
node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN;
+ }
else if (dir != NULL && dir->hidden_file_hash != NULL &&
g_hash_table_lookup (dir->hidden_file_hash, name) != NULL)
+ {
node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN;
+ }
if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY)
{
@@ -2029,7 +2044,9 @@ file_browser_node_set_from_info (GeditFileBrowserStore *model,
if (!content ||
g_content_type_is_unknown (content) ||
g_content_type_is_a (content, "text/plain"))
- node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT;
+ {
+ node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT;
+ }
}
model_recomposite_icon_real (model, node, info);
@@ -2065,7 +2082,9 @@ node_list_contains_file (GSList *children,
if (node->file != NULL &&
g_file_equal (node->file, file))
+ {
return node;
+ }
}
return NULL;
@@ -2165,7 +2184,6 @@ model_add_nodes_from_files (GeditFileBrowserStore *model,
if ((node = node_list_contains_file (original_children, file)) == NULL)
{
-
if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY)
node = file_browser_node_dir_new (model, file, parent);
else
@@ -2225,9 +2243,8 @@ parse_dot_hidden_file (FileBrowserNode *directory)
* Need to figure out if we should do this async or sync to extend
* it to all types of uris.
*/
- if (directory->file == NULL || !g_file_is_native (directory->file)) {
+ if (directory->file == NULL || !g_file_is_native (directory->file))
return;
- }
child = g_file_get_child (directory->file, ".hidden");
info = g_file_query_info (child, G_FILE_ATTRIBUTE_STANDARD_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
@@ -2252,8 +2269,10 @@ parse_dot_hidden_file (FileBrowserNode *directory)
g_object_unref (child);
if (dir->hidden_file_hash == NULL)
+ {
dir->hidden_file_hash =
g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+ }
/* Now parse the data */
i = 0;
@@ -2265,7 +2284,8 @@ parse_dot_hidden_file (FileBrowserNode *directory)
while (i < file_size && file_contents[i] != '\n')
i++;
- if (i > start) {
+ if (i > start)
+ {
char *hidden_filename;
hidden_filename = g_strndup (file_contents + start, i - start);
@@ -2351,10 +2371,12 @@ model_iterate_next_files_cb (GFileEnumerator *enumerator,
NULL,
NULL);
if (dir->monitor != NULL)
+ {
g_signal_connect (dir->monitor,
"changed",
G_CALLBACK (on_directory_monitor_event),
parent);
+ }
}
#endif
@@ -2779,11 +2801,15 @@ model_root_mounted (GeditFileBrowserStore *model,
g_object_notify (G_OBJECT (model), "root");
if (virtual_root != NULL)
+ {
return gedit_file_browser_store_set_virtual_root_from_location
(model, virtual_root);
+ }
else
+ {
set_virtual_root_from_node (model,
model->priv->root);
+ }
return GEDIT_FILE_BROWSER_STORE_RESULT_OK;
}
@@ -3138,17 +3164,14 @@ gedit_file_browser_store_set_root_and_virtual_root (GeditFileBrowserStore *model
{
equal = g_file_equal (root, model->priv->root->file);
- if (equal && virtual_root == NULL) {
+ if (equal && virtual_root == NULL)
return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE;
- }
}
if (virtual_root)
{
if (equal && g_file_equal (virtual_root, model->priv->virtual_root->file))
- {
return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE;
- }
}
/* Make sure to cancel any previous mount operations */
@@ -3224,8 +3247,10 @@ _gedit_file_browser_store_iter_expanded (GeditFileBrowserStore *model,
node = (FileBrowserNode *) (iter->user_data);
if (NODE_IS_DIR (node) && !NODE_LOADED (node))
+ {
/* Load it now */
model_load_directory (model, node);
+ }
}
void
@@ -3406,11 +3431,14 @@ gedit_file_browser_store_rename (GeditFileBrowserStore *model,
g_object_unref (previous);
if (error != NULL)
+ {
*error = g_error_new_literal (gedit_file_browser_store_error_quark (),
GEDIT_FILE_BROWSER_ERROR_RENAME,
_("The renamed file is currently filtered out."
"You need to adjust your filter settings to "
"make the file visible"));
+ }
+
return FALSE;
}
@@ -3654,7 +3682,7 @@ gedit_file_browser_store_new_file (GeditFileBrowserStore *model,
g_return_val_if_fail (iter != NULL, FALSE);
parent_node = FILE_BROWSER_NODE_DIR (parent->user_data);
- /*vTranslators: This is the default name of new files created by the file browser pane. */
+ /* Translators: This is the default name of new files created by the file browser pane. */
file = unique_new_name (((FileBrowserNode *) parent_node)->file, _("file"));
stream = g_file_create (file, G_FILE_CREATE_NONE, NULL, &error);
diff --git a/plugins/filebrowser/gedit-file-browser-utils.c b/plugins/filebrowser/gedit-file-browser-utils.c
index e7e95da..dc96c37 100644
--- a/plugins/filebrowser/gedit-file-browser-utils.c
+++ b/plugins/filebrowser/gedit-file-browser-utils.c
@@ -154,8 +154,10 @@ gedit_file_browser_utils_confirmation_dialog (GeditWindow *window,
GTK_BUTTONS_NONE, "%s", message);
if (secondary)
+ {
gtk_message_dialog_format_secondary_text
(GTK_MESSAGE_DIALOG (dlg), "%s", secondary);
+ }
/* Add a cancel button */
button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
diff --git a/plugins/filebrowser/gedit-file-browser-view.c b/plugins/filebrowser/gedit-file-browser-view.c
index 342a7a6..df76a25 100644
--- a/plugins/filebrowser/gedit-file-browser-view.c
+++ b/plugins/filebrowser/gedit-file-browser-view.c
@@ -247,8 +247,10 @@ enter_notify_event (GtkWidget *widget,
NULL, NULL, NULL);
if (view->priv->hover_path != NULL)
+ {
gdk_window_set_cursor (gtk_widget_get_window (widget),
view->priv->hand_cursor);
+ }
}
/* Chainup */
@@ -273,11 +275,15 @@ motion_notify_event (GtkWidget *widget,
if ((old_hover_path != NULL) != (view->priv->hover_path != NULL))
{
if (view->priv->hover_path != NULL)
+ {
gdk_window_set_cursor (gtk_widget_get_window (widget),
view->priv->hand_cursor);
+ }
else
+ {
gdk_window_set_cursor (gtk_widget_get_window (widget),
NULL);
+ }
}
if (old_hover_path != NULL)
@@ -301,7 +307,7 @@ set_click_policy_property (GeditFileBrowserView *obj,
if (click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
{
if (obj->priv->hand_cursor == NULL)
- obj->priv->hand_cursor = gdk_cursor_new(GDK_HAND2);
+ obj->priv->hand_cursor = gdk_cursor_new (GDK_HAND2);
}
else if (click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE)
{
@@ -309,8 +315,10 @@ set_click_policy_property (GeditFileBrowserView *obj,
{
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (obj->priv->model),
&iter, obj->priv->hover_path))
+ {
gtk_tree_model_row_changed (GTK_TREE_MODEL (obj->priv->model),
obj->priv->hover_path, &iter);
+ }
gtk_tree_path_free (obj->priv->hover_path);
obj->priv->hover_path = NULL;
@@ -529,7 +537,9 @@ button_press_event (GtkWidget *widget,
/* Ignore double click if we are in single click mode */
if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
click_count >= 2)
+ {
return TRUE;
+ }
view->priv->ignore_release = FALSE;
call_parent = TRUE;
@@ -557,7 +567,9 @@ 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);
+ }
}
else
{
@@ -724,7 +736,8 @@ fill_expand_state (GeditFileBrowserView *view,
if (gtk_tree_model_iter_children (view->priv->model, &child, iter))
{
- do {
+ do
+ {
fill_expand_state (view, &child);
}
while (gtk_tree_model_iter_next (view->priv->model, &child));
@@ -953,7 +966,9 @@ cell_data_cb (GtkTreeViewColumn *tree_column,
if (obj->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
obj->priv->hover_path != NULL &&
gtk_tree_path_compare (path, obj->priv->hover_path) == 0)
- underline = PANGO_UNDERLINE_SINGLE;
+ {
+ underline = PANGO_UNDERLINE_SINGLE;
+ }
if (GEDIT_IS_FILE_BROWSER_STORE (tree_model) &&
obj->priv->editable != NULL &&
diff --git a/plugins/filebrowser/gedit-file-browser-widget.c b/plugins/filebrowser/gedit-file-browser-widget.c
index 741012e..88cac2c 100644
--- a/plugins/filebrowser/gedit-file-browser-widget.c
+++ b/plugins/filebrowser/gedit-file-browser-widget.c
@@ -1413,10 +1413,14 @@ filter_glob (GeditFileBrowserWidget *obj,
-1);
if (FILE_IS_DIR (flags) || FILE_IS_DUMMY (flags))
+ {
result = TRUE;
+ }
else
+ {
result = g_pattern_match_string (obj->priv->filter_pattern,
name);
+ }
g_free (name);
@@ -1435,8 +1439,10 @@ rename_selected_file (GeditFileBrowserWidget *obj)
return;
if (gedit_file_browser_widget_get_first_selected (obj, &iter))
+ {
gedit_file_browser_view_start_rename (obj->priv->treeview,
&iter);
+ }
}
static GList *
@@ -1716,9 +1722,11 @@ clear_next_locations (GeditFileBrowserWidget *obj)
(obj->priv->location_next_menu));
for (item = children; item; item = item->next)
+ {
gtk_container_remove (GTK_CONTAINER
(obj->priv->location_next_menu),
GTK_WIDGET (item->data));
+ }
g_list_free (children);
@@ -1772,7 +1780,9 @@ set_filter_pattern_real (GeditFileBrowserWidget *obj,
if (pattern != NULL && obj->priv->filter_pattern_str != NULL &&
strcmp (pattern, obj->priv->filter_pattern_str) == 0)
+ {
return;
+ }
/* Free the old pattern */
g_free (obj->priv->filter_pattern_str);
@@ -1808,8 +1818,10 @@ set_filter_pattern_real (GeditFileBrowserWidget *obj,
if (update_entry)
{
if (obj->priv->filter_pattern_str == NULL)
+ {
gtk_entry_set_text (GTK_ENTRY (obj->priv->filter_entry),
"");
+ }
else
{
gtk_entry_set_text (GTK_ENTRY (obj->priv->filter_entry),
@@ -1821,8 +1833,10 @@ set_filter_pattern_real (GeditFileBrowserWidget *obj,
}
if (GEDIT_IS_FILE_BROWSER_STORE (model))
+ {
gedit_file_browser_store_refilter (GEDIT_FILE_BROWSER_STORE
(model));
+ }
g_object_notify (G_OBJECT (obj), "filter-pattern");
}
@@ -1887,11 +1901,15 @@ gedit_file_browser_widget_set_root_and_virtual_root (GeditFileBrowserWidget *obj
GeditFileBrowserStoreResult result;
if (!virtual_root)
+ {
result = gedit_file_browser_store_set_root_and_virtual_root
(obj->priv->file_store, root, root);
+ }
else
+ {
result = gedit_file_browser_store_set_root_and_virtual_root
(obj->priv->file_store, root, virtual_root);
+ }
if (result == GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE)
show_files_real (obj, TRUE);
@@ -2019,7 +2037,9 @@ gedit_file_browser_widget_get_selected_directory (GeditFileBrowserWidget *obj,
if (!gedit_file_browser_widget_get_first_selected (obj, iter) &&
!gedit_file_browser_store_get_iter_virtual_root
(GEDIT_FILE_BROWSER_STORE (model), iter))
+ {
return FALSE;
+ }
gtk_tree_model_get (model, iter,
GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
@@ -2382,11 +2402,15 @@ gedit_file_browser_widget_history_back (GeditFileBrowserWidget *obj)
if (obj->priv->locations)
{
if (obj->priv->current_location)
+ {
jump_to_location (obj,
obj->priv->current_location->next,
TRUE);
+ }
else
+ {
jump_to_location (obj, obj->priv->locations, TRUE);
+ }
}
}
@@ -2394,8 +2418,10 @@ void
gedit_file_browser_widget_history_forward (GeditFileBrowserWidget *obj)
{
if (obj->priv->locations)
+ {
jump_to_location (obj, obj->priv->current_location->prev,
FALSE);
+ }
}
static void
@@ -2437,13 +2463,17 @@ bookmark_open (GeditFileBrowserWidget *obj,
mount point anymore) */
if ((flags & GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT) ||
(flags & GEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK))
+ {
gedit_file_browser_widget_set_root (obj,
location,
FALSE);
+ }
else
+ {
gedit_file_browser_widget_set_root (obj,
location,
TRUE);
+ }
g_object_unref (location);
}
@@ -2467,9 +2497,7 @@ file_open (GeditFileBrowserWidget *obj,
-1);
if (!FILE_IS_DIR (flags) && !FILE_IS_DUMMY (flags))
- {
g_signal_emit (obj, signals[LOCATION_ACTIVATED], 0, location);
- }
}
static gboolean
@@ -2560,7 +2588,9 @@ on_virtual_root_changed (GeditFileBrowserStore *model,
if (gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)) !=
GTK_TREE_MODEL (obj->priv->file_store))
+ {
show_files_real (obj, FALSE);
+ }
if (gedit_file_browser_store_get_iter_virtual_root (model, &iter))
{
@@ -2777,11 +2807,15 @@ do_change_directory (GeditFileBrowserWidget *obj,
if ((event->state &
(~GDK_CONTROL_MASK & ~GDK_SHIFT_MASK & ~GDK_MOD1_MASK)) ==
event->state && event->keyval == GDK_BackSpace)
+ {
action = gtk_action_group_get_action (obj->priv->action_group_sensitive,
"DirectoryPrevious");
+ }
else if (!((event->state & GDK_MOD1_MASK) &&
(event->state & (~GDK_CONTROL_MASK & ~GDK_SHIFT_MASK)) == event->state))
+ {
return FALSE;
+ }
switch (event->keyval)
{
@@ -2822,7 +2856,9 @@ on_treeview_key_press_event (GeditFileBrowserView *treeview,
if (!GEDIT_IS_FILE_BROWSER_STORE
(gtk_tree_view_get_model (GTK_TREE_VIEW (treeview))))
+ {
return FALSE;
+ }
modifiers = gtk_accelerator_get_default_mod_mask ();
@@ -2863,9 +2899,11 @@ on_selection_changed (GtkTreeSelection *selection,
model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview));
if (GEDIT_IS_FILE_BROWSER_STORE (model))
+ {
selected = gedit_file_browser_widget_get_num_selected_files_or_directories (obj,
&files,
&dirs);
+ }
gtk_action_group_set_sensitive (obj->priv->action_group_selection,
selected > 0);
@@ -2897,14 +2935,17 @@ on_location_jump_activate (GtkMenuItem *item,
location = g_object_get_data (G_OBJECT (item), LOCATION_DATA_KEY);
if (obj->priv->current_location)
+ {
jump_to_location (obj, location,
g_list_position (obj->priv->locations,
location) >
g_list_position (obj->priv->locations,
- obj->priv->
- current_location));
+ obj->priv->current_location));
+ }
else
+ {
jump_to_location (obj, location, TRUE);
+ }
}
static void
@@ -3010,8 +3051,10 @@ on_action_directory_new (GtkAction *action,
if (gedit_file_browser_store_new_directory
(GEDIT_FILE_BROWSER_STORE (model), &parent, &iter))
+ {
gedit_file_browser_view_start_rename (obj->priv->treeview,
&iter);
+ }
}
static void
@@ -3064,8 +3107,10 @@ on_action_file_new (GtkAction *action,
if (gedit_file_browser_store_new_file
(GEDIT_FILE_BROWSER_STORE (model), &parent, &iter))
+ {
gedit_file_browser_view_start_rename (obj->priv->treeview,
&iter);
+ }
}
static void
@@ -3128,7 +3173,9 @@ on_action_directory_open (GtkAction *action,
if (!directory_opened &&
gedit_file_browser_widget_get_selected_directory (obj, &iter))
+ {
directory_open (obj, model, &iter);
+ }
g_list_free (rows);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]