fix #13,corona should load layout a bit later

--corona should load its layout after the activities
consumer is ready. Otherwise all the functionality
concerning activities may not work correctly on its
first initialization
pull/1/head
Michail Vourlakos 8 years ago
parent e44a1a3a48
commit df084b1783

@ -1,5 +1,6 @@
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Quick Qml)
find_package(KF5I18n NO_MODULE)
find_package(KF5Activities REQUIRED)
include(KDEInstallDirs)
include(KDECMakeSettings)
@ -45,6 +46,7 @@ target_link_libraries(
KF5::XmlGui
KF5::Plasma
KF5::PlasmaQuick
KF5::Activities
KF5::QuickAddons
KF5::WindowSystem
KF5::IconThemes

@ -35,10 +35,13 @@
#include <KPackage/Package>
#include <KPackage/PackageLoader>
#include <kactivities/consumer.h>
namespace Latte {
DockCorona::DockCorona(QObject *parent)
: Plasma::Corona(parent)
: Plasma::Corona(parent),
m_activityConsumer(new KActivities::Consumer(this))
{
KPackage::Package package(new DockPackage(this));
@ -56,7 +59,7 @@ DockCorona::DockCorona(QObject *parent)
connect(this, &Corona::containmentAdded, this, &DockCorona::addDock);
loadLayout();
connect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load);
}
DockCorona::~DockCorona()
@ -69,9 +72,17 @@ DockCorona::~DockCorona()
qDeleteAll(m_dockViews);
m_dockViews.clear();
disconnect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load);
delete m_activityConsumer;
qDebug() << "deleted" << this;
}
void DockCorona::load()
{
loadLayout();
}
int DockCorona::numScreens() const
{
return qGuiApp->screens().count();

@ -31,6 +31,10 @@ class Containment;
class Types;
}
namespace KActivities {
class Consumer;
}
namespace Latte {
class DockCorona : public Plasma::Corona {
@ -62,12 +66,16 @@ signals:
void configurationShown(PlasmaQuick::ConfigView *configView);
void containmentsNoChanged();
private slots:
void load();
private:
void qmlRegisterTypes() const;
int primaryScreenId() const;
//std::vector<DockView *> m_containments;
QHash<const Plasma::Containment *, DockView *> m_dockViews;
KActivities::Consumer *m_activityConsumer;
};
}

Loading…
Cancel
Save