Fixed changing dates with the new date widget.

The maintab was connecting with an invalid slot on the
new date widget, QDateTime instead of QDate

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-06-26 14:57:25 -03:00 committed by Dirk Hohndel
parent 1e2349e794
commit 81fd56b16f
2 changed files with 7 additions and 5 deletions

View file

@ -948,13 +948,14 @@ void MainTab::validate_temp_field(QLineEdit *tempField, const QString &text)
}
}
void MainTab::on_dateEdit_dateChanged(const QDateTime &datetime)
void MainTab::on_dateEdit_dateChanged(const QDate &date)
{
if (editMode == NONE)
return;
QDateTime dateTimeUtc(datetime);
dateTimeUtc.setTimeSpec(Qt::UTC);
editedDive.when = dateTimeUtc.toTime_t();
QDateTime dateTime = QDateTime::fromTime_t(editedDive.when);
dateTime.setTimeSpec(Qt::UTC);
dateTime.setDate(date);
editedDive.when = dateTime.toTime_t();
markChangedWidget(ui.dateEdit);
}
@ -963,6 +964,7 @@ void MainTab::on_timeEdit_timeChanged(const QTime &time)
if (editMode == NONE)
return;
QDateTime dateTime = QDateTime::fromTime_t(editedDive.when);
dateTime.setTimeSpec(Qt::UTC);
dateTime.setTime(time);
editedDive.when = dateTime.toTime_t();
markChangedWidget(ui.timeEdit);

View file

@ -68,7 +68,7 @@ slots:
void on_airtemp_textChanged(const QString &text);
void on_watertemp_textChanged(const QString &text);
void validate_temp_field(QLineEdit *tempField, const QString &text);
void on_dateEdit_dateChanged(const QDateTime &datetime);
void on_dateEdit_dateChanged(const QDate &date);
void on_timeEdit_timeChanged(const QTime & time);
void on_rating_valueChanged(int value);
void on_visibility_valueChanged(int value);