From 4491fb8c2758e3ae0e28de511f50211877c81285 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 19 May 2020 17:17:14 +0200 Subject: [PATCH] [libcalamaresui] Name QML-wrangling functions consistently - Use "Qml" in camel-cased names --- src/calamares/CalamaresWindow.cpp | 4 ++-- src/libcalamaresui/utils/Qml.cpp | 4 ++-- src/libcalamaresui/utils/Qml.h | 4 ++-- src/libcalamaresui/viewpages/QmlViewStep.cpp | 4 ++-- src/libcalamaresui/viewpages/Slideshow.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index 2ab7cd5fa..a3775c44e 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -208,7 +208,7 @@ CalamaresWindow::getWidgetNavigation( QWidget* parent ) QWidget* CalamaresWindow::getQmlSidebar( QWidget* parent, int ) { - CalamaresUtils::registerCalamaresModels(); + CalamaresUtils::registerQmlModels(); QQuickWidget* w = new QQuickWidget( parent ); w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); w->setResizeMode( QQuickWidget::SizeRootObjectToView ); @@ -220,7 +220,7 @@ CalamaresWindow::getQmlSidebar( QWidget* parent, int ) QWidget* CalamaresWindow::getQmlNavigation( QWidget* parent ) { - CalamaresUtils::registerCalamaresModels(); + CalamaresUtils::registerQmlModels(); QQuickWidget* w = new QQuickWidget( parent ); w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); w->setResizeMode( QQuickWidget::SizeRootObjectToView ); diff --git a/src/libcalamaresui/utils/Qml.cpp b/src/libcalamaresui/utils/Qml.cpp index 5f3264da9..2837dfb5e 100644 --- a/src/libcalamaresui/utils/Qml.cpp +++ b/src/libcalamaresui/utils/Qml.cpp @@ -34,7 +34,7 @@ namespace CalamaresUtils { void -callQMLFunction( QQuickItem* qmlObject, const char* method ) +callQmlFunction( QQuickItem* qmlObject, const char* method ) { QByteArray methodSignature( method ); methodSignature.append( "()" ); @@ -149,7 +149,7 @@ qmlSearchNames() } void -registerCalamaresModels() +registerQmlModels() { static bool done = false; if ( !done ) diff --git a/src/libcalamaresui/utils/Qml.h b/src/libcalamaresui/utils/Qml.h index 33b44b9ea..d9d226034 100644 --- a/src/libcalamaresui/utils/Qml.h +++ b/src/libcalamaresui/utils/Qml.h @@ -40,7 +40,7 @@ namespace CalamaresUtils * Additionally, modules based on QmlViewStep have a context * property `config` referring to that module's configuration (if any). */ -UIDLLEXPORT void registerCalamaresModels(); +UIDLLEXPORT void registerQmlModels(); /** @brief Calls the QML method @p method on @p qmlObject * @@ -50,7 +50,7 @@ UIDLLEXPORT void registerCalamaresModels(); * * If there is a return value from the QML method, it is logged (but not otherwise used). */ -UIDLLEXPORT void callQMLFunction( QQuickItem* qmlObject, const char* method ); +UIDLLEXPORT void callQmlFunction( QQuickItem* qmlObject, const char* method ); /** @brief Search modes for loading Qml files. * diff --git a/src/libcalamaresui/viewpages/QmlViewStep.cpp b/src/libcalamaresui/viewpages/QmlViewStep.cpp index f92ef47e7..2234c230a 100644 --- a/src/libcalamaresui/viewpages/QmlViewStep.cpp +++ b/src/libcalamaresui/viewpages/QmlViewStep.cpp @@ -58,7 +58,7 @@ changeQMLState( QMLAction action, QQuickItem* item ) static const char propertyName[] = "activatedInCalamares"; bool activate = action == QMLAction::Start; - CalamaresUtils::callQMLFunction( item, activate ? "onActivate" : "onLeave" ); + CalamaresUtils::callQmlFunction( item, activate ? "onActivate" : "onLeave" ); auto property = item->property( propertyName ); if ( property.isValid() && ( property.type() == QVariant::Bool ) && ( property.toBool() != activate ) ) @@ -76,7 +76,7 @@ QmlViewStep::QmlViewStep( QObject* parent ) , m_spinner( new WaitingWidget( tr( "Loading ..." ) ) ) , m_qmlWidget( new QQuickWidget ) { - CalamaresUtils::registerCalamaresModels(); + CalamaresUtils::registerQmlModels(); QVBoxLayout* layout = new QVBoxLayout( m_widget ); layout->addWidget( m_spinner ); diff --git a/src/libcalamaresui/viewpages/Slideshow.cpp b/src/libcalamaresui/viewpages/Slideshow.cpp index db994029c..baed36252 100644 --- a/src/libcalamaresui/viewpages/Slideshow.cpp +++ b/src/libcalamaresui/viewpages/Slideshow.cpp @@ -52,7 +52,7 @@ SlideshowQML::SlideshowQML( QWidget* parent ) , m_qmlComponent( nullptr ) , m_qmlObject( nullptr ) { - CalamaresUtils::registerCalamaresModels(); + CalamaresUtils::registerQmlModels(); m_qmlShow->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); m_qmlShow->setResizeMode( QQuickWidget::SizeRootObjectToView ); @@ -163,7 +163,7 @@ SlideshowQML::changeSlideShowState( Action state ) if ( Branding::instance()->slideshowAPI() == 2 ) { // The QML was already loaded in the constructor, need to start it - CalamaresUtils::callQMLFunction( m_qmlObject, activate ? "onActivate" : "onLeave" ); + CalamaresUtils::callQmlFunction( m_qmlObject, activate ? "onActivate" : "onLeave" ); } else if ( !Calamares::Branding::instance()->slideshowPath().isEmpty() ) {