mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Qt6: update to newer APIs for QDateTime
Fortunately, these were already available in Qt5. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6f46238fc4
commit
e29ecf2c9a
2 changed files with 6 additions and 6 deletions
|
@ -753,9 +753,9 @@ timestamp_t dateTimeToTimestamp(const QDateTime &t)
|
||||||
QString render_seconds_to_string(int seconds)
|
QString render_seconds_to_string(int seconds)
|
||||||
{
|
{
|
||||||
if (seconds % 60 == 0)
|
if (seconds % 60 == 0)
|
||||||
return QDateTime::fromTime_t(seconds).toUTC().toString("h:mm");
|
return QDateTime::fromSecsSinceEpoch(seconds, Qt::UTC).toUTC().toString("h:mm");
|
||||||
else
|
else
|
||||||
return QDateTime::fromTime_t(seconds).toUTC().toString("h:mm:ss");
|
return QDateTime::fromSecsSinceEpoch(seconds, Qt::UTC).toUTC().toString("h:mm:ss");
|
||||||
}
|
}
|
||||||
|
|
||||||
int parseDurationToSeconds(const QString &text)
|
int parseDurationToSeconds(const QString &text)
|
||||||
|
|
|
@ -144,7 +144,7 @@ void ShiftImageTimesDialog::syncCameraClicked()
|
||||||
ui.DCImage->setScene(scene);
|
ui.DCImage->setScene(scene);
|
||||||
|
|
||||||
dcImageEpoch = picture_get_timestamp(qPrintable(fileNames.at(0)));
|
dcImageEpoch = picture_get_timestamp(qPrintable(fileNames.at(0)));
|
||||||
QDateTime dcDateTime = QDateTime::fromTime_t(dcImageEpoch, Qt::UTC);
|
QDateTime dcDateTime = QDateTime::fromSecsSinceEpoch(dcImageEpoch, Qt::UTC);
|
||||||
ui.dcTime->setDateTime(dcDateTime);
|
ui.dcTime->setDateTime(dcDateTime);
|
||||||
connect(ui.dcTime, SIGNAL(dateTimeChanged(const QDateTime &)), this, SLOT(dcDateTimeChanged(const QDateTime &)));
|
connect(ui.dcTime, SIGNAL(dateTimeChanged(const QDateTime &)), this, SLOT(dcDateTimeChanged(const QDateTime &)));
|
||||||
}
|
}
|
||||||
|
@ -213,8 +213,8 @@ void ShiftImageTimesDialog::updateInvalid()
|
||||||
bool allValid = true;
|
bool allValid = true;
|
||||||
ui.warningLabel->hide();
|
ui.warningLabel->hide();
|
||||||
ui.invalidFilesText->hide();
|
ui.invalidFilesText->hide();
|
||||||
QDateTime time_first = QDateTime::fromTime_t(first_selected_dive()->when, Qt::UTC);
|
QDateTime time_first = QDateTime::fromSecsSinceEpoch(first_selected_dive()->when, Qt::UTC);
|
||||||
QDateTime time_last = QDateTime::fromTime_t(last_selected_dive()->when, Qt::UTC);
|
QDateTime time_last = QDateTime::fromSecsSinceEpoch(last_selected_dive()->when, Qt::UTC);
|
||||||
if (first_selected_dive() == last_selected_dive()) {
|
if (first_selected_dive() == last_selected_dive()) {
|
||||||
ui.invalidFilesText->setPlainText(tr("Selected dive date/time") + ": " + time_first.toString());
|
ui.invalidFilesText->setPlainText(tr("Selected dive date/time") + ": " + time_first.toString());
|
||||||
} else {
|
} else {
|
||||||
|
@ -229,7 +229,7 @@ void ShiftImageTimesDialog::updateInvalid()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// We've found an invalid image
|
// We've found an invalid image
|
||||||
time_first.setTime_t(timestamps[i] + m_amount);
|
time_first.setSecsSinceEpoch(timestamps[i] + m_amount);
|
||||||
if (timestamps[i] == 0)
|
if (timestamps[i] == 0)
|
||||||
ui.invalidFilesText->append(fileNames[i] + " - " + tr("No Exif date/time found"));
|
ui.invalidFilesText->append(fileNames[i] + " - " + tr("No Exif date/time found"));
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue