From 37f51ff6d7aa004009f2ca48fe342561647e059e Mon Sep 17 00:00:00 2001 From: Constantin Shalnev Date: Thu, 11 Feb 2016 19:49:16 +0300 Subject: [PATCH] [new-downloader] Fixed showing of countries names --- qt/update_dialog.cpp | 11 +++++++++-- qt/update_dialog.hpp | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/qt/update_dialog.cpp b/qt/update_dialog.cpp index 1f21f9fcd8..185b308720 100644 --- a/qt/update_dialog.cpp +++ b/qt/update_dialog.cpp @@ -311,10 +311,17 @@ namespace qt // SetRowColor(*item, rowColor); } - QTreeWidgetItem * UpdateDialog::CreateTreeItem(TCountryId const & countryId, QTreeWidgetItem * parent) + QString UpdateDialog::GetNodeName(storage::TCountryId const & countryId) { // QString const text = QString::fromUtf8(GetStorage().CountryName(countryId).c_str()); // ??? - QString const text = countryId.c_str(); + storage::NodeAttrs attrs; + GetStorage().GetNodeAttrs(countryId, attrs); + return attrs.m_nodeLocalName.c_str(); + } + + QTreeWidgetItem * UpdateDialog::CreateTreeItem(TCountryId const & countryId, QTreeWidgetItem * parent) + { + QString const text = GetNodeName(countryId); QTreeWidgetItem * item = new QTreeWidgetItem(parent, QStringList(text)); item->setData(KColumnIndexCountry, Qt::UserRole, QVariant(countryId.c_str())); diff --git a/qt/update_dialog.hpp b/qt/update_dialog.hpp index 1a998a851f..8e37cbe9b1 100644 --- a/qt/update_dialog.hpp +++ b/qt/update_dialog.hpp @@ -48,6 +48,7 @@ namespace qt void FillTreeImpl(QTreeWidgetItem * parent, storage::TCountryId const & countryId, string const & filter); void UpdateRowWithCountryInfo(storage::TCountryId const & countryId); void UpdateRowWithCountryInfo(QTreeWidgetItem * item, storage::TCountryId const & countryId); + QString GetNodeName(storage::TCountryId const & countryId); QTreeWidgetItem * CreateTreeItem(storage::TCountryId const & countryId, QTreeWidgetItem * parent); vector GetTreeItemsByCountryId(storage::TCountryId const & countryId);