From b4bbe0cdec9062a62437387c4687fceb30a804c5 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Mon, 15 Sep 2025 09:30:36 +0800 Subject: [PATCH] fix: [cppcheck] Improve code formatting for architecture mapping Enhanced readability of the architecture mapping table by reformatting the static QMap initialization with proper indentation and line breaks. also add comments for variables. Log: Refactor architecture mapping code style Change-Id: Iea19f9e13e7b8f59f66d34877e555994832a0221 --- .../deepin-devicecontrol/src/drivercontrol/commonfunction.h | 3 ++- deepin-devicemanager/src/Tool/DBusAnythingInterface.h | 4 ++-- deepin-devicemanager/src/Tool/EDIDParser.h | 4 ++-- deepin-devicemanager/src/Tool/ThreadExecXrandr.h | 2 +- deepin-devicemanager/src/Tool/commontools.h | 3 +-- deepin-devicemanager/src/commonfunction.cpp | 3 ++- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/deepin-devicemanager-server/deepin-devicecontrol/src/drivercontrol/commonfunction.h b/deepin-devicemanager-server/deepin-devicecontrol/src/drivercontrol/commonfunction.h index 3d1ba92df..93fd468fe 100644 --- a/deepin-devicemanager-server/deepin-devicecontrol/src/drivercontrol/commonfunction.h +++ b/deepin-devicemanager-server/deepin-devicecontrol/src/drivercontrol/commonfunction.h @@ -11,7 +11,8 @@ #include -static QMap mapArch = { {"aarch64", "arm64"} +static QMap mapArch = { + {"aarch64", "arm64"} , {"x86_64", "amd64"} , {"mips64", "mips64el"} , {"i386", "i386"} diff --git a/deepin-devicemanager/src/Tool/DBusAnythingInterface.h b/deepin-devicemanager/src/Tool/DBusAnythingInterface.h index 544af7033..c35df7468 100644 --- a/deepin-devicemanager/src/Tool/DBusAnythingInterface.h +++ b/deepin-devicemanager/src/Tool/DBusAnythingInterface.h @@ -64,8 +64,8 @@ class DBusAnythingInterface : public QObject private: static std::atomic s_Instance; - static std::mutex m_mutex; - QDBusInterface *mp_Iface; + static std::mutex m_mutex; + QDBusInterface *mp_Iface; }; #endif // DBUSANYTHINGINTERFACE_H diff --git a/deepin-devicemanager/src/Tool/EDIDParser.h b/deepin-devicemanager/src/Tool/EDIDParser.h index abc538d15..31138c2d1 100644 --- a/deepin-devicemanager/src/Tool/EDIDParser.h +++ b/deepin-devicemanager/src/Tool/EDIDParser.h @@ -148,7 +148,7 @@ class EDIDParser private: /**@brief:机器的存储模式不同,会导致计算结果不同,所以在解析的时候需要考虑大小端模式*/ QString m_Vendor; // 显示屏的厂商信息 - QString m_Model; // 显示屏的型号信息 + QString m_Model; // 显示屏的型号信息 QString m_ReleaseDate; // 显示屏的生产日期 QString m_ScreenSize; // 屏幕大小 QString m_MonitorName; // 监视器名称 @@ -156,7 +156,7 @@ class EDIDParser int m_Width; // width int m_Height; // heigth QStringList m_ListEdid; // edid数据 - QMap m_MapCh; // + QMap m_MapCh; // 二进制字符串映射到字母A-Z }; diff --git a/deepin-devicemanager/src/Tool/ThreadExecXrandr.h b/deepin-devicemanager/src/Tool/ThreadExecXrandr.h index 563d90a9f..5e36699d7 100644 --- a/deepin-devicemanager/src/Tool/ThreadExecXrandr.h +++ b/deepin-devicemanager/src/Tool/ThreadExecXrandr.h @@ -76,7 +76,7 @@ class ThreadExecXrandr : public QThread private: bool m_Gpu; // m_MapDriverType; static QMap m_MapStatusIcon; static QMap m_MapStatusType; - - static QMap m_MapErrorString; + static QMap m_MapErrorString; }; #endif // COMMONTOOLS_H diff --git a/deepin-devicemanager/src/commonfunction.cpp b/deepin-devicemanager/src/commonfunction.cpp index ed5a3300b..3dbeb244c 100644 --- a/deepin-devicemanager/src/commonfunction.cpp +++ b/deepin-devicemanager/src/commonfunction.cpp @@ -20,7 +20,8 @@ using namespace DDLog; -static QMap mapArch = { {"aarch64", "arm64"} +static QMap mapArch = { + {"aarch64", "arm64"} , {"x86_64", "amd64"} , {"mips64", "mips64el"} , {"i386", "i386"}