From 8ac53dcbc4c51e5839f8f3c313bb230927ab906d Mon Sep 17 00:00:00 2001 From: rong wang Date: Thu, 20 Feb 2025 16:42:14 +0800 Subject: [PATCH 1/4] fix: fix fail to open .docx file Qt5 supports using `QProcess::start()` to execute a command line, but in qt6, this function has been moved to `QProcess::startCommand()`, let's modify it accordingly. Log: fix fail to open .docx file Bug: https://pms.uniontech.com/bug-view-304083.html --- reader/document/Model.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reader/document/Model.cpp b/reader/document/Model.cpp index 9a638b76..bb8748bc 100755 --- a/reader/document/Model.cpp +++ b/reader/document/Model.cpp @@ -70,7 +70,7 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & qDebug() << "正在解压文档..." << targetDoc; QString unzipCommand = "unzip " + targetDoc; qDebug() << "执行命令: " << unzipCommand; - decompressor.start(unzipCommand); + decompressor.startCommand(unzipCommand); if (!decompressor.waitForStarted()) { qInfo() << "start unzip failed"; error = deepin_reader::Document::ConvertFailed; @@ -111,7 +111,7 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & QString pandocCommand = QString("pandoc %1 --data-dir=%2 -o %3").arg(targetDoc).arg(pandocDataDir).arg(tmpHtmlFilePath); qDebug() << "执行命令: " << pandocCommand; - converter.start(pandocCommand); + converter.startCommand(pandocCommand); if (!converter.waitForStarted()) { qInfo() << "start pandoc failed"; error = deepin_reader::Document::ConvertFailed; @@ -144,7 +144,7 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & QString htmltopdfCommand = prefix + "/lib/deepin-reader/htmltopdf " + tmpHtmlFilePath + " " + realFilePath; qDebug() << "执行命令: " << htmltopdfCommand; - converter2.start(htmltopdfCommand); + converter2.startCommand(htmltopdfCommand); if (!converter2.waitForStarted()) { qInfo() << "start htmltopdf failed"; error = deepin_reader::Document::ConvertFailed; From ab1e3c78570252577b199e1e86311d1c142b6394 Mon Sep 17 00:00:00 2001 From: rong wang Date: Thu, 20 Feb 2025 17:10:11 +0800 Subject: [PATCH 2/4] fix: fix app stuck when checking document info Let's use `QRecursiveMutex` to support recursive locking. Log: fix app stuck when checking document info Bug: https://pms.uniontech.com/bug-view-304111.html --- 3rdparty/deepin-pdfium/include/dpdfglobal.h | 4 ++-- 3rdparty/deepin-pdfium/src/dpdfglobal.cpp | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/3rdparty/deepin-pdfium/include/dpdfglobal.h b/3rdparty/deepin-pdfium/include/dpdfglobal.h index 4b616196..f35ebbb7 100755 --- a/3rdparty/deepin-pdfium/include/dpdfglobal.h +++ b/3rdparty/deepin-pdfium/include/dpdfglobal.h @@ -6,7 +6,7 @@ #include #include #include -#include +#include #ifndef BUILD_DEEPDF_STATIC # if defined(BUILD_DEEPDF_LIB) @@ -46,7 +46,7 @@ class DPdfGlobal }; //pdfium即使不同文档之间loadpage和renderpage也不是线程安全,需要加锁 -class DPdfMutexLocker : public QMutexLocker +class DPdfMutexLocker : public QMutexLocker { public: explicit DPdfMutexLocker(const QString &tmpLog); diff --git a/3rdparty/deepin-pdfium/src/dpdfglobal.cpp b/3rdparty/deepin-pdfium/src/dpdfglobal.cpp index 502a2dcf..4e5e7779 100755 --- a/3rdparty/deepin-pdfium/src/dpdfglobal.cpp +++ b/3rdparty/deepin-pdfium/src/dpdfglobal.cpp @@ -1,7 +1,5 @@ #include #include -#include -#include #include #include "dpdfglobal.h" #include "public/fpdfview.h" @@ -47,9 +45,9 @@ QString DPdfGlobal::textCodeType(const char *text) return encodeind; } -Q_GLOBAL_STATIC_WITH_ARGS(QMutex, pdfMutex, ()); +Q_GLOBAL_STATIC(QRecursiveMutex, pdfMutex); -DPdfMutexLocker::DPdfMutexLocker(const QString &tmpLog): QMutexLocker(pdfMutex()) +DPdfMutexLocker::DPdfMutexLocker(const QString &tmpLog): QMutexLocker(pdfMutex()) { m_log = tmpLog; qInfo() << m_log + " begin "; From 08842a5efde63a6e0750586479729d149ae01e0f Mon Sep 17 00:00:00 2001 From: rong wang Date: Thu, 20 Feb 2025 18:51:01 +0800 Subject: [PATCH 3/4] chore: update linglong.yaml for translations Update linglong.yaml for translations. Log: Update linglong.yaml for translations --- linglong.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/linglong.yaml b/linglong.yaml index 12cab7e2..f3667678 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -25,6 +25,7 @@ build: | find . -type f -name "src.pro" -exec sed -i '33i INCLUDEPATH += $$INCPATHS' {} + find . -type f -name "htmltopdf.pro" -exec sed -i '35i INCLUDEPATH += $$INCPATHS' {} + sed -i '2i INCLUDEPATH += $$INCPATHS' reader/reader.pro + sed -i 's|/usr/lib/qt6/bin/lrelease|lrelease|g' translate_generation.sh # 构建 VERSION=$(head -1 debian/changelog | awk -F'[()]' '{print $2}') From a5b61aa4bf094714a9f9b5be8d939ad765c024b4 Mon Sep 17 00:00:00 2001 From: rong wang Date: Thu, 20 Feb 2025 18:58:03 +0800 Subject: [PATCH 4/4] chore: Bump version to 6.5.13 Bump version to 6.5.13 Log: Bump version to 6.5.13 --- arm64/linglong.yaml | 2 +- debian/changelog | 9 +++++++++ linglong.yaml | 2 +- loong64/linglong.yaml | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/arm64/linglong.yaml b/arm64/linglong.yaml index 7b0afcb8..f0096778 100644 --- a/arm64/linglong.yaml +++ b/arm64/linglong.yaml @@ -7,7 +7,7 @@ version: "1" package: id: org.deepin.reader name: "deepin-reader" - version: 6.5.12.1 + version: 6.5.13.1 kind: app description: | reader for deepin os. diff --git a/debian/changelog b/debian/changelog index 5577b185..a34ed4f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +deepin-reader (6.5.13) unstable; urgency=medium + + * update version to 6.5.13 + * fix: fix fail to open .docx file + * fix: fix app stuck when checking document info + * chore: update linglong.yaml for translations + + -- wangrong Thu, 20 Feb 2025 18:52:13 +0800 + deepin-reader (6.5.12) unstable; urgency=medium * Update version to 6.5.12 diff --git a/linglong.yaml b/linglong.yaml index f3667678..6313c9dc 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -7,7 +7,7 @@ version: "1" package: id: org.deepin.reader name: "deepin-reader" - version: 6.5.12.1 + version: 6.5.13.1 kind: app description: | reader for deepin os. diff --git a/loong64/linglong.yaml b/loong64/linglong.yaml index 48fa31b0..3c73368f 100755 --- a/loong64/linglong.yaml +++ b/loong64/linglong.yaml @@ -7,7 +7,7 @@ version: "1" package: id: org.deepin.reader name: "deepin-reader" - version: 6.5.12.1 + version: 6.5.13.1 kind: app description: | reader for deepin os.