Fix the connections for the Location Edit

The LocationEdit now correctly connects to the QComboBox signals, not the
QLineEdit signals.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-05-29 23:05:32 -03:00 committed by Dirk Hohndel
parent ac6a7ab24e
commit b0d7d0f3b9
2 changed files with 13 additions and 4 deletions

View file

@ -760,7 +760,6 @@ void MainTab::acceptChanges()
ui.dateEdit->setEnabled(true);
hideMessage();
ui.equipmentTab->setEnabled(true);
on_location_editingFinished(); // complete coordinates *before* saving
if (editMode == ADD) {
// We need to add the dive we just created to the dive list and select it.
// Easy, right?
@ -1255,7 +1254,13 @@ void MainTab::on_tagWidget_textChanged()
markChangedWidget(ui.tagWidget);
}
void MainTab::on_location_textChanged(const QString &text)
/* TODO: This seems wrong.
* The code here below should be triggered when the user changes
* the Location in the combobox (this was a LineEdit, but the code is
* mostly the same ). Check the currentTrip there to see if it`s being
* correctly triggered.
*/
void MainTab::on_location_currentTextChanged(const QString &text)
{
if (editMode == IGNORE || acceptingEdit == true)
return;
@ -1263,9 +1268,13 @@ void MainTab::on_location_textChanged(const QString &text)
free(displayedTrip.location);
displayedTrip.location = strdup(qPrintable(ui.location->currentText()));
}
if (current_dive && text == QString(get_dive_site_by_uuid(current_dive->dive_site_uuid)->name))
return;
markChangedWidget(ui.location);
}
/* TODO:
* Check if we need to move this to location management.
// If we have GPS data for the location entered, add it.
void MainTab::on_location_editingFinished()
{
@ -1277,6 +1286,7 @@ void MainTab::on_location_editingFinished()
displayed_dive.dive_site_uuid = uuid;
free((void*)name);
}
*/
void MainTab::on_suit_textChanged(const QString &text)
{

View file

@ -65,8 +65,7 @@ slots:
void updateDiveInfo(bool clear = false);
void acceptChanges();
void rejectChanges();
void on_location_textChanged(const QString &text);
void on_location_editingFinished();
void on_location_currentTextChanged(const QString &text);
void on_divemaster_textChanged();
void on_buddy_textChanged();
void on_suit_textChanged(const QString &text);