| 93 | } |
| 94 | |
| 95 | void |
| 96 | LocationConfigTab::populateLocations(void) |
| 97 | { |
| 98 | Suscan::Singleton *sus = Suscan::Singleton::get_instance(); |
| 99 | int index = 0; |
| 100 | |
| 101 | for (auto i = sus->getFirstLocation(); i != sus->getLastLocation(); ++i) { |
| 102 | QString country; |
| 103 | QListWidgetItem *item = new QListWidgetItem(i->getLocationName()); |
| 104 | this->ui->cityListWidget->addItem(item); |
| 105 | |
| 106 | country = QString::fromStdString(i->country); |
| 107 | |
| 108 | if (this->countryList.find(country) == this->countryList.end()) |
| 109 | this->countryList.insert(country, -1); |
| 110 | } |
| 111 | |
| 112 | for (auto p = this->countryList.begin(); p != this->countryList.end(); ++p) { |
| 113 | *p = index++; |
| 114 | this->ui->countryCombo->insertItem(*p, p.key()); |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | void |
| 119 | LocationConfigTab::paintMapCoords(double lat, double lon) |
no test coverage detected