[meld] dirdiff: Fix expand/collapse sensitivity for fake empty rows (#342)
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] dirdiff: Fix expand/collapse sensitivity for fake empty rows (#342)
- Date: Thu, 20 Jun 2019 23:43:28 +0000 (UTC)
commit 450a9bf00680e1a9521d89f4c930e9c5894a7c82
Author: Kai Willadsen <kai willadsen gmail com>
Date: Fri Jun 21 09:21:42 2019 +1000
dirdiff: Fix expand/collapse sensitivity for fake empty rows (#342)
We add path-less rows to the model to represent empty folders, which the
existing selection code wasn't handling. With this change, we don't try
to figure out whether the current selection is a folder... we just look
to see whether the model has children, which is both easier and more
correct.
meld/dirdiff.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 4b41e125..f675a403 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -1125,9 +1125,7 @@ class DirDiff(Gtk.VBox, tree.TreeviewCommon, MeldDoc):
if (selection.count_selected_rows() == 1):
path = selection.get_selected_rows()[1][0]
it = self.model.get_iter(path)
- os_path = self.model.value_path(it, pane)
- is_single_foldable_row = self.model.is_folder(
- it, pane, os_path)
+ is_single_foldable_row = self.model.iter_has_child(it)
self.set_action_enabled('folder-collapse', is_single_foldable_row)
self.set_action_enabled('folder-expand', is_single_foldable_row)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]