Skip to content

Commit eaabe48

Browse files
GongHeng2017deepin-bot[bot]
authored andcommitted
Fix: The screen size show error.
-- Add Group Policy item to control whether to display screen size. Log: fix issue Bug: https://pms.uniontech.com/bug-view-354275.html
1 parent dfdbbab commit eaabe48

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "DDLog.h"
1111

1212
#include <DApplication>
13+
#include <DConfig>
1314

1415
// Qt库文件
1516
#include <QLoggingCategory>
@@ -22,6 +23,7 @@
2223

2324
DWIDGET_USE_NAMESPACE
2425
using namespace DDLog;
26+
DCORE_USE_NAMESPACE
2527

2628
DeviceMonitor::DeviceMonitor()
2729
: DeviceBaseInfo()
@@ -409,12 +411,19 @@ void DeviceMonitor::loadOtherDeviceInfo()
409411
}
410412
}
411413
}
412-
addOtherDeviceInfo("Primary Monitor", m_MainScreen);
413-
if (Common::isShowScreenSize())
414-
addOtherDeviceInfo("Size", m_ScreenSize);
415-
addOtherDeviceInfo("Serial Number", m_SerialNumber);
416-
// addOtherDeviceInfo("Product Date", m_ProductionWeek);
417-
414+
addOtherDeviceInfo(("Primary Monitor"), m_MainScreen);
415+
bool showScreenSize { true };
416+
417+
#ifdef DTKCORE_CLASS_DConfigFile
418+
DConfig *dconfig = DConfig::create("org.deepin.devicemanager","org.deepin.devicemanager");
419+
if(dconfig && dconfig->isValid() && dconfig->keyList().contains("showScreenSize")){
420+
showScreenSize = dconfig->value("showScreenSize").toBool();
421+
}
422+
#endif
423+
if (showScreenSize)
424+
addOtherDeviceInfo(("Size"), m_ScreenSize);
425+
addOtherDeviceInfo(("Serial Number"), m_SerialNumber);
426+
// addOtherDeviceInfo(("Product Date"), m_ProductionWeek);
418427
mapInfoToList();
419428
qCDebug(appLog) << "Other device info loaded";
420429
}

0 commit comments

Comments
 (0)