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
14 changes: 4 additions & 10 deletions src/utils/baseutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,10 @@
}
}

bool BaseUtils::isCommandExist(QString command)

Check warning on line 158 in src/utils/baseutils.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'isCommandExist' is never used.

Check warning on line 158 in src/utils/baseutils.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Parameter 'command' is passed by value. It could be passed as a const reference which is usually faster and recommended in C++.
{
QProcess *proc = new QProcess;
if (!proc) {
return false;
}
QString cm = QString("which %1\n").arg(command);
proc->start(cm);
proc->waitForFinished(1000);
int ret = proc->exitCode() == 0;
delete proc;
return ret;
QProcess proc;
proc.start(QStringLiteral("which"), QStringList() << command);
proc.waitForFinished(1000);
return proc.exitCode() == 0;
}
Loading