diff --git a/src/libcalamaresui/viewpages/QmlViewStep.cpp b/src/libcalamaresui/viewpages/QmlViewStep.cpp index d32e791d6..b166c20fa 100644 --- a/src/libcalamaresui/viewpages/QmlViewStep.cpp +++ b/src/libcalamaresui/viewpages/QmlViewStep.cpp @@ -101,9 +101,8 @@ registerCalamaresModels() namespace Calamares { -QmlViewStep::QmlViewStep( const QString& name, QObject* parent ) +QmlViewStep::QmlViewStep( QObject* parent ) : ViewStep( parent ) - , m_name( name ) , m_widget( new QWidget ) , m_spinner( new WaitingWidget( tr( "Loading ..." ) ) ) , m_qmlWidget( new QQuickWidget ) @@ -126,7 +125,7 @@ QString QmlViewStep::prettyName() const { // TODO: query the QML itself - return tr( "QML Step %1." ).arg( m_name ); + return tr( "QML Step %1." ).arg( moduleInstanceKey().module() ); } @@ -251,14 +250,14 @@ QmlViewStep::showQml() * is badly configured). */ QString -searchQmlFile( QmlViewStep::QmlSearch method, const QString& configuredName, const QString& moduleName, const Calamares::ModuleSystem::InstanceKey& i ) +searchQmlFile( QmlViewStep::QmlSearch method, const QString& configuredName, const Calamares::ModuleSystem::InstanceKey& i ) { using QmlSearch = Calamares::QmlViewStep::QmlSearch; QString bPath( QStringLiteral( "%1/%2.qml" ) ); QString qrPath( QStringLiteral( ":/%1.qml" ) ); - cDebug() << "Looking for QML for" << moduleName; + cDebug() << "Looking for QML for" << i.toString(); QStringList candidates; if ( configuredName.startsWith( '/' ) ) { @@ -269,14 +268,12 @@ searchQmlFile( QmlViewStep::QmlSearch method, const QString& configuredName, con QString brandDir = Calamares::Branding::instance()->componentDirectory(); candidates << ( configuredName.isEmpty() ? QString() : bPath.arg( brandDir, configuredName ) ) - << ( moduleName.isEmpty() ? QString() : bPath.arg( brandDir, moduleName ) ) << bPath.arg( brandDir, i.toString() ) << bPath.arg( brandDir, i.module() ); } if ( ( method == QmlSearch::Both ) || ( method == QmlSearch::QrcOnly ) ) { candidates << ( configuredName.isEmpty() ? QString() : qrPath.arg( configuredName ) ) - << ( moduleName.isEmpty() ? QString() : qrPath.arg( moduleName ) ) << qrPath.arg( i.toString() ) << qrPath.arg( i.module() ); } @@ -315,7 +312,7 @@ QmlViewStep::setConfigurationMap( const QVariantMap& configurationMap ) QString qmlFile = CalamaresUtils::getString( configurationMap, "qmlFilename" ); if ( !m_qmlComponent ) { - m_qmlFileName = searchQmlFile( m_searchMethod, qmlFile, m_name, moduleInstanceKey() ); + m_qmlFileName = searchQmlFile( m_searchMethod, qmlFile, moduleInstanceKey() ); QObject* config = this->getConfig(); if ( config ) diff --git a/src/libcalamaresui/viewpages/QmlViewStep.h b/src/libcalamaresui/viewpages/QmlViewStep.h index b54dc2fb7..05521e698 100644 --- a/src/libcalamaresui/viewpages/QmlViewStep.h +++ b/src/libcalamaresui/viewpages/QmlViewStep.h @@ -49,12 +49,12 @@ public: /** @brief Creates a QML view step * - * The name should not have an extension or schema or anything; - * just the plain name, which will be searched as "/.qml" in - * QRC files, or ".qml" in suitable branding paths. - * The search behavior depends on a QmlSearch value. + * The search behavior for the actial QML depends on a QmlSearch value. + * This is set through common configuration key *qmlSearch*. + * The filename used comes from the module identifier, or can be + * set in the configuration file through *qmlFilename*. */ - QmlViewStep( const QString& name, QObject* parent = nullptr ); + QmlViewStep( QObject* parent = nullptr ); virtual ~QmlViewStep() override; virtual QString prettyName() const override; diff --git a/src/modules/notesqml/NotesQmlViewStep.cpp b/src/modules/notesqml/NotesQmlViewStep.cpp index 79c2e39f2..5a6bbc494 100644 --- a/src/modules/notesqml/NotesQmlViewStep.cpp +++ b/src/modules/notesqml/NotesQmlViewStep.cpp @@ -22,7 +22,7 @@ #include NotesQmlViewStep::NotesQmlViewStep( QObject* parent ) - : Calamares::QmlViewStep( "notesqml", parent ) + : Calamares::QmlViewStep( parent ) { } diff --git a/src/modules/welcomeq/WelcomeQmlViewStep.cpp b/src/modules/welcomeq/WelcomeQmlViewStep.cpp index a957dfc92..e3c0d7843 100644 --- a/src/modules/welcomeq/WelcomeQmlViewStep.cpp +++ b/src/modules/welcomeq/WelcomeQmlViewStep.cpp @@ -40,7 +40,7 @@ CALAMARES_PLUGIN_FACTORY_DEFINITION( WelcomeQmlViewStepFactory, registerPlugin< WelcomeQmlViewStep >(); ) WelcomeQmlViewStep::WelcomeQmlViewStep( QObject* parent ) -: Calamares::QmlViewStep("welcomeq", parent ) +: Calamares::QmlViewStep(parent ) , m_config( new Config( ) ) // the qml singleton takes ownership and deletes it // , m_nextEnabled( false ) , m_requirementsChecker( new GeneralRequirements( this ) )