Get Books: IMprove search for e-knigi and Chitanka

This commit is contained in:
Kovid Goyal 2011-12-07 09:04:33 +05:30
commit 2222918260
4 changed files with 21 additions and 8 deletions

View File

@ -252,7 +252,7 @@ class SearchDialog(QDialog, Ui_Dialog):
# Milliseconds # Milliseconds
self.hang_time = self.config.get('hang_time', 75) * 1000 self.hang_time = self.config.get('hang_time', 75) * 1000
self.max_results = self.config.get('max_results', 10) self.max_results = self.config.get('max_results', 15)
self.should_open_external = self.config.get('open_external', True) self.should_open_external = self.config.get('open_external', True)
# Number of threads to run for each type of operation # Number of threads to run for each type of operation

View File

@ -14,7 +14,7 @@
<string>Get Books</string> <string>Get Books</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="../../../../../resources/images.qrc"> <iconset>
<normaloff>:/images/store.png</normaloff>:/images/store.png</iconset> <normaloff>:/images/store.png</normaloff>:/images/store.png</iconset>
</property> </property>
<property name="sizeGripEnabled"> <property name="sizeGripEnabled">
@ -82,8 +82,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>173</width> <width>193</width>
<height>106</height> <height>127</height>
</rect> </rect>
</property> </property>
</widget> </widget>
@ -254,6 +254,19 @@
<header>widgets.h</header> <header>widgets.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<tabstops>
<tabstop>search_edit</tabstop>
<tabstop>search</tabstop>
<tabstop>results_view</tabstop>
<tabstop>store_list</tabstop>
<tabstop>select_all_stores</tabstop>
<tabstop>select_invert_stores</tabstop>
<tabstop>select_none_stores</tabstop>
<tabstop>configure</tabstop>
<tabstop>open_external</tabstop>
<tabstop>close</tabstop>
<tabstop>adv_search_button</tabstop>
</tabstops>
<resources> <resources>
<include location="../../../../../resources/images.qrc"/> <include location="../../../../../resources/images.qrc"/>
</resources> </resources>

View File

@ -40,9 +40,9 @@ class ChitankaStore(BasicStoreConfig, StorePlugin):
d.exec_() d.exec_()
def search(self, query, max_results=10, timeout=60): def search(self, query, max_results=10, timeout=60):
# check for cyrilic symbols before performing search # check for cyrillic symbols before performing search
uquery = unicode(query.strip(), 'utf-8') uquery = unicode(query.strip(), 'utf-8')
reObj = re.search(u'^[а-яА-Я\\d]{4,}[а-яА-Я\\d\\s]*$', uquery) reObj = re.search(u'^[а-яА-Я\\d\\s]{3,}$', uquery)
if not reObj: if not reObj:
return return

View File

@ -46,9 +46,9 @@ class eKnigiStore(BasicStoreConfig, StorePlugin):
d.exec_() d.exec_()
def search(self, query, max_results=10, timeout=60): def search(self, query, max_results=10, timeout=60):
# check for cyrilic symbols before performing search # check for cyrillic symbols before performing search
uquery = unicode(query.strip(), 'utf-8') uquery = unicode(query.strip(), 'utf-8')
reObj = re.search(u'^[а-яА-Я\\d]{2,}[а-яА-Я\\d\\s]*$', uquery) reObj = re.search(u'^[а-яА-Я\\d\\s]{2,}$', uquery)
if not reObj: if not reObj:
return return