[libcalamaresui] Name QML-wrangling functions consistently
- Use "Qml" in camel-cased names
This commit is contained in:
parent
0947da3d41
commit
4491fb8c27
@ -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 );
|
||||
|
@ -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 )
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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 );
|
||||
|
@ -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() )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user