diff --git a/ui/qt/models/atap_data_model.cpp b/ui/qt/models/atap_data_model.cpp index cf008e4a42f..5a836262f05 100644 --- a/ui/qt/models/atap_data_model.cpp +++ b/ui/qt/models/atap_data_model.cpp @@ -359,6 +359,10 @@ QVariant EndpointDataModel::headerData(int section, Qt::Orientation orientation, return tr("Country"); break; case ENDP_COLUMN_GEO_CITY: return tr("City"); break; + case ENDP_COLUMN_GEO_LATITUDE: + return tr("Latitude"); break; + case ENDP_COLUMN_GEO_LONGITUDE: + return tr("Longitude"); break; case ENDP_COLUMN_GEO_AS_NUM: return tr("AS Number"); break; case ENDP_COLUMN_GEO_AS_ORG: @@ -465,6 +469,16 @@ QVariant EndpointDataModel::data(const QModelIndex &idx, int role) const return QVariant(mmdb_lookup->city); } return QVariant(); + case ENDP_COLUMN_GEO_LATITUDE: + if (mmdb_lookup && mmdb_lookup->found && mmdb_lookup->latitude >= -90.0 && mmdb_lookup->latitude <= 90.0) { + return role == Qt::DisplayRole ? QString("%L1" UTF8_DEGREE_SIGN).arg(mmdb_lookup->latitude) : QVariant(mmdb_lookup->latitude); + } + return QVariant(); + case ENDP_COLUMN_GEO_LONGITUDE: + if (mmdb_lookup && mmdb_lookup->found && mmdb_lookup->longitude >= -180.0 && mmdb_lookup->longitude <= 180.0) { + return role == Qt::DisplayRole ? QString("%L1" UTF8_DEGREE_SIGN).arg(mmdb_lookup->longitude) : QVariant(mmdb_lookup->longitude); + } + return QVariant(); case ENDP_COLUMN_GEO_AS_NUM: if (mmdb_lookup && mmdb_lookup->found && mmdb_lookup->as_number) { return QVariant(mmdb_lookup->as_number); diff --git a/ui/qt/models/atap_data_model.h b/ui/qt/models/atap_data_model.h index fd55b0f57b7..89dcd550418 100644 --- a/ui/qt/models/atap_data_model.h +++ b/ui/qt/models/atap_data_model.h @@ -261,6 +261,8 @@ class EndpointDataModel : public ATapDataModel ENDP_NUM_COLUMNS, ENDP_COLUMN_GEO_COUNTRY = ENDP_NUM_COLUMNS, ENDP_COLUMN_GEO_CITY, + ENDP_COLUMN_GEO_LATITUDE, + ENDP_COLUMN_GEO_LONGITUDE, ENDP_COLUMN_GEO_AS_NUM, ENDP_COLUMN_GEO_AS_ORG, ENDP_NUM_GEO_COLUMNS