Skip to content
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
6 changes: 0 additions & 6 deletions .project

This file was deleted.

4 changes: 4 additions & 0 deletions 3rdparty/deepin-pdfium/include/dpdfglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ class DPdfGlobal
};

//pdfium即使不同文档之间loadpage和renderpage也不是线程安全,需要加锁
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
class DPdfMutexLocker : public QMutexLocker
#else
class DPdfMutexLocker : public QMutexLocker<QRecursiveMutex>
#endif
{
public:
explicit DPdfMutexLocker(const QString &tmpLog);
Expand Down
6 changes: 6 additions & 0 deletions 3rdparty/deepin-pdfium/src/dpdfglobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ QString DPdfGlobal::textCodeType(const char *text)
return encodeind;
}

#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, pdfMutex, (QMutex::Recursive));

DPdfMutexLocker::DPdfMutexLocker(const QString &tmpLog): QMutexLocker(pdfMutex())
#else
Q_GLOBAL_STATIC(QRecursiveMutex, pdfMutex);

DPdfMutexLocker::DPdfMutexLocker(const QString &tmpLog): QMutexLocker<QRecursiveMutex>(pdfMutex())
#endif
{
m_log = tmpLog;
qInfo() << m_log + " begin ";
Expand Down
29 changes: 26 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@

Source: deepin-reader
Section: graphics
Priority: optional
Maintainer: deepin <packages@deepin.com>
Build-Depends: debhelper (>= 11), pkg-config, qt6-base-dev, qt6-base-dev-tools, qt6-tools-dev, libdtk6widget-dev, libspectre-dev, libdjvulibre-dev, libtiff-dev, libjpeg-dev, libicu-dev, libpng-dev, zlib1g-dev, liblcms2-dev, libopenjp2-7-dev, libfreetype6-dev, libgtest-dev, libchardet-dev, qt6-webengine-dev, qt6-5compat-dev, libdtk6gui-dev, libdtk6core-dev, qt6-svg-dev
Build-Depends:
debhelper (>= 11),
pkg-config,
qt6-5compat-dev [amd64 arm64 i386 loong64] | hello,
qt6-base-dev [amd64 arm64 i386 loong64] | qtbase5-dev,
qt6-tools-dev-tools [amd64 arm64 i386 loong64] | qttools5-dev-tools,
qt6-tools-dev [amd64 arm64 i386 loong64] | qttools5-dev,
qt6-svg-dev [amd64 arm64 i386 loong64] | libqt5svg5-dev,
qt6-webengine-dev [amd64 arm64 i386 loong64] | qtwebengine5-dev,
libdtk6widget-dev [amd64 arm64 i386 loong64] | libdtkwidget-dev,
libdtk6gui-dev [amd64 arm64 i386 loong64] | libdtkgui-dev,
libdtk6core-dev [amd64 arm64 i386 loong64] | libdtkcore-dev,
libspectre-dev,
libdjvulibre-dev,
libtiff-dev,
libjpeg-dev,
libicu-dev,
libpng-dev,
zlib1g-dev,
liblcms2-dev,
libopenjp2-7-dev,
libfreetype6-dev,
libgtest-dev,
libchardet-dev,
Standards-Version: 4.5.0

Package: deepin-reader
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, pandoc
Description: a tool for reading document files.
Document Viewer is a tool for reading document files,supporting PDF, DJVU, DOCX etc

Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc.
27 changes: 16 additions & 11 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
#!/usr/bin/make -f
# -*- makefile -*-
include /usr/share/dpkg/default.mk

# 设置 Qt6 环境
export QT_SELECT=qt6
# 使用系统 PATH 中的 qmake6
export QMAKE=qmake6
# 检测当前安装的Qt版本,优先使用Qt6,否则使用Qt5
define detect_qt_version
ifneq (,$(shell which qmake6 2>/dev/null))
QMAKE=qmake6
else
QMAKE=qmake
endif
endef

include /usr/share/dpkg/default.mk
# 调用检测Qt版本的命令
$(eval $(call detect_qt_version))

# 指定使用 qmake 构建系统
export DH_OPTIONS := --buildsystem=qmake
# hardcode this if want to force build with sepecific Qt version
# QMAKE=qmake

%:
dh $@ --buildsystem=qmake
dh $@ --parallel --buildsystem=qmake

override_dh_auto_configure:
$(QMAKE) \
VERSION=$(VERSION) \
PREFIX=/usr \
LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
VERSION_UPSTREAM=$(DEB_VERSION_UPSTREAM) \
DEFINES+="VERSION=$(DEB_VERSION_UPSTREAM)"
DEFINES+="VERSION=$(DEB_VERSION_UPSTREAM)" \
CONFIG+=release
12 changes: 12 additions & 0 deletions reader/document/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int &
qDebug() << "正在解压文档..." << targetDoc;
QString unzipCommand = "unzip " + targetDoc;
qDebug() << "执行命令: " << unzipCommand;
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
decompressor.start(unzipCommand);
#else
decompressor.startCommand(unzipCommand);
#endif
if (!decompressor.waitForStarted()) {
qInfo() << "start unzip failed";
error = deepin_reader::Document::ConvertFailed;
Expand Down Expand Up @@ -111,7 +115,11 @@ 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;
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
converter.start(pandocCommand);
#else
converter.startCommand(pandocCommand);
#endif
if (!converter.waitForStarted()) {
qInfo() << "start pandoc failed";
error = deepin_reader::Document::ConvertFailed;
Expand Down Expand Up @@ -144,7 +152,11 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int &

QString htmltopdfCommand = prefix + "/lib/deepin-reader/htmltopdf " + tmpHtmlFilePath + " " + realFilePath;
qDebug() << "执行命令: " << htmltopdfCommand;
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
converter2.start(htmltopdfCommand);
#else
converter2.startCommand(htmltopdfCommand);
#endif
if (!converter2.waitForStarted()) {
qInfo() << "start htmltopdf failed";
error = deepin_reader::Document::ConvertFailed;
Expand Down