[gtk+/bgo141154-filechooser-icon-view: 10/23] Move some variable declarations
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/bgo141154-filechooser-icon-view: 10/23] Move some variable declarations
- Date: Wed, 17 Oct 2012 19:59:02 +0000 (UTC)
commit 6b8dcd9f091c75ce0fad3f3395c38c9cf16e2112
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Apr 5 14:30:48 2011 -0500
Move some variable declarations
We prefer declarations in the beginning of blocks.
gtk/gtkfilechooserdefault.c | 31 +++++++++++++++++++------------
1 files changed, 19 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index ef293ce..a77f34c 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -7027,38 +7027,45 @@ file_system_model_set (GtkFileSystemModel *model,
case MODEL_COL_ICON_PIXBUF:
if (info)
{
- /* not loading icon view's icon in the list view */
- if (column == MODEL_COL_ICON_PIXBUF && impl->view_mode == VIEW_MODE_LIST)
- return FALSE;
-
GtkTreeModel *tree_model;
GtkTreePath *path, *start, *end;
GtkTreeIter iter;
+ gboolean file_visible;
+
+ /* not loading icon view's icon in the list view */
+ if (column == MODEL_COL_ICON_PIXBUF && impl->view_mode == VIEW_MODE_LIST)
+ return FALSE;
tree_model = impl->current_model;
if (tree_model != GTK_TREE_MODEL (model))
return FALSE;
- if (!_gtk_file_system_model_get_iter_for_file (model,
- &iter,
- file))
- g_assert_not_reached ();
-
/* #1 use standard icon if it is loaded */
if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_ICON))
{
- gint icon_size = impl->list_icon_size;
+ gint icon_size;
+
if (column == MODEL_COL_ICON_PIXBUF)
icon_size = impl->icon_icon_size;
+ else
+ icon_size = impl->list_icon_size;
+
g_value_take_object (value, _gtk_file_info_render_icon (info, GTK_WIDGET (impl), icon_size));
return TRUE;
}
if (!get_visible_range (&start, &end, impl))
return FALSE;
+
+ if (!_gtk_file_system_model_get_iter_for_file (model,
+ &iter,
+ file))
+ g_assert_not_reached ();
+
path = gtk_tree_model_get_path (tree_model, &iter);
- gboolean file_visible = (gtk_tree_path_compare (start, path) != 1 &&
- gtk_tree_path_compare (path, end) != 1);
+ file_visible = (gtk_tree_path_compare (start, path) != 1 &&
+ gtk_tree_path_compare (path, end) != 1);
+
gtk_tree_path_free (path);
gtk_tree_path_free (start);
gtk_tree_path_free (end);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]