mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 10:25:36 -04:00
[libcalamaresui] Avoid metatype warnings at runtime
- Register the types with the Qt type system. This is needed because we're passing them as signal and slot parameters across threads.
This commit is contained in:
parent
f1aa22d9e8
commit
41fecf341b
4 changed files with 28 additions and 3 deletions
|
@ -34,7 +34,26 @@
|
|||
namespace Calamares
|
||||
{
|
||||
|
||||
void
|
||||
static void
|
||||
registerMetatypes()
|
||||
{
|
||||
static bool done = false;
|
||||
|
||||
if ( !done )
|
||||
{
|
||||
qRegisterMetaType< RequirementEntry >( "RequirementEntry" );
|
||||
// It's sensitive to the names of types in parameters; in particular
|
||||
// althrough QList<RequirementEntry> is the same as RequirementsList,
|
||||
// because we *name* the type as RequirementsList in the parameters,
|
||||
// we need to register that (as well). Here, be safe and register
|
||||
// both names.
|
||||
qRegisterMetaType< QList< RequirementEntry > >( "QList<RequirementEntry>" );
|
||||
qRegisterMetaType< RequirementsList >( "RequirementsList" );
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
check( Module * const &m, RequirementsChecker *c )
|
||||
{
|
||||
RequirementsList l = m->checkRequirements();
|
||||
|
@ -49,6 +68,8 @@ RequirementsChecker::RequirementsChecker( QVector< Module* > modules, QObject* p
|
|||
{
|
||||
m_watchers.reserve( m_modules.count() );
|
||||
m_collectedRequirements.reserve( m_modules.count() );
|
||||
|
||||
registerMetatypes();
|
||||
}
|
||||
|
||||
RequirementsChecker::~RequirementsChecker()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue