aboutsummaryrefslogtreecommitdiff
path: root/lib/pluginloader/pluginloader.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pluginloader/pluginloader.h')
-rw-r--r--lib/pluginloader/pluginloader.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/pluginloader/pluginloader.h b/lib/pluginloader/pluginloader.h
index cc67901..bb5e1e0 100644
--- a/lib/pluginloader/pluginloader.h
+++ b/lib/pluginloader/pluginloader.h
@@ -16,13 +16,12 @@ public:
SigChecked = (1 << 1),
SigEnforced = (1 << 2),
};
- typedef unsigned int signature_state_t;
- static signature_state_t signature_state(bool ignore, bool check, bool enforce)
+ static constexpr signature_level signature_state(bool ignore, bool check, bool enforce)
{
- return (static_cast<unsigned int>(enforce) << 2) | (static_cast<unsigned int>(check) << 1) | static_cast<unsigned int>(ignore);
+ return enforce ? signature_level::SigEnforced : (check ? signature_level::SigChecked : signature_level::SigIgnored);
}
- PluginLoader(const QString &fileName, const signature_state_t state, QObject *parent = nullptr)
+ PluginLoader(const QString &fileName, const signature_level state, QObject *parent = nullptr)
: QPluginLoader(fileName, parent)
, m_state(state)
{
@@ -45,6 +44,6 @@ public:
bool verify(const char *hashName = "SHA256");
private:
- const signature_state_t m_state;
+ const signature_level m_state;
QString m_sigError;
};