Perforce: Use more direct check for executable presence

The !isEmpty check is actually redundant, but currently cheaper than the
diversion through FilePath::fileAccess().

Change-Id: I44e6ec128c78cccf57c7276da70577a87b8c2f96
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2023-07-10 12:52:21 +02:00
parent 5f9408ee8d
commit 28e9591052

View File

@@ -1117,11 +1117,8 @@ bool PerforcePluginPrivate::isVcsFileOrDirectory(const FilePath &filePath) const
bool PerforcePluginPrivate::isConfigured() const
{
const QString binary = m_settings.p4BinaryPath.value();
if (binary.isEmpty())
return false;
QFileInfo fi(binary);
return fi.exists() && fi.isFile() && fi.isExecutable();
const FilePath binary = m_settings.p4BinaryPath();
return !binary.isEmpty() && binary.isExecutableFile();
}
bool PerforcePluginPrivate::supportsOperation(Operation operation) const