Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove the call to the bash program #368

Merged
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
9 changes: 8 additions & 1 deletion deepin-system-monitor-main/system/cpu_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,17 @@
if (!spnInfo.contains("KLVV", Qt::CaseInsensitive) && !spnInfo.contains("L540", Qt::CaseInsensitive) && !spnInfo.contains("KLVU", Qt::CaseInsensitive)
&& !spnInfo.contains("PGUV", Qt::CaseInsensitive) && !spnInfo.contains("PGUW", Qt::CaseInsensitive) && !spnInfo.contains("W585", Qt::CaseInsensitive)) {

process.start("bash", QStringList() << "-c" << "dmidecode | grep -i \"String 4\"");
process.start("dmidecode");
process.waitForStarted();
process.waitForFinished();
QString result = process.readAll();
QStringList lines = result.split('\n');
for (const QString &line : lines) {
if (line.contains("String 4", Qt::CaseInsensitive)) {

Check warning on line 644 in deepin-system-monitor-main/system/cpu_set.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Consider using std::find_if algorithm instead of a raw loop.
result = line;
break;
}
}
if(!result.contains("PWC30", Qt::CaseInsensitive)){ //w525
process.close();
return;
Expand Down
Loading