From b2bcc00e1d8aaf3f773ae540ba85f120bf3e29c1 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Ouellet Date: Mon, 23 Jan 2017 12:14:38 -0500 Subject: [PATCH 1/2] Revert "Fix for UnicodeEncodeError in search" This reverts commit 4a3240bf1af6e38efa82f593a1d4454c3be78fa0. VM names never contain any unicode characters, so this fix only propagates the possibility of an encoding error to further down the line, rather than removing it. A proper fix would involve filtering the input to the search box as we do with creating & renaming VMs. --- qubesmanager/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qubesmanager/main.py b/qubesmanager/main.py index 007ae07..90d941a 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -719,7 +719,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): @pyqtSlot(str) def do_search(self, search): - self.search = unicode(search) + self.search = str(search) self.showhide_vms() self.set_table_geom_size() From 6b3ef1dab24392462bd5d7fa1653bf4e8cbee260 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Ouellet Date: Mon, 13 Feb 2017 04:36:35 -0500 Subject: [PATCH 2/2] Restrict VM search field to valid VM names Properly fixes https://github.com/QubesOS/qubes-issues/issues/2562 This regex is starting to get duplicated in too many places... Maybe it belongs in core somewhere? --- qubesmanager/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qubesmanager/main.py b/qubesmanager/main.py index 90d941a..59dc24a 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -351,6 +351,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): self.blk_watch_thread.start() self.searchbox = SearchBox() + self.searchbox.setValidator(QRegExpValidator(QRegExp("[a-zA-Z0-9-]*", Qt.CaseInsensitive), None)) self.searchContainer.addWidget(self.searchbox) self.connect(self.table, SIGNAL("itemSelectionChanged()"),