[libcalamares] Add convenience backend() to KPMManager
This commit is contained in:
parent
d039f9bbb8
commit
d0d017f5fe
@ -115,6 +115,12 @@ KPMManager::operator bool() const
|
|||||||
return s_kpm_loaded;
|
return s_kpm_loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CoreBackend*
|
||||||
|
KPMManager::backend() const
|
||||||
|
{
|
||||||
|
return s_kpm_loaded ? CoreBackendManager::self()->backend() : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace Partition
|
} // namespace Partition
|
||||||
} // namespace CalamaresUtils
|
} // namespace CalamaresUtils
|
||||||
|
@ -50,6 +50,10 @@ public:
|
|||||||
|
|
||||||
/// @brief Is KPMCore loaded correctly?
|
/// @brief Is KPMCore loaded correctly?
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
|
|
||||||
|
/// @brief Gets the KPMCore backend (e.g. CoreBackendManager::self()->backend() )
|
||||||
|
CoreBackend* backend() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr< InternalManager > m_d;
|
std::shared_ptr< InternalManager > m_d;
|
||||||
};
|
};
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
// CalaPM
|
// CalaPM
|
||||||
#include <backend/corebackend.h>
|
#include <backend/corebackend.h>
|
||||||
#include <backend/corebackendmanager.h>
|
|
||||||
#include <fs/filesystemfactory.h>
|
#include <fs/filesystemfactory.h>
|
||||||
|
|
||||||
// Qt
|
// Qt
|
||||||
@ -198,8 +197,7 @@ void
|
|||||||
PartitionJobTests::refreshDevice()
|
PartitionJobTests::refreshDevice()
|
||||||
{
|
{
|
||||||
QString devicePath = qgetenv( "CALAMARES_TEST_DISK" );
|
QString devicePath = qgetenv( "CALAMARES_TEST_DISK" );
|
||||||
CoreBackend* backend = CoreBackendManager::self()->backend();
|
m_device.reset( kpmcore->backend()->scanDevice( devicePath ) );
|
||||||
m_device.reset( backend->scanDevice( devicePath ) );
|
|
||||||
QVERIFY( !m_device.isNull() );
|
QVERIFY( !m_device.isNull() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user