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
31 changes: 16 additions & 15 deletions deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
// 项目自身文件
#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 / cppcheck

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 / static-check / static-check

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 / cppcheck

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 / static-check / static-check

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

// Qt库文件
#include <QLoggingCategory>

Check warning on line 13 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.

Check warning on line 13 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.
#include <QDate>
#include <QSize>

Expand Down Expand Up @@ -301,14 +300,23 @@
const QString DeviceMonitor::getOverviewInfo()
{
QString ov;
if (Common::specialComType == Common::kSpecialType6 ||
Common::specialComType == Common::kSpecialType7 ||
Common::specialComType == Common::kSpecialType9) {
ov = QString("(%1)").arg(m_ScreenSize);
if (Common::isShowScreenSize()) {
if (Common::specialComType == Common::kSpecialType6 ||
Common::specialComType == Common::kSpecialType7 ||
Common::specialComType == Common::kSpecialType9) {
ov = QString("(%1)").arg(m_ScreenSize);
} else {
ov = QString("%1(%2)").arg(m_Name).arg(m_ScreenSize);
}
} else {
ov = QString("%1(%2)").arg(m_Name).arg(m_ScreenSize);
if (Common::specialComType == Common::kSpecialType6 ||
Common::specialComType == Common::kSpecialType7 ||
Common::specialComType == Common::kSpecialType9) {
ov = "";
} else {
ov = QString("%1").arg(m_Name);
}
}

return ov;
}

Expand Down Expand Up @@ -351,14 +359,7 @@
}
}
addOtherDeviceInfo(("Primary Monitor"), m_MainScreen);
bool showScreenSize { 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)
if (Common::isShowScreenSize())
addOtherDeviceInfo(("Size"), m_ScreenSize);
addOtherDeviceInfo(("Serial Number"), m_SerialNumber);
// addOtherDeviceInfo(("Product Date"), m_ProductionWeek);
Expand Down
12 changes: 12 additions & 0 deletions deepin-devicemanager/src/commonfunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,15 @@ QByteArray Common::executeClientCmd(const QString &cmd, const QStringList &args,
}
return outPut;
}

bool Common::isShowScreenSize()
{
bool showScreenSize { 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
return showScreenSize;
}
2 changes: 2 additions & 0 deletions deepin-devicemanager/src/commonfunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,7 @@ class Common
static SpecialCpuType curCpuType;

static QByteArray executeClientCmd(const QString& cmd, const QStringList& args = QStringList(), const QString& workPath = QString(), int msecsWaiting = 30000);

static bool isShowScreenSize();
};
#endif // COMMONFUNCTION_H
Loading