[gnome-builder] find-other-files: don't rely inherent bool behavior
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] find-other-files: don't rely inherent bool behavior
- Date: Sun, 12 Nov 2017 10:04:35 +0000 (UTC)
commit c8da293c2031dcdeac71b9ff5b4ff1fdc8438702
Author: Christian Hergert <chergert redhat com>
Date: Sun Nov 12 02:03:39 2017 -0800
find-other-files: don't rely inherent bool behavior
This doesn't work here like it did with [], so it too must be
changed.
src/plugins/find-other-file/find_other_file.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/find-other-file/find_other_file.py b/src/plugins/find-other-file/find_other_file.py
index 6e31a20..10ad491 100644
--- a/src/plugins/find-other-file/find_other_file.py
+++ b/src/plugins/find-other-file/find_other_file.py
@@ -94,10 +94,12 @@ class FindOtherFile(GObject.Object, Ide.WorkbenchAddin):
enumerator.close()
- if files.get_n_items() == 1:
+ count = files.get_n_items()
+
+ if count == 1:
file = files.get_item(0).file.get_file()
self.workbench.open_files_async([file], 'editor', 0, None, None)
- elif files:
+ elif count:
self.present_results(files, basename)
except Exception as ex:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]