From: eshe Date: Fri, 23 Jul 2010 21:18:21 +0000 (+0100) Subject: Added some sort of Ovi Maps integration. All translations updated. X-Git-Url: http://vcs.maemo.org/git/?p=jenirok;a=commitdiff_plain;h=d683b3ca259161ea7b5fb806b3bdab8fb1e96cb7 Added some sort of Ovi Maps integration. All translations updated. --- diff --git a/debian/changelog b/debian/changelog index edcec39..5834f13 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +jenirok (0.2-4) unstable; urgency=low + + * German translation and German phone book (Das Telefonbuch) added. + * Added call log for missed and answered calls. + * Address item in detail view can now be clicked to open it in Ovi Maps. + + -- Jesse Hakanen Fri, 23 Jul 2010 22:08:38 +0100 + jenirok (0.2-3) unstable; urgency=low * Swedish translation added. diff --git a/src/common/cache.cpp b/src/common/cache.cpp index b339d43..2e01f07 100644 --- a/src/common/cache.cpp +++ b/src/common/cache.cpp @@ -170,11 +170,12 @@ bool Cache::logItem(Source::Result const& result, bool missed, unsigned int time QSqlQuery query; - query.prepare("INSERT INTO log(number, name, street, city, time, missed) VALUES(:number, :name, :street, :city, :time, :missed)"); + query.prepare("INSERT INTO log(number, name, street, city, country, time, missed) VALUES(:number, :name, :street, :city, :country, :time, :missed)"); query.bindValue(":number", result.number); query.bindValue(":name", result.name); query.bindValue(":street", result.street); query.bindValue(":city", result.city); + query.bindValue(":country", result.country); query.bindValue(":time", time); int misVal = missed ? 1 : 0; @@ -233,7 +234,7 @@ void Cache::getLogItems(QList& items, int limit) DB::connect(); } - QSqlQuery query("SELECT number, name, street, city, time, missed FROM log ORDER BY time DESC LIMIT " + QString::number(limit)); + QSqlQuery query("SELECT number, name, street, city, country, time, missed FROM log ORDER BY time DESC LIMIT " + QString::number(limit)); while(query.next()) { @@ -242,9 +243,10 @@ void Cache::getLogItems(QList& items, int limit) details.result.name = query.value(1).toString(); details.result.street = query.value(2).toString(); details.result.city = query.value(3).toString(); - details.time = query.value(4).toInt(); + details.result.country = query.value(4).toString(); + details.time = query.value(5).toInt(); - int missed = query.value(5).toInt(); + int missed = query.value(6).toInt(); details.missed = missed ? true : false; diff --git a/src/common/dastelefonbuch.cpp b/src/common/dastelefonbuch.cpp index da890f8..7ab3ed4 100644 --- a/src/common/dastelefonbuch.cpp +++ b/src/common/dastelefonbuch.cpp @@ -254,6 +254,7 @@ bool DasTelefonbuch::formatResult(QString& name, QString& number, city = htmlEntityDecode(city); result.street = street.trimmed(); result.city = city.trimmed(); + result.country = "Germany"; if(!result.name.isEmpty() && (!getFindNumber() || !result.number.isEmpty())) { diff --git a/src/common/db.cpp b/src/common/db.cpp index 4028a74..fd12f34 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -113,7 +113,7 @@ bool DB::createTables(bool update) ret = ret && query.exec("CREATE TABLE IF NOT EXISTS cache (id INTEGER PRIMARY KEY, number VARCHAR(32) NOT NULL UNIQUE, name VARCHAR(255) NOT NULL, street VARCHAR(255) NOT NULL, city VARCHAR(255) NOT NULL)"); ret = ret && query.exec("CREATE TABLE IF NOT EXISTS settings (name VARCHAR(255) NOT NULL PRIMARY KEY, value VARCHAR(255) NOT NULL)"); - ret = ret && query.exec("CREATE TABLE IF NOT EXISTS log (id INTEGER PRIMARY KEY, number VARCHAR(32) NOT NULL, name VARCHAR(255), street VARCHAR(255), city VARCHAR(255), time INTEGER NOT NULL, missed INTEGER NOT NULL)"); + ret = ret && query.exec("CREATE TABLE IF NOT EXISTS log (id INTEGER PRIMARY KEY, number VARCHAR(32) NOT NULL, name VARCHAR(255), street VARCHAR(255), city VARCHAR(255), country VARCHAR(255), time INTEGER NOT NULL, missed INTEGER NOT NULL)"); if(update) { diff --git a/src/common/eniro.cpp b/src/common/eniro.cpp index 8e2503a..77290e2 100644 --- a/src/common/eniro.cpp +++ b/src/common/eniro.cpp @@ -304,6 +304,19 @@ void Eniro::loadResults(int id, QString const& httpData) Result result; + switch(site_) + { + case FI: + result.country = "Finland"; + break; + case SE: + result.country = "Sweden"; + break; + case DK: + result.country = "Denmark"; + break; + } + int size = rows.size(); switch(size) diff --git a/src/common/mobil1881.cpp b/src/common/mobil1881.cpp index 1bd0c3a..6bc9deb 100644 --- a/src/common/mobil1881.cpp +++ b/src/common/mobil1881.cpp @@ -248,6 +248,7 @@ bool Mobil1881::formatResult(QString& name, QString& number, city = htmlEntityDecode(city); result.street = street.trimmed(); result.city = city.trimmed(); + result.country = "Norway"; if(!result.name.isEmpty() && (!getFindNumber() || !result.number.isEmpty())) { diff --git a/src/common/source.h b/src/common/source.h index 6af26b2..7ebe969 100644 --- a/src/common/source.h +++ b/src/common/source.h @@ -39,6 +39,7 @@ public: QString street; QString city; QString number; + QString country; }; enum SearchType {YELLOW_PAGES, PERSONS, BOTH}; diff --git a/src/common/translations/de_DE.qm b/src/common/translations/de_DE.qm index f9f2113..ad66694 100644 Binary files a/src/common/translations/de_DE.qm and b/src/common/translations/de_DE.qm differ diff --git a/src/common/translations/de_DE.ts b/src/common/translations/de_DE.ts index 9dcef5d..0629ba2 100644 --- a/src/common/translations/de_DE.ts +++ b/src/common/translations/de_DE.ts @@ -53,7 +53,7 @@ Use global setting - Globale Einstellung verwenden + Globale Einstellungen @@ -158,7 +158,7 @@ Selected phonebook has no settings to configure. - Kein Einstellungen für das gewählte Telefonbuch. + Keine Einstellungen für das gewählte Telefonbuch. @@ -195,6 +195,29 @@ + LogWindow + + + Incoming call log + Liste eingegangener Anrufe + + + + Clear log + Liste leeren + + + + There are currently no logged calls + Liste ist leer + + + + %1 (no search results) + %1 (keine Ergebnisse) + + + MainWindow @@ -219,6 +242,11 @@ Suchen + + Log + Logbuch + + Settings Einstellungen @@ -374,7 +402,7 @@ Cache size (numbers) - Programmspeicherplatz (Nummern) + Speicherplatz (Nummern) @@ -414,7 +442,7 @@ Connect automatically on - Automatisch verbinden bei + Automatisch verbinden: diff --git a/src/common/translations/nb_NO.qm b/src/common/translations/nb_NO.qm index e1dd43e..41e71f8 100644 Binary files a/src/common/translations/nb_NO.qm and b/src/common/translations/nb_NO.qm differ diff --git a/src/common/translations/nb_NO.ts b/src/common/translations/nb_NO.ts index 4f5fd71..a2a405c 100644 --- a/src/common/translations/nb_NO.ts +++ b/src/common/translations/nb_NO.ts @@ -195,6 +195,29 @@ + LogWindow + + + Incoming call log + Anropslogg + + + + Clear log + Tøm Logg + + + + There are currently no logged calls + Det er ingen mottatte anrop + + + + %1 (no search results) + %1 (ble ikke funnet) + + + MainWindow @@ -219,6 +242,11 @@ Søk + + Log + Logg + + Settings Innstillinger @@ -236,7 +264,7 @@ Unable to stop daemon. - Kan ikke stoppe Autosøk. + Kan ikke stoppe autosøk. diff --git a/src/common/translations/sv_SE.qm b/src/common/translations/sv_SE.qm index a278fe0..24d9304 100644 Binary files a/src/common/translations/sv_SE.qm and b/src/common/translations/sv_SE.qm differ diff --git a/src/common/translations/sv_SE.ts b/src/common/translations/sv_SE.ts index ebe1d2f..17f7022 100644 --- a/src/common/translations/sv_SE.ts +++ b/src/common/translations/sv_SE.ts @@ -195,6 +195,29 @@ + LogWindow + + + Incoming call log + Samtalshistorik + + + + Clear log + Nollställ samtalshistorik + + + + There are currently no logged calls + Samtalshistoriken är tom + + + + %1 (no search results) + %1 (inget sökresultat) + + + MainWindow @@ -219,6 +242,11 @@ Sök + + Log + Historik + + Settings Inställningar @@ -361,7 +389,7 @@ fi - fi + se diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index d3b73a4..f011649 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -21,14 +21,6 @@ #include "calllistener.h" #include "settings.h" -#include "source.h" -#include "cache.h" -#include -#include -#include -#include - - int main(int argc, char *argv[]) { // If daemon was started on boot, the first parameter is set to "-boot" diff --git a/src/gui/detailwindow.cpp b/src/gui/detailwindow.cpp index 1e5b6c4..92a6d73 100644 --- a/src/gui/detailwindow.cpp +++ b/src/gui/detailwindow.cpp @@ -17,8 +17,12 @@ */ #include +#include #include #include +#include +#include +#include #include #include #include @@ -28,6 +32,7 @@ #include #include "detailwindow.h" #include "contactmanager.h" +#include "ovimaps.h" DetailWindow::DetailWindow(QWidget* parent): QMainWindow(parent), addDialog_(0) { @@ -51,12 +56,14 @@ DetailWindow::DetailWindow(QWidget* parent): QMainWindow(parent), addDialog_(0) nameButton_ = new QMaemo5ValueButton(QIcon::fromTheme("general_default_avatar"), tr("Name"), this); - streetButton_ = new QMaemo5ValueButton(tr("Street"), this); + streetButton_ = new QMaemo5ValueButton(QIcon::fromTheme("general_map"), + tr("Street"), this); cityButton_ = new QMaemo5ValueButton(tr("City"), this); numberButton_ = new QMaemo5ValueButton(QIcon::fromTheme("general_call"), tr("Phone number"), this); connect(numberButton_, SIGNAL(pressed()), this, SLOT(makeCall())); + connect(streetButton_, SIGNAL(pressed()), this, SLOT(openMaps())); top->addWidget(nameButton_); bottom->addWidget(streetButton_); @@ -81,6 +88,7 @@ void DetailWindow::loadData(Source::Result const& details) streetButton_->setValueText(details.street); cityButton_->setValueText(details.city); numberButton_->setValueText(details.number); + country_ = details.country; show(); } @@ -195,3 +203,79 @@ void DetailWindow::sendSMS() } } + +void DetailWindow::openMaps() +{ + QString street = streetButton_->valueText(); + QString city = cityButton_->valueText(); + QString number; + QString zip; + + if(street.isEmpty() && city.isEmpty()) + { + return; + } + + setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true); + + int pos = 0; + + QStringList words = street.split(" ", QString::SkipEmptyParts); + + static QRegExp numberCheck("([0-9-]+)"); + + bool numberFound = false; + bool numberSet = false; + + QString streetStr; + QString numberStr; + + for(int i = 0; i < words.size(); i++) + { + if(i > 0 && numberCheck.exactMatch(words.at(i))) + { + numberFound = true; + } + + if(numberFound) + { + if(!numberSet) + { + numberStr = words.at(i); + numberSet = true; + } + } + else + { + streetStr += words.at(i) + " "; + } + } + + number = numberStr.trimmed(); + street = streetStr.trimmed(); + + if((pos = city.indexOf(" ")) > 0) + { + if(numberCheck.exactMatch(city.left(pos))) + { + zip = city.left(pos); + city = city.mid(pos + 1); + } + } + + OviMaps maps; + + OviMaps::Address addr; + addr.street = street; + addr.number = number; + addr.zipCode = zip; + addr.city = city; + addr.country = country_; + + if(!maps.openMaps(addr)) + { + QMaemo5InformationBox::information(this, tr("Unable to find coordinates for address.")); + } + + setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false); +} diff --git a/src/gui/detailwindow.h b/src/gui/detailwindow.h index a267e6b..97fe4f0 100644 --- a/src/gui/detailwindow.h +++ b/src/gui/detailwindow.h @@ -33,6 +33,7 @@ class DetailWindow : public QMainWindow Q_OBJECT public: + DetailWindow(QWidget* parent = 0); public slots: @@ -44,6 +45,7 @@ private slots: void addToContacts(); void copyToClipboard(); void sendSMS(); + void openMaps(); private: QWidget* area_; @@ -54,6 +56,7 @@ private: QMaemo5ValueButton* numberButton_; QDialog* addDialog_; QLineEdit* addContactInput_; + QString country_; }; diff --git a/src/gui/gui.pro b/src/gui/gui.pro index ce51464..ae1659f 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -27,7 +27,8 @@ SOURCES += main.cpp \ ../common/cache.cpp \ ../common/dastelefonbuch.cpp \ logwindow.cpp \ - listwidget.cpp + listwidget.cpp \ + ovimaps.cpp HEADERS += mainwindow.h \ searchdialog.h \ resultwindow.h \ @@ -53,7 +54,8 @@ HEADERS += mainwindow.h \ ../common/cache.h \ ../common/dastelefonbuch.h \ logwindow.h \ - listwidget.h + listwidget.h \ + ovimaps.h RESOURCES = icons.qrc ../common/translations.qrc TRANSLATIONS = ../common/translations/fi_FI.ts INCLUDEPATH += ../common diff --git a/src/gui/listwidget.cpp b/src/gui/listwidget.cpp index 39a6519..66930fa 100644 --- a/src/gui/listwidget.cpp +++ b/src/gui/listwidget.cpp @@ -16,6 +16,8 @@ * */ +#include +#include #include #include #include "listwidget.h" @@ -26,7 +28,7 @@ ListWidget::ListWidget(QWidget* parent): QTableWidget(parent) setColumnCount(1); verticalHeader()->hide(); horizontalHeader()->hide(); - setColumnWidth(0, 800); + setColumnWidth(0, QApplication::desktop()->availableGeometry().width()); setSelectionMode(QAbstractItemView::SingleSelection); } diff --git a/src/gui/logwindow.cpp b/src/gui/logwindow.cpp index 1fb8484..4197111 100644 --- a/src/gui/logwindow.cpp +++ b/src/gui/logwindow.cpp @@ -75,6 +75,7 @@ void LogWindow::loadLogItems() data["street"] = QVariant(logList.at(i).result.street); data["city"] = QVariant(logList.at(i).result.city); data["number"] = QVariant(logList.at(i).result.number); + data["country"] = QVariant(logList.at(i).result.country); list_->addWidget(createWidget(logList.at(i)), data); } @@ -100,6 +101,7 @@ void LogWindow::itemClicked(int index) details.street = data["street"].toString(); details.city = data["city"].toString(); details.number = data["number"].toString(); + details.country = data["country"].toString(); emit logItemSelected(details); } diff --git a/src/gui/main.cpp b/src/gui/main.cpp index e642575..56ea49c 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -22,7 +22,7 @@ #include "searchdialog.h" #include "resultwindow.h" #include "detailwindow.h" -#include "eniro.h" +#include "source.h" #include "settings.h" int main(int argc, char *argv[]) diff --git a/src/gui/ovimaps.cpp b/src/gui/ovimaps.cpp new file mode 100644 index 0000000..5f76f22 --- /dev/null +++ b/src/gui/ovimaps.cpp @@ -0,0 +1,255 @@ +/* + * This file is part of Jenirok. + * + * Jenirok is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Jenirok is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jenirok. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include "ovimaps.h" + +namespace +{ + QString const MAPS_SERVICE = "com.nokia.Navigation.NokiaMapsProvider"; + QString const MAPS_PATH = "/Provider"; + QString const MAPS_INTERFACE = "com.nokia.Navigation.MapProvider"; + QString const MAPS_ADDRESS_TO_LOCATIONS = "AddressToLocations"; + QString const MAPS_ADDRESS_TO_LOCATIONS_REPLY = "AddressToLocationsReply"; + QString const MAPS_LOCATION_TO_ADDRESSES = "LocationToAddresses"; + QString const MAPS_LOCATION_TO_ADDESSES_REPLY = "LocationToAddressReply"; + QString const MAPS_START = "ShowPlaceGeo"; + +} + +inline QDBusArgument& operator<<(QDBusArgument& argument, + const OviMaps::Location& location) +{ + argument.beginStructure(); + argument << location.latitude << location.longitude; + argument.endStructure(); + return argument; +} + +inline const QDBusArgument& operator>>(const QDBusArgument& argument, + OviMaps::Location& location) +{ + argument.beginStructure(); + argument >> location.latitude >> location.longitude; + argument.endStructure(); + return argument; +} + +Q_DECLARE_METATYPE(OviMaps::Location); +Q_DECLARE_METATYPE(QList); +Q_DECLARE_METATYPE(QList); + +OviMaps::OviMaps(QObject* parent): QObject(parent), +locationsTarget_(0), addressesTarget_(0), ready_(false), timer_(0) +{ + qDBusRegisterMetaType(); + qDBusRegisterMetaType< QList >(); + qDBusRegisterMetaType< QList >(); +} + +bool OviMaps::addressToLocations(OviMaps::Address const& address, + QList& locations) +{ + QDBusMessage msg = QDBusMessage::createMethodCall(MAPS_SERVICE, + MAPS_PATH, + MAPS_INTERFACE, + MAPS_ADDRESS_TO_LOCATIONS); + + QList arguments; + + QStringList data; + + data << address.number << "" << address.street << "" + << address.city << "" << "" << address.zipCode << address.country + << "" << "" << "" << "" << "" << ""; + + arguments.append(QVariant(data)); + arguments.append(QVariant(true)); + + msg.setArguments(arguments); + + QDBusMessage rep = QDBusConnection::sessionBus().call(msg); + + QDBusReply reply(rep); + + if(reply.isValid()) + { + QDBusObjectPath path = reply.value(); + locationsTarget_ = &locations; + QDBusConnection::sessionBus().connect(MAPS_SERVICE, + path.path(), + MAPS_INTERFACE, + MAPS_ADDRESS_TO_LOCATIONS_REPLY, + this, + SLOT(handleAddressToLocationsReply(QList))); + + bool ret = waitSignal(); + locationsTarget_ = 0; + return ret; + } + + return false; + +} + +bool OviMaps::locationToAddresses(Location const& location, QList
& address) +{ + QDBusMessage msg = QDBusMessage::createMethodCall(MAPS_SERVICE, + MAPS_PATH, + MAPS_INTERFACE, + MAPS_LOCATION_TO_ADDRESSES); + + QList arguments; + + arguments.append(QVariant(location.latitude)); + arguments.append(QVariant(location.longitude)); + arguments.append(QVariant(false)); + + msg.setArguments(arguments); + + QDBusMessage rep = QDBusConnection::sessionBus().call(msg); + + QDBusReply reply(rep); + + if(reply.isValid()) + { + QDBusObjectPath path = reply.value(); + addressesTarget_ = &address; + QDBusConnection::sessionBus().connect(MAPS_SERVICE, + path.path(), + MAPS_INTERFACE, + MAPS_LOCATION_TO_ADDESSES_REPLY, + this, + SLOT(handleLocationToAddressesReply(QList))); + + bool ret = waitSignal(); + addressesTarget_ = 0; + return ret; + } + + return false; +} + +bool OviMaps::openMaps(Address const& address) +{ + QList locations; + + if(!addressToLocations(address, locations) || locations.size() == 0) + { + return false; + } + + return openMaps(locations.at(0)); +} + +bool OviMaps::openMaps(Location const& location) +{ + QDBusMessage msg = QDBusMessage::createMethodCall(MAPS_SERVICE, + MAPS_PATH, + MAPS_INTERFACE, + MAPS_START); + + QList arguments; + + arguments.append(QVariant(location.latitude)); + arguments.append(QVariant(location.longitude)); + + uint val = 0; + + arguments.append(QVariant(val)); + + msg.setArguments(arguments); + + QDBusMessage rep = QDBusConnection::sessionBus().call(msg); + + if(rep.type() == QDBusMessage::ErrorMessage) + { + return false; + } + + return true; +} + +void OviMaps::timerEvent(QTimerEvent* event) +{ + Q_UNUSED(event); + + if(timer_) + { + killTimer(timer_); + timer_ = 0; + } +} + +void OviMaps::handleAddressToLocationsReply(QList locations) +{ + if(locationsTarget_) + { + *locationsTarget_ = locations; + ready_ = true; + } +} + +void OviMaps::handleLocationToAddressesReply(QList addresses) +{ + if(addressesTarget_) + { + for(int i = 0; i < addresses.size(); i++) + { + Address addr; + addr.street = addresses.at(i).at(2); + addr.number = addresses.at(i).at(0); + addr.zipCode = addresses.at(i).at(7); + addr.city = addresses.at(i).at(4); + addr.country = addresses.at(i).at(8); + + addressesTarget_->push_back(addr); + } + + ready_ = true; + } +} + +bool OviMaps::waitSignal() +{ + ready_ = false; + timer_ = startTimer(TIMEOUT); + + while(!ready_ && timer_) + { + QApplication::processEvents(QEventLoop::WaitForMoreEvents); + } + + if(!timer_) + { + return false; + } + else + { + killTimer(timer_); + timer_ = 0; + } + + return true; +} diff --git a/src/gui/ovimaps.h b/src/gui/ovimaps.h new file mode 100644 index 0000000..5063650 --- /dev/null +++ b/src/gui/ovimaps.h @@ -0,0 +1,72 @@ +/* + * This file is part of Jenirok. + * + * Jenirok is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Jenirok is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jenirok. If not, see . + * + */ + +#ifndef OVIMAPS_H +#define OVIMAPS_H + +#include +#include +#include +#include + +class OviMaps : public QObject +{ + Q_OBJECT + +public: + + struct Address + { + QString street; + QString number; + QString zipCode; + QString city; + QString country; + }; + + struct Location + { + double latitude; + double longitude; + }; + + static int const TIMEOUT = 10000; + + OviMaps(QObject* parent = 0); + bool addressToLocations(Address const& address, QList& locations); + bool locationToAddresses(Location const& location, QList
& address); + bool openMaps(Address const& address); + bool openMaps(Location const& location); + +protected: + virtual void timerEvent(QTimerEvent* event); + +private slots: + void handleAddressToLocationsReply(QList); + void handleLocationToAddressesReply(QList addresses); + +private: + bool waitSignal(); + QList* locationsTarget_; + QList
* addressesTarget_; + bool ready_; + int timer_; + +}; + +#endif diff --git a/src/gui/resultwindow.cpp b/src/gui/resultwindow.cpp index adbd404..e9da90a 100644 --- a/src/gui/resultwindow.cpp +++ b/src/gui/resultwindow.cpp @@ -133,6 +133,7 @@ void ResultWindow::resultAvailable(Source::Result const& result, data["street"] = QVariant(result.street); data["city"] = QVariant(result.city); data["number"] = QVariant(result.number); + data["country"] = QVariant(result.country); item->setData(Qt::UserRole, QVariant(data)); @@ -189,6 +190,7 @@ void ResultWindow::itemClicked(QListWidgetItem* item) details.street = data["street"].toString(); details.city = data["city"].toString(); details.number = data["number"].toString(); + details.country = data["country"].toString(); emit itemSelected(details); }