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
16 changes: 16 additions & 0 deletions manual-assets/org.deepin.manual.customui.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"magic": "dsg.config.meta",
"version": "1.0",
"contents": {
"selperSupport": {
"value": true,
"serial": 0,
"flags": ["global"],
"name": "selperSupport",
"description[zh_CN]": "是否显示服务与支持",
"description": "",
"permissions": "readwrite",
"visibility": "private"
}
}
}
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,15 @@ install(TARGETS dman
install(TARGETS dmanHelper
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

##dconfig
set(APPID org.deepin.manual)
set(configFile ${CMAKE_SOURCE_DIR}/manual-assets/org.deepin.manual.customui.json)
if (DEFINED DSG_DATA_DIR)
message("-- DConfig is supported by DTK")
dtk_add_config_meta_files(APPID ${APPID} FILES ${configFile})
else()
install(FILES ${configFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/dsg/configs/org.deepin.manual/)
endif()

# translation files
TRANSLATION_GENERATE(QM_FILES ${CMAKE_SOURCE_DIR}/translations)
Expand Down
13 changes: 12 additions & 1 deletion src/base/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
#include <DSysInfo>
DCORE_USE_NAMESPACE

#include <QFontDatabase>

Check warning on line 11 in src/base/utils.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QFontDatabase> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QImageReader>

Check warning on line 12 in src/base/utils.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QImageReader> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QScopedPointer>

Check warning on line 13 in src/base/utils.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QScopedPointer> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#ifdef DTKCORE_CLASS_DConfigFile
#include <DConfig>

Check warning on line 15 in src/base/utils.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DConfig> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#endif

#include "base/consts.h"

Check warning on line 18 in src/base/utils.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "base/consts.h" not found.

QHash<QString, QPixmap> Utils::m_imgCacheHash;
QHash<QString, QString> Utils::m_fontNameCache;
Expand Down Expand Up @@ -532,11 +536,18 @@
{
qCDebug(app) << "hasSelperSupport";
Dtk::Core::DSysInfo::UosEdition type = uosEditionType();
bool bSelperSupport = true;

Check warning on line 539 in src/base/utils.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Condition 'bSelperSupport' is always true
#ifdef DTKCORE_CLASS_DConfigFile
QScopedPointer<DConfig> dconfig(DConfig::create("org.deepin.manual", "org.deepin.manual.customui"));
if (dconfig && dconfig->isValid() && dconfig->keyList().contains("selperSupport")) {
bSelperSupport = dconfig->value("selperSupport").toBool();
}
#endif
//专业版判断是否有服务与支持
if (Dtk::Core::DSysInfo::UosProfessional == type || Dtk::Core::DSysInfo::UosMilitary == type || Dtk::Core::DSysInfo::UosMilitaryS == type) {
qCDebug(app) << "hasSelperSupport true";
const QStringList list = getSystemManualList();
if (list.contains("uos-service-support")) {
if (list.contains("uos-service-support") && bSelperSupport) {
qCDebug(app) << "uos-service-support found in manual list";
return true;
}
Expand Down
Loading