Signal changes in Corona.

work/plasma6
Lana Black 9 months ago
parent 2e9324b1e3
commit 2d33519a41

@ -74,7 +74,9 @@
#include <KPackage/Package> #include <KPackage/Package>
#include <KPackage/PackageLoader> #include <KPackage/PackageLoader>
#include <KAboutData> #include <KAboutData>
#include <KDeclarative/QmlObjectSharedEngine> // #include <KDeclarative/QmlObjectSharedEngine>
// QmlObjectSharedEngine seems to be replaced with...
#include <PlasmaQuick/SharedQmlEngine>
#include <KWindowSystem> #include <KWindowSystem>
#include <KWayland/Client/connection_thread.h> #include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/registry.h> #include <KWayland/Client/registry.h>
@ -859,12 +861,13 @@ void Corona::onScreenAdded(QScreen *screen)
if (id == -1) { if (id == -1) {
m_screenPool->insertScreenMapping(screen->name()); m_screenPool->insertScreenMapping(screen->name());
id = m_screenPool->id(screen->name());
} }
connect(screen, &QScreen::geometryChanged, this, &Corona::onScreenGeometryChanged); connect(screen, &QScreen::geometryChanged, this, &Corona::onScreenGeometryChanged);
emit availableScreenRectChanged(); emit availableScreenRectChanged(id);
emit screenAdded(m_screenPool->id(screen->name())); emit screenAdded(id);
onScreenCountChanged(); onScreenCountChanged();
} }
@ -894,8 +897,8 @@ void Corona::onScreenGeometryChanged(const QRect &geometry)
if (id >= 0) { if (id >= 0) {
emit screenGeometryChanged(id); emit screenGeometryChanged(id);
emit availableScreenRegionChanged(); emit availableScreenRegionChanged(id);
emit availableScreenRectChanged(); emit availableScreenRectChanged(id);
} }
} }
@ -990,13 +993,13 @@ void Corona::showAlternativesForApplet(Plasma::Applet *applet)
Latte::View *latteView = m_layoutsManager->synchronizer()->viewForContainment(applet->containment()); Latte::View *latteView = m_layoutsManager->synchronizer()->viewForContainment(applet->containment());
KDeclarative::QmlObjectSharedEngine *qmlObj{nullptr}; PlasmaQuick::SharedQmlEngine *qmlObj{nullptr};
if (latteView) { if (latteView) {
latteView->setAlternativesIsShown(true); latteView->setAlternativesIsShown(true);
qmlObj = new KDeclarative::QmlObjectSharedEngine(latteView); qmlObj = new PlasmaQuick::SharedQmlEngine(latteView);
} else { } else {
qmlObj = new KDeclarative::QmlObjectSharedEngine(this); qmlObj = new PlasmaQuick::SharedQmlEngine(this);
} }
qmlObj->setInitializationDelayed(true); qmlObj->setInitializationDelayed(true);
@ -1021,10 +1024,10 @@ void Corona::showAlternativesForApplet(Plasma::Applet *applet)
return; return;
} }
QMutableListIterator<KDeclarative::QmlObjectSharedEngine *> it(m_alternativesObjects); QMutableListIterator<PlasmaQuick::SharedQmlEngine*> it(m_alternativesObjects);
while (it.hasNext()) { while (it.hasNext()) {
KDeclarative::QmlObjectSharedEngine *obj = it.next(); PlasmaQuick::SharedQmlEngine *obj = it.next();
if (obj == qmlObj) { if (obj == qmlObj) {
it.remove(); it.remove();
@ -1042,10 +1045,10 @@ void Corona::alternativesVisibilityChanged(bool visible)
QObject *root = sender(); QObject *root = sender();
QMutableListIterator<KDeclarative::QmlObjectSharedEngine *> it(m_alternativesObjects); QMutableListIterator<PlasmaQuick::SharedQmlEngine*> it(m_alternativesObjects);
while (it.hasNext()) { while (it.hasNext()) {
KDeclarative::QmlObjectSharedEngine *obj = it.next(); PlasmaQuick::SharedQmlEngine *obj = it.next();
if (obj->rootObject() == root) { if (obj->rootObject() == root) {
it.remove(); it.remove();

@ -20,14 +20,11 @@
// Plasma // Plasma
#include <Plasma/Corona> #include <Plasma/Corona>
#include <PlasmaQuick/SharedQmlEngine>
// KDE // KDE
#include <KAboutApplicationDialog> #include <KAboutApplicationDialog>
namespace KDeclarative {
class QmlObjectSharedEngine;
}
namespace Plasma { namespace Plasma {
class Corona; class Corona;
class Containment; class Containment;
@ -179,8 +176,8 @@ signals:
void configurationShown(PlasmaQuick::ConfigView *configView); void configurationShown(PlasmaQuick::ConfigView *configView);
void viewLocationChanged(); void viewLocationChanged();
void raiseViewsTemporaryChanged(); void raiseViewsTemporaryChanged();
void availableScreenRectChangedFrom(Latte::View *origin); void availableScreenRectChangedFrom(Latte::View *origin, int id);
void availableScreenRegionChangedFrom(Latte::View *origin); void availableScreenRegionChangedFrom(Latte::View *origin, int id);
void verticalUnityViewHasFocus(); void verticalUnityViewHasFocus();
private slots: private slots:
@ -226,7 +223,7 @@ private:
QString m_startupAddViewTemplateName; QString m_startupAddViewTemplateName;
QString m_importFullConfigurationFile; QString m_importFullConfigurationFile;
QList<KDeclarative::QmlObjectSharedEngine *> m_alternativesObjects; QList<PlasmaQuick::SharedQmlEngine *> m_alternativesObjects;
QTimer m_viewsScreenSyncTimer; QTimer m_viewsScreenSyncTimer;

Loading…
Cancel
Save