diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-12-29 00:26:47 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-01-02 15:50:17 -0500 |
commit | cbb57fe714b633cd5b91850eae9cfd326dee2eeb (patch) | |
tree | 57fce120fed1c96313842f63b770dbee9fa55333 /utils/rbutilqt/base/bootloaderinstallhelper.cpp | |
parent | 42999913ba3a76221fceb04b1f935ed4e0e71476 (diff) | |
download | rockbox-cbb57fe714b633cd5b91850eae9cfd326dee2eeb.tar.gz rockbox-cbb57fe714b633cd5b91850eae9cfd326dee2eeb.zip |
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
Diffstat (limited to 'utils/rbutilqt/base/bootloaderinstallhelper.cpp')
-rw-r--r-- | utils/rbutilqt/base/bootloaderinstallhelper.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/utils/rbutilqt/base/bootloaderinstallhelper.cpp b/utils/rbutilqt/base/bootloaderinstallhelper.cpp index c94ed29140..4a1b24883b 100644 --- a/utils/rbutilqt/base/bootloaderinstallhelper.cpp +++ b/utils/rbutilqt/base/bootloaderinstallhelper.cpp | |||
@@ -77,6 +77,26 @@ BootloaderInstallBase* BootloaderInstallHelper::createBootloaderInstaller(QObjec | |||
77 | } | 77 | } |
78 | } | 78 | } |
79 | 79 | ||
80 | BootloaderInstallBase::Capabilities | ||
81 | BootloaderInstallHelper::bootloaderInstallerCapabilities(QObject *parent, QString type) | ||
82 | { | ||
83 | /* Note - this is a terrible pattern in general, but in this case | ||
84 | * it is a much simpler option to just allocate a class instance. | ||
85 | * This operation is rarely used, anyway. */ | ||
86 | |||
87 | BootloaderInstallBase* bootloaderInstaller = | ||
88 | createBootloaderInstaller(parent, type); | ||
89 | |||
90 | BootloaderInstallBase::Capabilities caps = BootloaderInstallBase::Capabilities(); | ||
91 | |||
92 | if(bootloaderInstaller) { | ||
93 | caps = bootloaderInstaller->capabilities(); | ||
94 | delete bootloaderInstaller; | ||
95 | } | ||
96 | |||
97 | return caps; | ||
98 | } | ||
99 | |||
80 | 100 | ||
81 | //! @brief Return post install hints string. | 101 | //! @brief Return post install hints string. |
82 | //! @param model model string | 102 | //! @param model model string |