From c1e8688eeacc6f32c86fca05f8e08034cc0af9d5 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Sun, 21 Jan 2024 20:46:09 +0100 Subject: [PATCH] Perforce: Inline msgWhereFailed() helper Change-Id: I41da19c488e3a4a72abfb5c7912fdcbc190cc603 Reviewed-by: Orgad Shaneh --- src/plugins/perforce/perforceplugin.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 3e3cbcc8ce4..987271f37e6 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -1608,14 +1608,6 @@ QString PerforcePluginPrivate::pendingChangesData() return dataResponse.error ? QString() : dataResponse.stdOut; } -static QString msgWhereFailed(const QString & file, const QString &why) -{ - //: Failed to run p4 "where" to resolve a Perforce file name to a local - //: file system name. - return Tr::tr("Error running \"where\" on %1: %2"). - arg(QDir::toNativeSeparators(file), why); -} - // Map a perforce name "//xx" to its real name in the file system QString fileNameFromPerforceName(const QString &perforceName, bool quiet) { @@ -1640,9 +1632,11 @@ QString fileNameFromPerforceName(const QString &perforceName, bool quiet) if (output.isEmpty()) { if (!quiet) { - //: File is not managed by Perforce - VcsOutputWindow::appendError(msgWhereFailed(perforceName, - Tr::tr("The file is not mapped"))); + //: Failed to run p4 "where" to resolve a Perforce file name to a local + //: file system name. + VcsOutputWindow::appendError( + Tr::tr("Error running \"where\" on %1: The file is not mapped") + .arg(QDir::toNativeSeparators(perforceName))); } return {}; }