From 28e95910524b8e1302d1aa9c3a690cbbd476e704 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 10 Jul 2023 12:52:21 +0200 Subject: [PATCH] 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 --- src/plugins/perforce/perforceplugin.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 5e6a7b18478..5101d471591 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -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