LocationDialog.cpp   LocationDialog.cpp 
skipping to change at line 347 skipping to change at line 347
// For caching // For caching
lastPlanet = loc.planetName; lastPlanet = loc.planetName;
} }
void LocationDialog::populatePlanetList() void LocationDialog::populatePlanetList()
{ {
Q_ASSERT(ui->planetNameComboBox); Q_ASSERT(ui->planetNameComboBox);
QComboBox* planets = ui->planetNameComboBox; QComboBox* planets = ui->planetNameComboBox;
SolarSystem* ssystem = GETSTELMODULE(SolarSystem); SolarSystem* ssystem = GETSTELMODULE(SolarSystem);
QStringList planetNames(ssystem->getAllPlanetEnglishNames()); QList<PlanetP> ss = ssystem->getAllPlanets();
const StelTranslator& trans = StelApp::getInstance().getLocaleMgr().
getSkyTranslator();
//Save the current selection to be restored later //Save the current selection to be restored later
planets->blockSignals(true); planets->blockSignals(true);
int index = planets->currentIndex(); int index = planets->currentIndex();
QVariant selectedPlanetId = planets->itemData(index); QVariant selectedPlanetId = planets->itemData(index);
planets->clear(); planets->clear();
//For each planet, display the localized name and store the original as user //For each planet, display the localized name and store the original as user
//data. Unfortunately, there's no other way to do this than with a c ycle. //data. Unfortunately, there's no other way to do this than with a c ycle.
foreach(const QString& name, planetNames) foreach(const PlanetP& p, ss)
{ {
planets->addItem(trans.qtranslate(name), name); planets->addItem(p->getNameI18n(), p->getEnglishName());
} }
//Restore the selection //Restore the selection
index = planets->findData(selectedPlanetId, Qt::UserRole, Qt::MatchC aseSensitive); index = planets->findData(selectedPlanetId, Qt::UserRole, Qt::MatchC aseSensitive);
planets->setCurrentIndex(index); planets->setCurrentIndex(index);
planets->model()->sort(0); planets->model()->sort(0);
planets->blockSignals(false); planets->blockSignals(false);
} }
void LocationDialog::populateCountryList() void LocationDialog::populateCountryList()
{ {
skipping to change at line 612 skipping to change at line 611
StelApp::getInstance().getLocationMgr().saveUserLocation(loc); StelApp::getInstance().getLocationMgr().saveUserLocation(loc);
isEditingNew=false; isEditingNew=false;
ui->addLocationToListPushButton->setEnabled(false); ui->addLocationToListPushButton->setEnabled(false);
const QAbstractItemModel* model = ui->citiesListView->model(); const QAbstractItemModel* model = ui->citiesListView->model();
const QString id = loc.getID(); const QString id = loc.getID();
for (int i=0;i<model->rowCount();++i) for (int i=0;i<model->rowCount();++i)
{ {
if (model->index(i,0).data()==id) if (model->index(i,0).data()==id)
{ {
ui->citiesListView->scrollTo(model->index(i,0)); //FIXME: scroll caused artifcats in the GUI for long
lists. WTF????
//ui->citiesListView->scrollTo(model->index(i,0));
ui->citiesListView->selectionModel()->select(model-> index(i,0), QItemSelectionModel::ClearAndSelect|QItemSelectionModel::Rows); ui->citiesListView->selectionModel()->select(model-> index(i,0), QItemSelectionModel::ClearAndSelect|QItemSelectionModel::Rows);
setPositionFromList(model->index(i,0)); setPositionFromList(model->index(i,0));
disconnectEditSignals(); disconnectEditSignals();
ui->citySearchLineEdit->setFocus(); ui->citySearchLineEdit->setFocus();
connectEditSignals(); connectEditSignals();
break; break;
} }
} }
} }
 End of changes. 4 change blocks. 
6 lines changed or deleted 6 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/