Fixing binary paths array wrongly iterated up to binaryPaths->length() (#216)

This commit is contained in:
Dmitry Mikushin
2023-02-17 05:08:09 +01:00
committed by GitHub
parent 8ca2610550
commit bffc5d733b
2 changed files with 10 additions and 11 deletions

View File

@@ -34,9 +34,9 @@ GPService::~GPService()
QString GPService::findBinary()
{
for (int i = 0; i < binaryPaths->length(); i++) {
if (QFileInfo::exists(binaryPaths[i])) {
return binaryPaths[i];
for (auto& binaryPath : binaryPaths) {
if (QFileInfo::exists(binaryPath)) {
return binaryPath;
}
}
return nullptr;