From 1674c81e9caef7126a8e6c9367c6b47a3dfcecc8 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 13 Jun 2019 21:54:03 +0200 Subject: [PATCH] [libcalamares] Add query for kpmcore status --- src/libcalamares/partition/KPMManager.cpp | 7 ++++++- src/libcalamares/partition/KPMManager.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libcalamares/partition/KPMManager.cpp b/src/libcalamares/partition/KPMManager.cpp index d2a9414a0..cb30247b6 100644 --- a/src/libcalamares/partition/KPMManager.cpp +++ b/src/libcalamares/partition/KPMManager.cpp @@ -44,7 +44,6 @@ static bool s_kpm_loaded = false; static bool s_loaded = false; static std::shared_ptr< InternalManager > s_backend; - InternalManager::InternalManager() { Q_ASSERT( !s_loaded ); @@ -100,5 +99,11 @@ KPMManager::KPMManager() KPMManager::~KPMManager() {} +KPMManager::operator bool() const +{ + return s_kpm_loaded; +} + + } // namespace Partition } // namespace CalamaresUtils diff --git a/src/libcalamares/partition/KPMManager.h b/src/libcalamares/partition/KPMManager.h index 14858d2e1..2a23122ec 100644 --- a/src/libcalamares/partition/KPMManager.h +++ b/src/libcalamares/partition/KPMManager.h @@ -48,8 +48,11 @@ public: KPMManager(); ~KPMManager(); + /// @brief Is KPMCore loaded correctly? + operator bool() const; private: std::shared_ptr< InternalManager > m_d; + }; } // namespace Partition