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