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: 14 additions & 2 deletions deepin-devicemanager/assets/org.deepin.devicemanager.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@
"description": "此配置项默认为空。如果specialComType==8,程序则启用此项配置。",
"permissions": "readwrite",
"visibility": "private"
}
}
},
"showScreenSize": {
"value": true,
"serial": 0,
"flags": [
"global"
],
"name": "Is show screen size",
"name[zh_CN]": "是否显示屏幕尺寸",
"description": "是否显示屏幕尺寸,默认为true",
"permissions": "readwrite",
"visibility": "private"
}
}
}
14 changes: 12 additions & 2 deletions deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

// 项目自身文件
#include "DeviceMonitor.h"
#include "EDIDParser.h"
#include "commonfunction.h"

Check warning on line 8 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: "commonfunction.h" not found.

Check warning on line 8 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "commonfunction.h" not found.

#include <DApplication>

Check warning on line 10 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

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

Check warning on line 10 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

Check warning on line 11 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

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

Check warning on line 11 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.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.

// Qt库文件
#include <QLoggingCategory>

Check warning on line 14 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

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

Check warning on line 14 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

// 其它头文件
#include <math.h>
#include <QProcess>

Check warning on line 20 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

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

Check warning on line 20 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

DWIDGET_USE_NAMESPACE
DCORE_USE_NAMESPACE

DeviceMonitor::DeviceMonitor()
: DeviceBaseInfo()
Expand Down Expand Up @@ -349,7 +351,15 @@
}
}
addOtherDeviceInfo(("Primary Monitor"), m_MainScreen);
addOtherDeviceInfo(("Size"), m_ScreenSize);
bool showScreenSize { true };

Check warning on line 354 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Condition 'showScreenSize' is always true

Check warning on line 354 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Condition 'showScreenSize' is always true
#ifdef DTKCORE_CLASS_DConfigFile
DConfig *dconfig = DConfig::create("org.deepin.devicemanager","org.deepin.devicemanager");
if(dconfig && dconfig->isValid() && dconfig->keyList().contains("showScreenSize")){
showScreenSize = dconfig->value("showScreenSize").toBool();
}
#endif
if (showScreenSize)
addOtherDeviceInfo(("Size"), m_ScreenSize);
addOtherDeviceInfo(("Serial Number"), m_SerialNumber);
// addOtherDeviceInfo(("Product Date"), m_ProductionWeek);
mapInfoToList();
Expand Down
Loading