From 98a1f85aeec79153cf418cb097415136aeab1058 Mon Sep 17 00:00:00 2001 From: eshe Date: Tue, 10 Aug 2010 15:20:58 +0100 Subject: [PATCH] Fixes to ovi integration. --- src/common/source.cpp | 2 +- src/gui/detailwindow.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/common/source.cpp b/src/common/source.cpp index 21245b9..ac246ab 100644 --- a/src/common/source.cpp +++ b/src/common/source.cpp @@ -307,7 +307,7 @@ QString& Source::htmlEntityDecode(QString& string) 38, 60, 62, - 160, + 32, 192, 193, 194, diff --git a/src/gui/detailwindow.cpp b/src/gui/detailwindow.cpp index f7088c2..12d5ef7 100644 --- a/src/gui/detailwindow.cpp +++ b/src/gui/detailwindow.cpp @@ -226,6 +226,8 @@ void DetailWindow::openMaps() addr.zipCode, addr.city); addr.country = country_; + //qDebug() << addr.street << addr.number << addr.zipCode << addr.city << addr.country; + if(!maps.openMaps(addr)) { QMaemo5InformationBox::information(this, tr("Unable to find coordinates for address.")); @@ -241,6 +243,7 @@ void DetailWindow::getDetails(QString& street, QString& streetNumber, QString streetVal = streetButton_->valueText(); QString cityVal = cityButton_->valueText(); + city = cityVal; QStringList words = streetVal.split(" ", QString::SkipEmptyParts); @@ -270,7 +273,20 @@ void DetailWindow::getDetails(QString& street, QString& streetNumber, } } + if(streetNumber.isEmpty()) + { + static QRegExp addrCheck(" ([0-9]+)"); + + if((pos = addrCheck.indexIn(street)) != -1) + { + streetNumber = addrCheck.cap(1); + street = street.left(pos); + } + } + streetNumber = streetNumber.trimmed(); + street = street.replace("Str.", QString::fromUtf8("Straße")); + street = street.replace("str.", QString::fromUtf8("straße")); street = street.trimmed(); if((pos = cityVal.indexOf(" ")) > 0) -- 1.7.9.5