Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions devel/705.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[705] 解决 WASM 环境下`QDateTime` UTC 处理问题
# What
在 Qt WASM 环境中,`QTimeZone` API 存在差异,原实现所用的 `QTimeZone::utc()` 的无法使用

# How
在 WASM 平台使用 `toUTC()`
5 changes: 5 additions & 0 deletions src/Mogan/Cache/thumbnail_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ ThumbnailLoader::processQueue () {
lmStr, "ddd, dd MMM yyyy hh:mm:ss 'GMT'");
}
if (lastModified.isValid ()) {
#ifdef OS_WASM
// WASM version of Qt seems to have difference API on this
lastModified= lastModified.toUTC ();
#else
lastModified.setTimeZone (QTimeZone::utc ());
#endif
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/Plugins/Qt/qt_pdf_preview_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,12 @@ QTPdfPreviewWidget::processNetworkReply (QPointer<QNetworkReply> reply) {
lastModified= QDateTime::fromString (lastModStr, Qt::RFC2822Date);
}
if (lastModified.isValid ()) {
#ifdef OS_WASM
// WASM version of Qt seems to have difference API on this
lastModified= lastModified.toUTC ();
#else
lastModified.setTimeZone (QTimeZone::utc ());
#endif
}
}

Expand Down
Loading