diff options
author | Anton Lundin <glance@acc.umu.se> | 2013-11-17 12:31:09 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-17 07:08:53 -0800 |
commit | 2b1c75a584ef57b405fcc2564d86029e535957e1 (patch) | |
tree | f57eab1494834f55b77d61f24479aafef8347cc0 /qt-ui/maintab.cpp | |
parent | 612c5713b406d0805653234dce63778e92c29c61 (diff) | |
download | subsurface-2b1c75a584ef57b405fcc2564d86029e535957e1.tar.gz |
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 <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<QLineEdit*>(); le->setText(""); |