From 2b1c75a584ef57b405fcc2564d86029e535957e1 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Sun, 17 Nov 2013 12:31:09 +0100 Subject: Use date format from system locale Instead of hard coding a American date format, let qt use whatever the locale suggests. Fixes #248 Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 6 +++--- qt-ui/maintab.ui | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 60b4add3a..6d22a8dd3 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -169,7 +169,7 @@ void MainTab::enableEdition(EditMode newEditMode) notesBackup[mydive].coordinates = ui.coordinates->text(); notesBackup[mydive].airtemp = get_temperature_string(mydive->airtemp, true); notesBackup[mydive].watertemp = get_temperature_string(mydive->watertemp, true); - notesBackup[mydive].datetime = QDateTime::fromTime_t(mydive->when - gettimezoneoffset()).toString(QString("M/d/yy h:mm")); + notesBackup[mydive].datetime = QDateTime::fromTime_t(mydive->when - gettimezoneoffset()).toString(); char buf[1024]; taglist_get_tagstring(mydive->tag_list, buf, 1024); notesBackup[mydive].tags = QString(buf); @@ -465,7 +465,7 @@ void MainTab::acceptChanges() notesBackup[curr].rating != ui.visibility->currentStars() || notesBackup[curr].airtemp != ui.airtemp->text() || notesBackup[curr].watertemp != ui.watertemp->text() || - notesBackup[curr].datetime != ui.dateTimeEdit->dateTime().toString(QString("M/d/yy h:mm")) || + notesBackup[curr].datetime != ui.dateTimeEdit->dateTime().toString() || notesBackup[curr].visibility != ui.rating->currentStars() || notesBackup[curr].tags != ui.tagWidget->text()) { mark_divelist_changed(TRUE); @@ -581,7 +581,7 @@ void MainTab::rejectChanges() ui.tagWidget->setText(notesBackup[curr].tags); // it's a little harder to do the right thing for the date time widget if (curr) { - ui.dateTimeEdit->setDateTime(QDateTime::fromString(notesBackup[curr].datetime, QString("M/d/y h:mm"))); + ui.dateTimeEdit->setDateTime(QDateTime::fromString(notesBackup[curr].datetime)); } else { QLineEdit *le = ui.dateTimeEdit->findChild(); le->setText(""); diff --git a/qt-ui/maintab.ui b/qt-ui/maintab.ui index 6ab9f9baf..72e1e5338 100644 --- a/qt-ui/maintab.ui +++ b/qt-ui/maintab.ui @@ -76,9 +76,6 @@ - - M/d/yy h:mm - true -- cgit v1.2.3-70-g09d2