mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Code cleanup
This commit is contained in:
parent
fea1f61235
commit
7bfae8a398
@ -45,6 +45,8 @@ static QFrame *line()
|
|||||||
}
|
}
|
||||||
#endif // Q_OS_MAC
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
|
typedef QList<KV<int, QString> > ProjectionList;
|
||||||
|
|
||||||
void OptionsDialog::automaticPauseDetectionSet(bool set)
|
void OptionsDialog::automaticPauseDetectionSet(bool set)
|
||||||
{
|
{
|
||||||
_pauseInterval->setEnabled(!set);
|
_pauseInterval->setEnabled(!set);
|
||||||
@ -53,11 +55,15 @@ void OptionsDialog::automaticPauseDetectionSet(bool set)
|
|||||||
|
|
||||||
QWidget *OptionsDialog::createMapPage()
|
QWidget *OptionsDialog::createMapPage()
|
||||||
{
|
{
|
||||||
_outputProjection = new ProjectionComboBox(GCS::WGS84List()
|
ProjectionList outputProjections(GCS::WGS84List() + Conversion::list());
|
||||||
+ Conversion::list());
|
ProjectionList inputProjections(GCS::list() + PCS::list());
|
||||||
|
std::sort(outputProjections.begin(), outputProjections.end());
|
||||||
|
std::sort(inputProjections.begin(), inputProjections.end());
|
||||||
|
|
||||||
|
_outputProjection = new ProjectionComboBox(outputProjections);
|
||||||
_outputProjection->setCurrentIndex(_outputProjection->findData(
|
_outputProjection->setCurrentIndex(_outputProjection->findData(
|
||||||
_options.outputProjection));
|
_options.outputProjection));
|
||||||
_inputProjection = new ProjectionComboBox(GCS::list() + PCS::list());
|
_inputProjection = new ProjectionComboBox(inputProjections);
|
||||||
_inputProjection->setCurrentIndex(_inputProjection->findData(
|
_inputProjection->setCurrentIndex(_inputProjection->findData(
|
||||||
_options.inputProjection));
|
_options.inputProjection));
|
||||||
|
|
||||||
|
@ -6,11 +6,8 @@ ProjectionComboBox::ProjectionComboBox(const QList<KV<int, QString> > &list,
|
|||||||
setSizeAdjustPolicy(AdjustToMinimumContentsLengthWithIcon);
|
setSizeAdjustPolicy(AdjustToMinimumContentsLengthWithIcon);
|
||||||
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||||
|
|
||||||
QList<KV<int, QString> > projs(list);
|
|
||||||
std::sort(projs.begin(), projs.end());
|
|
||||||
|
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
const KV<int, QString> &proj = projs.at(i);
|
const KV<int, QString> &proj = list.at(i);
|
||||||
QString text = QString::number(proj.key()) + " - " + proj.value();
|
QString text = QString::number(proj.key()) + " - " + proj.value();
|
||||||
addItem(text, QVariant(proj.key()));
|
addItem(text, QVariant(proj.key()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user