Skip to content
Merged
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
19 changes: 3 additions & 16 deletions deepin-devicemanager/src/DeviceManager/DeviceImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,9 @@
#include "DeviceImage.h"
#include "DeviceManager.h"
#include "DBusEnableInterface.h"
#include "DBusInterface.h"

Check warning on line 9 in deepin-devicemanager/src/DeviceManager/DeviceImage.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "DBusInterface.h" not found.

Check warning on line 9 in deepin-devicemanager/src/DeviceManager/DeviceImage.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: "DBusInterface.h" not found.
#include "commonfunction.h"

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

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "commonfunction.h" not found.

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

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: "commonfunction.h" not found.

namespace {
constexpr auto kFhdCameraName = "FHD Camera";

void setSpecialCameraName(QString &name)
{
if (Common::specialComType == Common::kSpecialType9
|| Common::specialComType == Common::kSpecialType10) {
name = kFhdCameraName;
}
}
}

DeviceImage::DeviceImage()
: DeviceBaseInfo()
, m_Model("")
Expand All @@ -40,7 +28,6 @@
return;

setAttribute(mapInfo, "product", m_Name, false);
setSpecialCameraName(m_Name);
setAttribute(mapInfo, "vendor", m_Vendor);
setAttribute(mapInfo, "version", m_Version);
setAttribute(mapInfo, "bus info", m_BusInfo);
Expand Down Expand Up @@ -76,7 +63,6 @@
if (mapInfo.find("unique_id") != mapInfo.end()) {
m_UniqueID = mapInfo["unique_id"];
m_Name = mapInfo["name"];
setSpecialCameraName(m_Name);
m_SysPath = mapInfo["path"];
m_HardwareClass = mapInfo["Hardware Class"];
m_Enable = false;
Expand All @@ -95,7 +81,6 @@
m_SerialID = m_UniqueID;
setAttribute(mapInfo, "SysFS ID", m_SysPath);
setAttribute(mapInfo, "Device", m_Name);
setSpecialCameraName(m_Name);
setAttribute(mapInfo, "Vendor", m_Vendor);
setAttribute(mapInfo, "Model", m_Model);
setAttribute(mapInfo, "Revision", m_Version);
Expand Down Expand Up @@ -177,7 +162,9 @@
void DeviceImage::loadBaseDeviceInfo()
{
// 添加基本信息
addBaseDeviceInfo(("Name"), m_Name);
const bool isFhdCamera = Common::specialComType == Common::kSpecialType9
|| Common::specialComType == Common::kSpecialType10;
addBaseDeviceInfo(("Name"), isFhdCamera ? "FHD Camera" : m_Name);
addBaseDeviceInfo(("Vendor"), m_Vendor);
addBaseDeviceInfo(("Version"), m_Version);
addBaseDeviceInfo(("Model"), m_Model);
Expand Down
Loading