From 328997ca46eada74c0617da06d1e2385c1f48164 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 31 Jul 2005 19:04:54 +0000 Subject: [PATCH] r4072: Bugfix: In vertical ordering mode, the blank space after all the items acted as if there were icons there (reported by Arnaud Calvo). --- ROX-Filer/Help/Changes | 2 ++ ROX-Filer/src/collection.c | 14 ++++++++++---- ROX-Filer/src/filer.c | 9 +++++++-- ROX-Filer/src/main.c | 1 - 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index 0678e667..a97cd969 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -7,6 +7,8 @@ Added a button for configuring video thumbnails (with Stephen Watson's VideoThumbnail application) to the Options window (Thomas Leonard). Manual updates. +Bugfix: In vertical ordering mode, the blank space after all the items + acted as if there were icons there (reported by Arnaud Calvo). 30-Jul-2005 ~~~~~~~~~~~ diff --git a/ROX-Filer/src/collection.c b/ROX-Filer/src/collection.c index a6fea812..31e56391 100644 --- a/ROX-Filer/src/collection.c +++ b/ROX-Filer/src/collection.c @@ -1838,12 +1838,18 @@ void collection_item_to_rowcol (const Collection *collection, -/* Translate the (row, column) form to the item number */ -int collection_rowcol_to_item(const Collection *collection, - int row, int col) +/* Translate the (row, column) form to the item number. + * May return a number >= collection->number_of_items. + */ +int collection_rowcol_to_item(const Collection *collection, int row, int col) { if (!collection->vertical_order) return row * collection->columns + col; else - return row + col * collection_get_rows(collection); + { + int rows = collection_get_rows(collection); + if (row >= rows) + return collection->number_of_items; + return row + col * rows; + } } diff --git a/ROX-Filer/src/filer.c b/ROX-Filer/src/filer.c index f913cf00..1e8e0a68 100644 --- a/ROX-Filer/src/filer.c +++ b/ROX-Filer/src/filer.c @@ -330,9 +330,14 @@ void filer_window_set_size(FilerWindow *filer_window, int w, int h) */ static gint open_filer_window(FilerWindow *filer_window) { - Settings *dir_settings = (Settings *) g_hash_table_lookup(settings_table, + Settings *dir_settings; + gboolean force_resize; + + dir_settings = (Settings *) g_hash_table_lookup(settings_table, filer_window->sym_path); - gboolean force_resize = !(o_filer_auto_resize.int_value == RESIZE_NEVER && dir_settings && dir_settings->flags & SET_POSITION); + + force_resize = !(o_filer_auto_resize.int_value == RESIZE_NEVER && + dir_settings && dir_settings->flags & SET_POSITION); view_style_changed(filer_window->view, 0); diff --git a/ROX-Filer/src/main.c b/ROX-Filer/src/main.c index 0c038f7c..09916f49 100644 --- a/ROX-Filer/src/main.c +++ b/ROX-Filer/src/main.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #ifdef HAVE_GETOPT_LONG -- 2.11.4.GIT