From be79c586da2e9120a1736d9e4a1decf873363469 Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Sat, 26 May 2012 22:51:34 +0200 Subject: [PATCH] Made search case insensitive --- deluge/ui/console/modes/alltorrents.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index 25f7aae0a..def9bea9e 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -822,8 +822,10 @@ class AllTorrents(BaseMode, component.Component): def __do_search(self): # search forward for first torrent matching self.search_string + search_string = self.search_string.lower() for i,n in enumerate(self.torrent_names): - if n.find(self.search_string) >= 0: + n = n.lower() + if n.find(search_string) >= 0: self.cursel = (i+1) if ((self.curoff + self.rows - 5) < self.cursel): self.curoff = self.cursel - self.rows + 5 @@ -835,8 +837,10 @@ class AllTorrents(BaseMode, component.Component): # search backward for the next torrent matching self.search_string search_list = list(enumerate(self.torrent_names[:self.cursel-1])) search_list = list(reversed(search_list)) + search_string = self.search_string.lower() for i,n in search_list: - if n.find(self.search_string) >= 0: + n = n.lower() + if n.find(search_string) >= 0: self.cursel = (i+1) if ((self.curoff - 4) > self.cursel): self.curoff = self.cursel - 4 @@ -846,8 +850,10 @@ class AllTorrents(BaseMode, component.Component): def __do_search_forward(self): # search forward for the next torrent matching self.search_string + search_string = self.search_string.lower() for i,n in enumerate(self.torrent_names[self.cursel:]): - if n.find(self.search_string) >= 0: + n = n.lower() + if n.find(search_string) >= 0: self.cursel += (i+1) if ((self.curoff + self.rows - 5) < self.cursel): self.curoff = self.cursel - self.rows + 5