parent
1e6f26adb6
commit
91279eb90e
|
@ -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);
|
||||
|
|
|
@ -261,6 +261,8 @@ public:
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue