Skip to content

Commit

Permalink
fix: the correct get the product machine name
Browse files Browse the repository at this point in the history
the correct get the product machine name

Log: the correct get the product machine name
Bug: https://pms.uniontech.com/bug-view-267231.html
  • Loading branch information
shuaijie committed Aug 30, 2024
1 parent fb194dc commit 0ef6469
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ int main(int argc, char *argv[])

int mp4Encode = -1;

Check warning on line 125 in src/main.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Finding the same expression on both sides of an operator is suspicious and might indicate a cut and paste or logic error. Please examine this code carefully to determine if it is correct.
#ifdef DTKCORE_CLASS_DConfigFile
//需要查询是否对PGUX设置MP4编码缓存特殊处理
//需要查询是否对X机型设置MP4编码缓存特殊处理
DConfig *dconfig = DConfig::create("org.deepin.camera", "org.deepin.camera.encode");
if (dconfig && dconfig->isValid() && dconfig->keyList().contains("mp4EncodeMode")) {
mp4Encode = dconfig->value("mp4EncodeMode").toInt();
Expand All @@ -133,10 +133,11 @@ int main(int argc, char *argv[])
#endif
qInfo() << "mp4EncodeMode value is:" << get_pugx_status();
if (mp4Encode == -1) {
//判断是否是pgux
//判断是否是X机型
QStringList options;
options << QString(QStringLiteral("-c"));
options << QString(QStringLiteral("dmidecode -s system-product-name|awk '{print $NF}'"));
options << QString(QStringLiteral("dmidecode -t 11 | grep 'String 4' | awk '{print $NF}' && "
"dmidecode -s system-product-name|awk '{print $NF}'"));
QProcess process;
process.start(QString(QStringLiteral("bash")), options);
process.waitForFinished();
Expand Down

0 comments on commit 0ef6469

Please sign in to comment.