forked from len0rd/rockbox
rbutil: allow checking bootloader installer capabilities
Instead of checking for certain hardcoded strings, fetch the actual capability bitmask by instantiating an installer and querying it. Change-Id: I7883d9c1e90da37ee7c0189732ac626685adbfa1
This commit is contained in:
parent
42999913ba
commit
cbb57fe714
6 changed files with 44 additions and 22 deletions
|
@ -77,6 +77,26 @@ BootloaderInstallBase* BootloaderInstallHelper::createBootloaderInstaller(QObjec
|
|||
}
|
||||
}
|
||||
|
||||
BootloaderInstallBase::Capabilities
|
||||
BootloaderInstallHelper::bootloaderInstallerCapabilities(QObject *parent, QString type)
|
||||
{
|
||||
/* Note - this is a terrible pattern in general, but in this case
|
||||
* it is a much simpler option to just allocate a class instance.
|
||||
* This operation is rarely used, anyway. */
|
||||
|
||||
BootloaderInstallBase* bootloaderInstaller =
|
||||
createBootloaderInstaller(parent, type);
|
||||
|
||||
BootloaderInstallBase::Capabilities caps = BootloaderInstallBase::Capabilities();
|
||||
|
||||
if(bootloaderInstaller) {
|
||||
caps = bootloaderInstaller->capabilities();
|
||||
delete bootloaderInstaller;
|
||||
}
|
||||
|
||||
return caps;
|
||||
}
|
||||
|
||||
|
||||
//! @brief Return post install hints string.
|
||||
//! @param model model string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue