Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bugs #142

Merged
merged 4 commits into from
Feb 20, 2025
Merged
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
4 changes: 2 additions & 2 deletions 3rdparty/deepin-pdfium/include/dpdfglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <QDebug>
#include <QElapsedTimer>
#include <QRectF>
#include <QMutex>
#include <QRecursiveMutex>

#ifndef BUILD_DEEPDF_STATIC
# if defined(BUILD_DEEPDF_LIB)
Expand Down Expand Up @@ -46,7 +46,7 @@ class DPdfGlobal
};

//pdfium即使不同文档之间loadpage和renderpage也不是线程安全,需要加锁
class DPdfMutexLocker : public QMutexLocker<QMutex>
class DPdfMutexLocker : public QMutexLocker<QRecursiveMutex>
{
public:
explicit DPdfMutexLocker(const QString &tmpLog);
Expand Down
6 changes: 2 additions & 4 deletions 3rdparty/deepin-pdfium/src/dpdfglobal.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include <QtCore>
#include <QString>
#include <QMutex>
#include <QMutexLocker>
#include <QDebug>
#include "dpdfglobal.h"
#include "public/fpdfview.h"
Expand Down Expand Up @@ -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<QMutex>(pdfMutex())
DPdfMutexLocker::DPdfMutexLocker(const QString &tmpLog): QMutexLocker<QRecursiveMutex>(pdfMutex())
{
m_log = tmpLog;
qInfo() << m_log + " begin ";
Expand Down
2 changes: 1 addition & 1 deletion arm64/linglong.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -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 <wangrong@uniontech.com> Thu, 20 Feb 2025 18:52:13 +0800

deepin-reader (6.5.12) unstable; urgency=medium

* Update version to 6.5.12
Expand Down
3 changes: 2 additions & 1 deletion linglong.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}')
Expand Down
2 changes: 1 addition & 1 deletion loong64/linglong.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions reader/document/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Loading