From f49389a408fe32b1f56c47fbb62d5288795235d1 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 2 Nov 2021 00:09:52 +0100 Subject: [PATCH] [partition] Fix logic errors in stringification of MessageAndPath --- src/modules/partition/jobs/ClearMountsJob.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/partition/jobs/ClearMountsJob.cpp b/src/modules/partition/jobs/ClearMountsJob.cpp index e5c56126a..23a2c287f 100644 --- a/src/modules/partition/jobs/ClearMountsJob.cpp +++ b/src/modules/partition/jobs/ClearMountsJob.cpp @@ -125,13 +125,14 @@ public: { } - bool isEmpty() const { return m_message; } + bool isEmpty() const { return !m_message; } explicit operator QString() const { - return isEmpty() ? QString() : QCoreApplication::translate( "ClearMountsJob", m_message ); + return isEmpty() ? QString() : QCoreApplication::translate( "ClearMountsJob", m_message ).arg( m_path ); } +private: const char* const m_message = nullptr; QString const m_path; }; @@ -143,7 +144,7 @@ operator<<( QDebug& s, const MessageAndPath& m ) { return s; } - return s << QString( m.m_message ).arg( m.m_path ); + return s << QString( m ); }