X-Git-Url: http://git.maemo.org/git/?p=jenirok;a=blobdiff_plain;f=src%2Fcommon%2Feniro.cpp;h=85d9fc3b323b9df42025ba65e64f63d793f38006;hp=edffeedb3695b6303a6bd5176fda8e9e63526d69;hb=40fda96f3253fec26e64d5165fcc75011b976a66;hpb=8b35cab561c91feb9fd0836166d5a889c30b8083 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("(.*)