From: eshe Date: Sun, 24 Oct 2010 11:40:35 +0000 (+0100) Subject: Finnish Eniro search fixed. Changelog updated. Some modifications to control file. X-Git-Url: http://git.maemo.org/git/?p=jenirok;a=commitdiff_plain;h=40fda96f3253fec26e64d5165fcc75011b976a66;ds=sidebyside Finnish Eniro search fixed. Changelog updated. Some modifications to control file. --- diff --git a/debian/changelog b/debian/changelog index b0f77aa..f74211d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +jenirok (0.2-11) unstable; urgency=low + + * Fixed Finnish Eniro search. + + -- Jesse Hakanen Sun, 24 Oct 2010 12:37:35 +0100 + jenirok (0.2-10) unstable; urgency=low * Changed search to retry automatically couple of times on failure. diff --git a/debian/control b/debian/control index 4c10f85..8b82083 100644 --- a/debian/control +++ b/debian/control @@ -10,16 +10,12 @@ Package: jenirok Architecture: any Depends: ${shlibs:Depends}, libqt4-sql-sqlite Description: Searches unknown callers' details automatically during call. - Unknown callers' details are fetched automatically during call - using Eniro person search, 1881.no or Das Telefonbuch. - Person search can also be done by using a gui application. - Jenirok is currently mainly usable for Finnish, Swedish, + Unknown callers' details are fetched automatically during call using Eniro person search, 1881.no or Das Telefonbuch. + Person search can also be done by using a gui application. Jenirok is currently mainly usable for Finnish, Swedish, Danish, Norwegian and German users. XB-Description-fi_FI: Hakee tuntemattoman soittajan tiedot Eniron henkilöhaulla. - Jenirok hakee tuntemattoman soittajan tiedot - automaattisesti Eniron henkilöhakua käyttämällä. - Haku onnistuu myös graafisen käyttöliittymän - kautta. + Jenirok hakee tuntemattoman soittajan tiedot automaattisesti Eniron henkilöhakua käyttämällä. + Haku onnistuu myös graafisen käyttöliittymän kautta. XSBC-Bugtracker: https://garage.maemo.org/tracker/?atid=5541&group_id=1530 XB-Maemo-Display-Name: Jenirok XB-Maemo-Icon-26: diff --git a/src/common/eniro.cpp b/src/common/eniro.cpp index edffeed..85d9fc3 100644 --- a/src/common/eniro.cpp +++ b/src/common/eniro.cpp @@ -45,7 +45,7 @@ namespace static const QString INVALID_LOGIN_STRING = "Invalid login details"; static const QString TIMEOUT_STRING = "Request timed out"; static const QString PERSON_REGEXP = "(.*)(.*)"; - static const QString YELLOW_REGEXP = "(.*)(.*)"; + static const QString YELLOW_REGEXP = "(.*)(.*)|(.*)(.*)"; static const QString SINGLE_REGEXP = "
(.*)
(.*)
(.*)(
|

(.*)
|

(.*)
)"; static const QString NUMBER_REGEXP = "
(.*)
"; static const QString LOGIN_CHECK = " 1) + { + what = "wp"; + } + else if(loggedIn_ || site_ != FI) { switch(type) { @@ -178,6 +184,8 @@ void Eniro::search(SearchDetails const& details) http_.setHost(url.host(), url.port(80)); int id = http_.get(url.encodedPath() + '?' + url.encodedQuery()); + //qDebug() << "Url: " << url.host() << url.encodedPath() << "?" << url.encodedQuery(); + QVector results; // Store search data for later identification @@ -279,6 +287,13 @@ void Eniro::loadResults(int id, QString const& httpData) { searchMap::iterator it = pendingSearches_.find(id); + // Finnish person search is not working in wap mode so we have to use different type of loading + if(getMaxResults() > 1 && loggedIn_ && site_ == FI && it.value()->details.type == PERSONS) + { + loadFinnishPersonResults(id, httpData); + return; + } + QRegExp rx("((" + YELLOW_REGEXP + ")|(" + PERSON_REGEXP + ")|(" + SINGLE_REGEXP + "))"); rx.setMinimal(true); @@ -443,6 +458,102 @@ void Eniro::loadResults(int id, QString const& httpData) } } +void Eniro::loadFinnishPersonResults(int id, QString const& httpData) +{ + searchMap::iterator it = pendingSearches_.find(id); + + static QRegExp rx("
"); + static QRegExp name("(.*)"); + static QRegExp number("(.*)