[Notifications] Only get descriptionUrl() when actually used

Only for a single file, or in the rare fallback case
wilder-5.22
Kai Uwe Broulik 5 years ago
parent 3a1e23938c
commit 5ba3ad8bfd
  1. 4
      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;

Loading…
Cancel
Save