[gtk+] Make the logic for setting the sensitivity column a bit more clear
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make the logic for setting the sensitivity column a bit more clear
- Date: Sun, 15 Jul 2012 04:44:14 +0000 (UTC)
commit 226450785a7c9b0efb37d54504a2fb53fb72babe
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Jul 11 17:50:15 2012 -0500
Make the logic for setting the sensitivity column a bit more clear
Signed-off-by: Federico Mena Quintero <federico gnome org>
gtk/gtkfilechooserdefault.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 5824590..19cd8bb 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -6845,17 +6845,18 @@ file_system_model_set (GtkFileSystemModel *model,
{
gboolean sensitive = TRUE;
- if (impl->action != GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER &&
- impl->action != GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+ if (!(impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
+ || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
{
- sensitive = TRUE;
+ sensitive = TRUE; /* for file modes... */
}
else if (!_gtk_file_info_consider_as_directory (info))
{
- sensitive = FALSE;
+ sensitive = FALSE; /* for folder modes, files are not sensitive... */
}
else
{
+ /* ... and for folder modes, folders are sensitive only if the filter says so */
GtkTreeIter iter;
if (!_gtk_file_system_model_get_iter_for_file (model, &iter, file))
g_assert_not_reached ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]