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
18 changes: 17 additions & 1 deletion deepin-devicemanager/src/DeviceManager/DeviceImage.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
// 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 "DeviceImage.h"
#include "DeviceManager.h"
#include "DBusEnableInterface.h"

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

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "DBusEnableInterface.h" not found.

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

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: "DBusEnableInterface.h" not found.
#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()
Expand All @@ -27,6 +40,7 @@
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 @@ -62,6 +76,7 @@
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 @@ -80,6 +95,7 @@
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
Loading