Cache lvm2_pv and luks result to finding external tool #5

Closed
Ghost wants to merge 1 commits from (deleted):cache-support-tools into master
2 changed files with 17 additions and 12 deletions

View File

@ -69,18 +69,21 @@ luks::~luks()
void luks::init()
{
m_Create = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
CommandSupportType cryptsetupFound = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
m_Create = cryptsetupFound;
m_UpdateUUID = cryptsetupFound;
m_GetUUID = cryptsetupFound;
m_Grow = cryptsetupFound;
m_Shrink = cryptsetupFound;
m_SetLabel = cmdSupportNone;
m_GetLabel = cmdSupportFileSystem;
m_UpdateUUID = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
m_Grow = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
m_Shrink = m_Grow;
m_Check = cmdSupportCore;
m_Copy = cmdSupportCore;
m_Move = cmdSupportCore;
m_Backup = cmdSupportCore;
m_GetUsed = cmdSupportNone; // libparted does not support LUKS, we do this as a special case
m_GetUUID = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
}
bool luks::supportToolFound() const

View File

@ -45,18 +45,20 @@ lvm2_pv::lvm2_pv(qint64 firstsector, qint64 lastsector, qint64 sectorsused, cons
void lvm2_pv::init()
{
m_Create = findExternal(QStringLiteral("lvm")) ? cmdSupportFileSystem : cmdSupportNone;
m_Check = findExternal(QStringLiteral("lvm")) ? cmdSupportFileSystem : cmdSupportNone;
CommandSupportType lvmFound = findExternal(QStringLiteral("lvm")) ? cmdSupportFileSystem : cmdSupportNone;
m_GetLabel = cmdSupportCore;
m_UpdateUUID = findExternal(QStringLiteral("lvm")) ? cmdSupportFileSystem : cmdSupportNone;
m_Create = lvmFound;
m_Check = lvmFound;
m_UpdateUUID = lvmFound;
m_Copy = cmdSupportNone; // Copying PV can confuse LVM
m_Move = (m_Check != cmdSupportNone) ? cmdSupportCore : cmdSupportNone;
m_GetLabel = cmdSupportCore;
m_Backup = cmdSupportCore;
m_GetUUID = cmdSupportCore;
m_GetLabel = cmdSupportNone;
m_Backup = cmdSupportCore;
m_GetUUID = cmdSupportCore;
m_Copy = cmdSupportNone; // Copying PV can confuse LVM
}
bool lvm2_pv::supportToolFound() const