mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-03 04:15:37 -04:00
[libcalamares] Start putting data into the module Descriptor
This commit is contained in:
parent
60fbf04594
commit
65273a262b
2 changed files with 23 additions and 3 deletions
|
@ -55,6 +55,23 @@ Descriptor::fromDescriptorData( const QVariantMap& moduleDesc )
|
|||
|
||||
cDebug() << moduleDesc;
|
||||
|
||||
{
|
||||
bool typeOk = false;
|
||||
Type t = typeNames().find( moduleDesc.value( "type" ).toString(), typeOk );
|
||||
bool interfaceOk = false;
|
||||
Interface i = interfaceNames().find( moduleDesc.value( "interface" ).toString(), interfaceOk );
|
||||
if ( typeOk && interfaceOk )
|
||||
{
|
||||
d.m_type = t;
|
||||
d.m_interface = i;
|
||||
d.m_isValid = true;
|
||||
}
|
||||
}
|
||||
if ( !d.m_isValid )
|
||||
{
|
||||
return d;
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,11 +72,11 @@ public:
|
|||
*/
|
||||
static Descriptor fromDescriptorData( const QVariantMap& moduleDesc );
|
||||
|
||||
bool isValid() const { return false; }
|
||||
bool isValid() const { return m_isValid; }
|
||||
|
||||
QString name() const { return QString(); }
|
||||
Type type() const { return Type::Job; }
|
||||
Interface interface() const { return Interface::QtPlugin; }
|
||||
Type type() const { return m_type; }
|
||||
Interface interface() const { return m_interface; }
|
||||
|
||||
bool isEmergency() const { return false; }
|
||||
bool hasConfig() const { return true; }
|
||||
|
@ -120,6 +120,9 @@ public:
|
|||
|
||||
private:
|
||||
QString m_directory;
|
||||
Type m_type;
|
||||
Interface m_interface;
|
||||
bool m_isValid = false;
|
||||
};
|
||||
|
||||
} // namespace ModuleSystem
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue