Changeset View
Changeset View
Standalone View
Standalone View
greeter/greeterapp.cpp
Show First 20 Lines • Show All 304 Lines • ▼ Show 20 Line(s) | 266 | for (int i = m_views.count(); i < nScreens; ++i) { | |||
---|---|---|---|---|---|
305 | context->setContextProperty(QStringLiteral("authenticator"), m_authenticator); | 305 | context->setContextProperty(QStringLiteral("authenticator"), m_authenticator); | ||
306 | context->setContextProperty(QStringLiteral("org_kde_plasma_screenlocker_greeter_interfaceVersion"), 2); | 306 | context->setContextProperty(QStringLiteral("org_kde_plasma_screenlocker_greeter_interfaceVersion"), 2); | ||
307 | context->setContextProperty(QStringLiteral("org_kde_plasma_screenlocker_greeter_view"), view); | 307 | context->setContextProperty(QStringLiteral("org_kde_plasma_screenlocker_greeter_view"), view); | ||
308 | context->setContextProperty(QStringLiteral("defaultToSwitchUser"), m_defaultToSwitchUser); | 308 | context->setContextProperty(QStringLiteral("defaultToSwitchUser"), m_defaultToSwitchUser); | ||
309 | context->setContextProperty(QStringLiteral("config"), m_lnfIntegration->configuration()); | 309 | context->setContextProperty(QStringLiteral("config"), m_lnfIntegration->configuration()); | ||
310 | 310 | | |||
311 | view->setSource(m_mainQmlPath); | 311 | view->setSource(m_mainQmlPath); | ||
312 | // on error, load the fallback lockscreen to not lock the user out of the system | 312 | // on error, load the fallback lockscreen to not lock the user out of the system | ||
313 | if (view->status() == QQmlComponent::Error) { | 313 | if (view->status() == QQmlComponent::Error || m_mainQmlPath.isEmpty()) { | ||
davidedmundson: > view->status() != Ready
should also work, and that covers the case of m_mainQmlPath being… | |||||
314 | static const QUrl fallbackUrl(QUrl(QStringLiteral("qrc:/fallbacktheme/LockScreen.qml"))); | 314 | static const QUrl fallbackUrl(QUrl(QStringLiteral("qrc:/fallbacktheme/LockScreen.qml"))); | ||
315 | 315 | | |||
316 | qWarning() << "Failed to load lockscreen QML, falling back to built-in locker"; | 316 | qWarning() << "Failed to load lockscreen QML, falling back to built-in locker"; | ||
317 | m_mainQmlPath = fallbackUrl; | 317 | m_mainQmlPath = fallbackUrl; | ||
318 | view->setSource(fallbackUrl); | 318 | view->setSource(fallbackUrl); | ||
319 | } | 319 | } | ||
320 | view->setResizeMode(KQuickAddons::QuickViewSharedEngine::SizeRootObjectToView); | 320 | view->setResizeMode(KQuickAddons::QuickViewSharedEngine::SizeRootObjectToView); | ||
321 | 321 | | |||
▲ Show 20 Lines • Show All 423 Lines • Show Last 20 Lines |
should also work, and that covers the case of m_mainQmlPath being set but pointing to an empty file.
We'll never be loading as all files should be local.