[hamster-applet] tags should not be case sensitive. fixes bug 605994
- From: Toms Baugis <tbaugis src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [hamster-applet] tags should not be case sensitive. fixes bug 605994
- Date: Mon, 4 Jan 2010 12:50:58 +0000 (UTC)
commit c9084e5b97149bfafcd22cadcc7092b1f66584db
Author: Toms Bauģis <toms baugis gmail com>
Date: Mon Jan 4 12:50:45 2010 +0000
tags should not be case sensitive. fixes bug 605994
hamster/db.py | 2 +-
hamster/widgets/tags.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/hamster/db.py b/hamster/db.py
index d34664d..b686f28 100644
--- a/hamster/db.py
+++ b/hamster/db.py
@@ -99,7 +99,7 @@ class Storage(storage.Storage):
"""look up tags by their name. create if not found"""
# filter descriptions out, just in case they have wandered in here
- tags = [tag for tag in tags if tag.startswith("!") == False and len(tag.split(" ")) < 3]
+ tags = [tag.lower() for tag in tags if tag.startswith("!") == False and len(tag.split(" ")) < 3]
db_tags = self.fetchall("select * from tags where name in (%s)"
% ",".join(["?"] * len(tags)), tags) # bit of magic here - using sqlites bind variables
diff --git a/hamster/widgets/tags.py b/hamster/widgets/tags.py
index a7cdb6c..0320249 100644
--- a/hamster/widgets/tags.py
+++ b/hamster/widgets/tags.py
@@ -129,7 +129,7 @@ class TagsEntry(gtk.Entry):
entered_tags = self.get_tags()
self.tag_box.selected_tags = entered_tags
- self.filter_tags = [tag for tag in self.tags if tag.startswith(self.filter)]
+ self.filter_tags = [tag for tag in self.tags if (tag or "").lower().startswith((self.filter or "").lower())]
self.tag_box.draw(self.filter_tags)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]