From 5ba3ad8bfda23464f5e3f1ea3f443e5ebbbe4567 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Tue, 2 Feb 2021 00:01:39 +0100 Subject: [PATCH] [Notifications] Only get descriptionUrl() when actually used Only for a single file, or in the rare fallback case --- libnotificationmanager/job_p.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnotificationmanager/job_p.cpp b/libnotificationmanager/job_p.cpp index ecdb9fa58..daf809a7e 100644 --- a/libnotificationmanager/job_p.cpp +++ b/libnotificationmanager/job_p.cpp @@ -159,7 +159,6 @@ QString JobPrivate::text() const return m_infoMessage; } - const QString currentFileName = descriptionUrl().fileName(); const QString destUrlString = prettyDestUrl(); if (m_totalFiles == 0) { @@ -172,6 +171,7 @@ QString JobPrivate::text() const return i18ncp("Copying n files", "%1 file", "%1 files", m_processedFiles); } } else if (m_totalFiles == 1) { + const QString currentFileName = descriptionUrl().fileName(); if (!destUrlString.isEmpty()) { if (!currentFileName.isEmpty()) { return i18nc("Copying file to location", "%1 to %2", currentFileName, destUrlString); @@ -203,7 +203,7 @@ QString JobPrivate::text() const } qCInfo(NOTIFICATIONMANAGER) << "Failed to generate job text for job with following properties:"; - qCInfo(NOTIFICATIONMANAGER) << " processedFiles =" << m_processedFiles << ", totalFiles =" << m_totalFiles << ", current file name =" << currentFileName + qCInfo(NOTIFICATIONMANAGER) << " processedFiles =" << m_processedFiles << ", totalFiles =" << m_totalFiles << ", current file name =" << descriptionUrl().fileName() << ", destination url string =" << destUrlString; qCInfo(NOTIFICATIONMANAGER) << "label1 =" << m_descriptionLabel1 << ", value1 =" << m_descriptionValue1 << ", label2 =" << m_descriptionLabel2 << ", value2 =" << m_descriptionValue2;