|
|
|
@ -56,9 +56,7 @@ DockCorona::DockCorona(QObject *parent)
|
|
|
|
|
|
|
|
|
|
setKPackage(package);
|
|
|
|
|
qmlRegisterTypes();
|
|
|
|
|
|
|
|
|
|
connect(this, &Corona::containmentAdded, this, &DockCorona::addDock);
|
|
|
|
|
|
|
|
|
|
connect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -75,10 +73,8 @@ DockCorona::~DockCorona()
|
|
|
|
|
qDeleteAll(m_waitingDockViews);
|
|
|
|
|
m_dockViews.clear();
|
|
|
|
|
m_waitingDockViews.clear();
|
|
|
|
|
|
|
|
|
|
disconnect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load);
|
|
|
|
|
delete m_activityConsumer;
|
|
|
|
|
|
|
|
|
|
qDebug() << "deleted" << this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -90,7 +86,6 @@ void DockCorona::load()
|
|
|
|
|
void DockCorona::cleanConfig()
|
|
|
|
|
{
|
|
|
|
|
auto containmentsEntries = config()->group("Containments");
|
|
|
|
|
|
|
|
|
|
bool changed = false;
|
|
|
|
|
|
|
|
|
|
foreach (auto id, containmentsEntries.groupList()) {
|
|
|
|
@ -159,7 +154,6 @@ QRect DockCorona::availableScreenRect(int id) const
|
|
|
|
|
int DockCorona::primaryScreenId() const
|
|
|
|
|
{
|
|
|
|
|
const auto screens = qGuiApp->screens();
|
|
|
|
|
|
|
|
|
|
int id = -1;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < screens.size(); ++i) {
|
|
|
|
@ -234,39 +228,26 @@ void DockCorona::addDock(Plasma::Containment *containment)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto metadata = containment->kPackage().metadata();
|
|
|
|
|
|
|
|
|
|
// the system tray is a containment that behaves as an applet
|
|
|
|
|
// so a dockview shouldnt be created for it
|
|
|
|
|
KPluginMetaData metadata = containment->kPackage().metadata();
|
|
|
|
|
|
|
|
|
|
if (metadata.pluginId() == "org.kde.plasma.private.systemtray") {
|
|
|
|
|
if (metadata.pluginId() != "org.kde.latte.containment")
|
|
|
|
|
return;
|
|
|
|
|
if (metadata.pluginId() != "org.kde.latte.containment")
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (DockView *dock, m_dockViews) {
|
|
|
|
|
if (dock->containment() == containment) {
|
|
|
|
|
|
|
|
|
|
for (auto *dock : m_dockViews) {
|
|
|
|
|
if (dock->containment() == containment)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qDebug() << "Adding dock for container...";
|
|
|
|
|
|
|
|
|
|
auto dockView = new DockView(this);
|
|
|
|
|
dockView->init();
|
|
|
|
|
dockView->setContainment(containment);
|
|
|
|
|
connect(containment, &QObject::destroyed, this, &DockCorona::dockContainmentDestroyed);
|
|
|
|
|
connect(containment, &Plasma::Applet::destroyedChanged, this, &DockCorona::destroyedChanged);
|
|
|
|
|
|
|
|
|
|
dockView->show();
|
|
|
|
|
|
|
|
|
|
m_dockViews[containment] = dockView;
|
|
|
|
|
|
|
|
|
|
emit containmentsNoChanged();
|
|
|
|
|
emit docksCountChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -314,7 +295,6 @@ void DockCorona::loadDefaultLayout()
|
|
|
|
|
|
|
|
|
|
auto config = defaultContainment->config();
|
|
|
|
|
defaultContainment->restore(config);
|
|
|
|
|
|
|
|
|
|
QList<Plasma::Types::Location> edges = freeEdges(defaultContainment->screen());
|
|
|
|
|
|
|
|
|
|
if (edges.count() > 0) {
|
|
|
|
@ -329,9 +309,7 @@ void DockCorona::loadDefaultLayout()
|
|
|
|
|
defaultContainment->flushPendingConstraintsEvents();
|
|
|
|
|
emit containmentAdded(defaultContainment);
|
|
|
|
|
emit containmentCreated(defaultContainment);
|
|
|
|
|
|
|
|
|
|
addDock(defaultContainment);
|
|
|
|
|
|
|
|
|
|
defaultContainment->createApplet(QStringLiteral("org.kde.latte.plasmoid"));
|
|
|
|
|
defaultContainment->createApplet(QStringLiteral("org.kde.plasma.analogclock"));
|
|
|
|
|
}
|
|
|
|
|