drop double reference in corona

pull/11/head
Michail Vourlakos 5 years ago
parent c59dc52e1e
commit df844ed171

@ -91,7 +91,7 @@ Corona::Corona(bool defaultLayoutOnStartup, QString layoutNameOnStartUp, int use
m_defaultLayoutOnStartup(defaultLayoutOnStartup), m_defaultLayoutOnStartup(defaultLayoutOnStartup),
m_userSetMemoryUsage(userSetMemoryUsage), m_userSetMemoryUsage(userSetMemoryUsage),
m_layoutNameOnStartUp(layoutNameOnStartUp), m_layoutNameOnStartUp(layoutNameOnStartUp),
m_activityConsumer(new KActivities::Consumer(this)), m_activitiesConsumer(new KActivities::Consumer(this)),
m_screenPool(new ScreenPool(KSharedConfig::openConfig(), this)), m_screenPool(new ScreenPool(KSharedConfig::openConfig(), this)),
m_indicatorFactory(new Indicator::Factory(this)), m_indicatorFactory(new Indicator::Factory(this)),
m_universalSettings(new UniversalSettings(KSharedConfig::openConfig(), this)), m_universalSettings(new UniversalSettings(KSharedConfig::openConfig(), this)),
@ -132,11 +132,11 @@ Corona::Corona(bool defaultLayoutOnStartup, QString layoutNameOnStartUp, int use
qmlRegisterTypes(); qmlRegisterTypes();
if (m_activityConsumer && (m_activityConsumer->serviceStatus() == KActivities::Consumer::Running)) { if (m_activitiesConsumer && (m_activitiesConsumer->serviceStatus() == KActivities::Consumer::Running)) {
load(); load();
} }
connect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &Corona::load); connect(m_activitiesConsumer, &KActivities::Consumer::serviceStatusChanged, this, &Corona::load);
m_viewsScreenSyncTimer.setSingleShot(true); m_viewsScreenSyncTimer.setSingleShot(true);
m_viewsScreenSyncTimer.setInterval(m_universalSettings->screenTrackerInterval()); m_viewsScreenSyncTimer.setInterval(m_universalSettings->screenTrackerInterval());
@ -199,8 +199,8 @@ Corona::~Corona()
m_themeExtended->deleteLater(); m_themeExtended->deleteLater();
m_indicatorFactory->deleteLater(); m_indicatorFactory->deleteLater();
disconnect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &Corona::load); disconnect(m_activitiesConsumer, &KActivities::Consumer::serviceStatusChanged, this, &Corona::load);
delete m_activityConsumer; delete m_activitiesConsumer;
qDebug() << "Latte Corona - deleted..."; qDebug() << "Latte Corona - deleted...";
@ -215,10 +215,10 @@ Corona::~Corona()
void Corona::load() void Corona::load()
{ {
if (m_activityConsumer && (m_activityConsumer->serviceStatus() == KActivities::Consumer::Running) && m_activitiesStarting) { if (m_activitiesConsumer && (m_activitiesConsumer->serviceStatus() == KActivities::Consumer::Running) && m_activitiesStarting) {
m_activitiesStarting = false; m_activitiesStarting = false;
disconnect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &Corona::load); disconnect(m_activitiesConsumer, &KActivities::Consumer::serviceStatusChanged, this, &Corona::load);
m_layoutsManager->load(); m_layoutsManager->load();
@ -229,7 +229,7 @@ void Corona::load()
connect(m_screenPool, &ScreenPool::primaryPoolChanged, this, &Corona::screenCountChanged); connect(m_screenPool, &ScreenPool::primaryPoolChanged, this, &Corona::screenCountChanged);
QString assignedLayout = m_layoutsManager->synchronizer()->shouldSwitchToLayout(m_activityConsumer->currentActivity()); QString assignedLayout = m_layoutsManager->synchronizer()->shouldSwitchToLayout(m_activitiesConsumer->currentActivity());
QString loadLayoutName = ""; QString loadLayoutName = "";
@ -336,11 +336,6 @@ void Corona::setupWaylandIntegration()
connection->roundtrip(); connection->roundtrip();
} }
KActivities::Consumer *Corona::activityConsumer() const
{
return m_activityConsumer;
}
KWayland::Client::PlasmaShell *Corona::waylandCoronaInterface() const KWayland::Client::PlasmaShell *Corona::waylandCoronaInterface() const
{ {
return m_waylandCorona; return m_waylandCorona;
@ -414,7 +409,7 @@ bool Corona::appletExists(uint containmentId, uint appletId) const
KActivities::Consumer *Corona::activitiesConsumer() const KActivities::Consumer *Corona::activitiesConsumer() const
{ {
return m_activityConsumer; return m_activitiesConsumer;
} }
PanelShadows *Corona::dialogShadows() const PanelShadows *Corona::dialogShadows() const
@ -915,7 +910,7 @@ int Corona::screenForContainment(const Plasma::Containment *containment) const
for (auto screen : qGuiApp->screens()) { for (auto screen : qGuiApp->screens()) {
// containment->lastScreen() == m_screenPool->id(screen->name()) to check if the lastScreen refers to a screen that exists/it's known // containment->lastScreen() == m_screenPool->id(screen->name()) to check if the lastScreen refers to a screen that exists/it's known
if (containment->lastScreen() == m_screenPool->id(screen->name()) && if (containment->lastScreen() == m_screenPool->id(screen->name()) &&
(containment->activity() == m_activityConsumer->currentActivity() || (containment->activity() == m_activitiesConsumer->currentActivity() ||
containment->containmentType() == Plasma::Types::PanelContainment || containment->containmentType() == Plasma::Types::CustomPanelContainment)) { containment->containmentType() == Plasma::Types::PanelContainment || containment->containmentType() == Plasma::Types::CustomPanelContainment)) {
return containment->lastScreen(); return containment->lastScreen();
} }

@ -125,7 +125,6 @@ public:
int screenForContainment(const Plasma::Containment *containment) const override; int screenForContainment(const Plasma::Containment *containment) const override;
KActivities::Consumer *activityConsumer() const;
KWayland::Client::PlasmaShell *waylandCoronaInterface() const; KWayland::Client::PlasmaShell *waylandCoronaInterface() const;
KActivities::Consumer *activitiesConsumer() const; KActivities::Consumer *activitiesConsumer() const;
@ -223,7 +222,7 @@ private:
QTimer m_viewsScreenSyncTimer; QTimer m_viewsScreenSyncTimer;
KActivities::Consumer *m_activityConsumer; KActivities::Consumer *m_activitiesConsumer;
QPointer<KAboutApplicationDialog> aboutDialog; QPointer<KAboutApplicationDialog> aboutDialog;
ScreenPool *m_screenPool{nullptr}; ScreenPool *m_screenPool{nullptr};

@ -121,7 +121,7 @@ void GenericLayout::unloadLatteViews()
//!disconnect signals in order to avoid crashes when the layout is unloading //!disconnect signals in order to avoid crashes when the layout is unloading
disconnect(this, &GenericLayout::viewsCountChanged, m_corona, &Plasma::Corona::availableScreenRectChanged); disconnect(this, &GenericLayout::viewsCountChanged, m_corona, &Plasma::Corona::availableScreenRectChanged);
disconnect(this, &GenericLayout::viewsCountChanged, m_corona, &Plasma::Corona::availableScreenRegionChanged); disconnect(this, &GenericLayout::viewsCountChanged, m_corona, &Plasma::Corona::availableScreenRegionChanged);
disconnect(m_corona->activityConsumer(), &KActivities::Consumer::currentActivityChanged, this, &GenericLayout::updateLastUsedActivity); disconnect(m_corona->activitiesConsumer(), &KActivities::Consumer::currentActivityChanged, this, &GenericLayout::updateLastUsedActivity);
for (const auto view : m_latteViews) { for (const auto view : m_latteViews) {
view->disconnectSensitiveSignals(); view->disconnectSensitiveSignals();
@ -940,7 +940,7 @@ bool GenericLayout::initToCorona(Latte::Corona *corona)
updateLastUsedActivity(); updateLastUsedActivity();
//! signals //! signals
connect(m_corona->activityConsumer(), &KActivities::Consumer::currentActivityChanged, connect(m_corona->activitiesConsumer(), &KActivities::Consumer::currentActivityChanged,
this, &GenericLayout::updateLastUsedActivity); this, &GenericLayout::updateLastUsedActivity);
connect(m_corona, &Plasma::Corona::containmentAdded, this, &GenericLayout::addContainment); connect(m_corona, &Plasma::Corona::containmentAdded, this, &GenericLayout::addContainment);

Loading…
Cancel
Save