From 3ca6ff471dd1df4c462d1e49256554da830ce91e Mon Sep 17 00:00:00 2001 From: Jimi Huotari Date: Thu, 4 Jul 2024 01:07:34 +0300 Subject: [PATCH] modules: use 'fromSecsSinceEpoch' instead of 'fromTime_t' Required for Qt 6, and 'fromTime_t' has become obsolete already during Qt 5 times. - https://code.qt.io/cgit/qt/qtbase.git/commit/?id=8c8eae279d5 Picked from: https://github.com/OtterBrowser/otter-browser/pull/1770 --- .../importers/opera/OperaBookmarksImportDataExchanger.cpp | 4 ++-- src/modules/importers/opera/OperaNotesImportDataExchanger.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/importers/opera/OperaBookmarksImportDataExchanger.cpp b/src/modules/importers/opera/OperaBookmarksImportDataExchanger.cpp index 5c08d7ec6d..4523855102 100644 --- a/src/modules/importers/opera/OperaBookmarksImportDataExchanger.cpp +++ b/src/modules/importers/opera/OperaBookmarksImportDataExchanger.cpp @@ -285,11 +285,11 @@ void OperaBookmarksImportJob::start() } else if (line.startsWith(QLatin1String("\tCREATED="))) { - bookmark->setData(QDateTime::fromTime_t(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeAddedRole); + bookmark->setData(QDateTime::fromSecsSinceEpoch(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeAddedRole); } else if (line.startsWith(QLatin1String("\tVISITED="))) { - bookmark->setData(QDateTime::fromTime_t(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeVisitedRole); + bookmark->setData(QDateTime::fromSecsSinceEpoch(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeVisitedRole); } } } diff --git a/src/modules/importers/opera/OperaNotesImportDataExchanger.cpp b/src/modules/importers/opera/OperaNotesImportDataExchanger.cpp index 008395f21f..d0b09cb49d 100644 --- a/src/modules/importers/opera/OperaNotesImportDataExchanger.cpp +++ b/src/modules/importers/opera/OperaNotesImportDataExchanger.cpp @@ -243,7 +243,7 @@ bool OperaNotesImportDataExchanger::importData(const QString &path) } else if (line.startsWith(QLatin1String("\tCREATED="))) { - note->setData(QDateTime::fromTime_t(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeAddedRole); + note->setData(QDateTime::fromSecsSinceEpoch(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeAddedRole); } } }