1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-27 14:50:21 +03:00

refactor:rename DockCorona to Latte::Corona

This commit is contained in:
Michail Vourlakos 2018-12-06 14:35:34 +02:00
parent 7a3fcc7773
commit 25d9d4ed17
32 changed files with 181 additions and 192 deletions

View File

@ -2,17 +2,17 @@ set(lattedock-app_SRCS
../liblattedock/dock.cpp
alternativeshelper.cpp
commontools.cpp
dockcorona.cpp
globalshortcuts.cpp
importer.cpp
infoview.cpp
lattecorona.cpp
launcherssignals.cpp
layout.cpp
layoutmanager.cpp
plasmathemeextended.cpp
schemecolors.cpp
screenpool.cpp
packageplugins/shell/lattepackage.cpp
packageplugins/shell/lattepackage.cpp
settings/settingsdialog.cpp
settings/sortedactivitiesmodel.cpp
settings/universalsettings.cpp
@ -28,8 +28,8 @@ set(lattedock-app_SRCS
view/panelshadows.cpp
view/positioner.cpp
view/screenedgeghostwindow.cpp
view/view.cpp
view/visibilitymanager.cpp
view/view.cpp
view/visibilitymanager.cpp
wm/abstractwindowinterface.cpp
wm/waylandinterface.cpp
wm/windowinfowrap.cpp
@ -38,7 +38,7 @@ set(lattedock-app_SRCS
)
set(latte_dbusXML dbus/org.kde.LatteDock.xml)
qt5_add_dbus_adaptor(lattedock-app_SRCS ${latte_dbusXML} dockcorona.h Latte::DockCorona lattedockadaptor)
qt5_add_dbus_adaptor(lattedock-app_SRCS ${latte_dbusXML} lattecorona.h Latte::Corona lattedockadaptor)
ki18n_wrap_ui(lattedock-app_SRCS settings/settingsdialog.ui)
add_executable(latte-dock ${lattedock-app_SRCS})

View File

@ -21,7 +21,7 @@
#include "globalshortcuts.h"
// local
#include "dockcorona.h"
#include "lattecorona.h"
#include "layoutmanager.h"
#include "settings/universalsettings.h"
#include "view/view.h"
@ -153,7 +153,7 @@ const int APPLETEXECUTIONDELAY = 400;
GlobalShortcuts::GlobalShortcuts(QObject *parent)
: QObject(parent)
{
m_corona = qobject_cast<DockCorona *>(parent);
m_corona = qobject_cast<Latte::Corona *>(parent);
if (m_corona) {
init();

View File

@ -34,7 +34,7 @@ class Containment;
}
namespace Latte {
class DockCorona;
class Corona;
class View;
}
@ -81,7 +81,7 @@ private:
QList<QQuickItem *> m_calledItems;
QList<QMetaMethod> m_methodsShowNumbers;
DockCorona *m_corona{nullptr};
Latte::Corona *m_corona{nullptr};
};
}

View File

@ -21,7 +21,7 @@
#include "importer.h"
// local
#include "dockcorona.h"
#include "lattecorona.h"
#include "layoutmanager.h"
#include "layout.h"
#include "screenpool.h"

View File

@ -42,7 +42,7 @@
namespace Latte {
InfoView::InfoView(DockCorona *corona, QString message, QScreen *screen, QWindow *parent)
InfoView::InfoView(Latte::Corona *corona, QString message, QScreen *screen, QWindow *parent)
: QQuickView(parent),
m_corona(corona),
m_message(message),
@ -145,7 +145,7 @@ void InfoView::setupWaylandIntegration()
if (m_corona) {
using namespace KWayland::Client;
PlasmaShell *interface = m_corona->waylandDockCoronaInterface();
PlasmaShell *interface = m_corona->waylandCoronaInterface();
if (!interface) {
return;

View File

@ -22,7 +22,7 @@
#define INFOVIEW_H
// local
#include "dockcorona.h"
#include "lattecorona.h"
// Qt
#include <QObject>
@ -44,7 +44,7 @@ class InfoView : public QQuickView
Q_PROPERTY(Plasma::FrameSvg::EnabledBorders enabledBorders READ enabledBorders NOTIFY enabledBordersChanged)
public:
InfoView(DockCorona *corona, QString message, QScreen *screen = qGuiApp->primaryScreen(), QWindow *parent = nullptr);
InfoView(Latte::Corona *corona, QString message, QScreen *screen = qGuiApp->primaryScreen(), QWindow *parent = nullptr);
~InfoView() override;
Plasma::FrameSvg::EnabledBorders enabledBorders() const;
@ -76,9 +76,8 @@ private:
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
DockCorona *m_corona{nullptr};
Latte::Corona *m_corona{nullptr};
};
}
#endif //DOCKCONFIGVIEW_H
// kate: indent-mode cstyle; indent-width 4; replace-tabs on;
#endif //INFOVIEW_H

View File

@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "dockcorona.h"
#include "lattecorona.h"
// local
#include "alternativeshelper.h"
@ -71,7 +71,7 @@
namespace Latte {
DockCorona::DockCorona(bool defaultLayoutOnStartup, QString layoutNameOnStartUp, int userSetMemoryUsage, QObject *parent)
Corona::Corona(bool defaultLayoutOnStartup, QString layoutNameOnStartUp, int userSetMemoryUsage, QObject *parent)
: Plasma::Corona(parent),
m_defaultLayoutOnStartup(defaultLayoutOnStartup),
m_userSetMemoryUsage(userSetMemoryUsage),
@ -117,11 +117,11 @@ DockCorona::DockCorona(bool defaultLayoutOnStartup, QString layoutNameOnStartUp,
load();
}
connect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load);
connect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &Corona::load);
m_docksScreenSyncTimer.setSingleShot(true);
m_docksScreenSyncTimer.setInterval(m_universalSettings->screenTrackerInterval());
connect(&m_docksScreenSyncTimer, &QTimer::timeout, this, &DockCorona::syncLatteViewsToScreens);
connect(&m_docksScreenSyncTimer, &QTimer::timeout, this, &Corona::syncLatteViewsToScreens);
connect(m_universalSettings, &UniversalSettings::screenTrackerIntervalChanged, this, [this]() {
m_docksScreenSyncTimer.setInterval(m_universalSettings->screenTrackerInterval());
});
@ -132,7 +132,7 @@ DockCorona::DockCorona(bool defaultLayoutOnStartup, QString layoutNameOnStartUp,
dbus.registerObject(QStringLiteral("/Latte"), this);
}
DockCorona::~DockCorona()
Corona::~Corona()
{
//! BEGIN: Give the time to slide-out docks when closing
m_layoutManager->hideAllDocks();
@ -169,24 +169,24 @@ DockCorona::~DockCorona()
m_universalSettings->deleteLater();
m_themeExtended->deleteLater();
disconnect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load);
disconnect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &Corona::load);
delete m_activityConsumer;
qDebug() << "Latte Corona - deleted...";
}
void DockCorona::load()
void Corona::load()
{
if (m_activityConsumer && (m_activityConsumer->serviceStatus() == KActivities::Consumer::Running) && m_activitiesStarting) {
disconnect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load);
disconnect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &Corona::load);
m_layoutManager->load();
m_activitiesStarting = false;
connect(qGuiApp, &QGuiApplication::primaryScreenChanged, this, &DockCorona::primaryOutputChanged, Qt::UniqueConnection);
connect(QApplication::desktop(), &QDesktopWidget::screenCountChanged, this, &DockCorona::screenCountChanged);
connect(qGuiApp, &QGuiApplication::primaryScreenChanged, this, &Corona::primaryOutputChanged, Qt::UniqueConnection);
connect(QApplication::desktop(), &QDesktopWidget::screenCountChanged, this, &Corona::screenCountChanged);
connect(m_screenPool, &ScreenPool::primaryPoolChanged, this, &DockCorona::screenCountChanged);
connect(m_screenPool, &ScreenPool::primaryPoolChanged, this, &Corona::screenCountChanged);
QString assignedLayout = m_layoutManager->shouldSwitchToLayout(m_activityConsumer->currentActivity());
@ -229,11 +229,11 @@ void DockCorona::load()
addOutput(screen);
}
connect(qGuiApp, &QGuiApplication::screenAdded, this, &DockCorona::addOutput, Qt::UniqueConnection);
connect(qGuiApp, &QGuiApplication::screenAdded, this, &Corona::addOutput, Qt::UniqueConnection);
}
}
void DockCorona::unload()
void Corona::unload()
{
qDebug() << "unload: removing containments...";
@ -244,7 +244,7 @@ void DockCorona::unload()
}
}
void DockCorona::setupWaylandIntegration()
void Corona::setupWaylandIntegration()
{
if (!KWindowSystem::isPlatformWayland()) {
return;
@ -263,7 +263,7 @@ void DockCorona::setupWaylandIntegration()
connect(registry, &Registry::plasmaShellAnnounced, this
, [this, registry](quint32 name, quint32 version) {
m_waylandDockCorona = registry->createPlasmaShell(name, version, this);
m_waylandCorona = registry->createPlasmaShell(name, version, this);
});
QObject::connect(registry, &KWayland::Client::Registry::plasmaWindowManagementAnnounced,
@ -281,12 +281,12 @@ void DockCorona::setupWaylandIntegration()
connection->roundtrip();
}
KWayland::Client::PlasmaShell *DockCorona::waylandDockCoronaInterface() const
KWayland::Client::PlasmaShell *Corona::waylandCoronaInterface() const
{
return m_waylandDockCorona;
return m_waylandCorona;
}
void DockCorona::cleanConfig()
void Corona::cleanConfig()
{
auto containmentsEntries = config()->group("Containments");
bool changed = false;
@ -317,7 +317,7 @@ void DockCorona::cleanConfig()
}
}
bool DockCorona::containmentExists(uint id) const
bool Corona::containmentExists(uint id) const
{
foreach (auto containment, containments()) {
if (id == containment->id()) {
@ -328,7 +328,7 @@ bool DockCorona::containmentExists(uint id) const
return false;
}
bool DockCorona::appletExists(uint containmentId, uint appletId) const
bool Corona::appletExists(uint containmentId, uint appletId) const
{
Plasma::Containment *containment = nullptr;
@ -352,42 +352,42 @@ bool DockCorona::appletExists(uint containmentId, uint appletId) const
return false;
}
KActivities::Consumer *DockCorona::activitiesConsumer() const
KActivities::Consumer *Corona::activitiesConsumer() const
{
return m_activityConsumer;
}
ScreenPool *DockCorona::screenPool() const
ScreenPool *Corona::screenPool() const
{
return m_screenPool;
}
UniversalSettings *DockCorona::universalSettings() const
UniversalSettings *Corona::universalSettings() const
{
return m_universalSettings;
}
LayoutManager *DockCorona::layoutManager() const
LayoutManager *Corona::layoutManager() const
{
return m_layoutManager;
}
AbstractWindowInterface *DockCorona::wm() const
AbstractWindowInterface *Corona::wm() const
{
return m_wm;
}
PlasmaThemeExtended *DockCorona::themeExtended() const
PlasmaThemeExtended *Corona::themeExtended() const
{
return m_themeExtended;
}
int DockCorona::numScreens() const
int Corona::numScreens() const
{
return qGuiApp->screens().count();
}
QRect DockCorona::screenGeometry(int id) const
QRect Corona::screenGeometry(int id) const
{
const auto screens = qGuiApp->screens();
const QScreen *screen{qGuiApp->primaryScreen()};
@ -407,12 +407,12 @@ QRect DockCorona::screenGeometry(int id) const
return screen->geometry();
}
QRegion DockCorona::availableScreenRegion(int id) const
QRegion Corona::availableScreenRegion(int id) const
{
return availableScreenRegionWithCriteria(id);
}
QRegion DockCorona::availableScreenRegionWithCriteria(int id, QString forLayout) const
QRegion Corona::availableScreenRegionWithCriteria(int id, QString forLayout) const
{
const auto screens = qGuiApp->screens();
const QScreen *screen{qGuiApp->primaryScreen()};
@ -533,12 +533,12 @@ QRegion DockCorona::availableScreenRegionWithCriteria(int id, QString forLayout)
return available;
}
QRect DockCorona::availableScreenRect(int id) const
QRect Corona::availableScreenRect(int id) const
{
return availableScreenRectWithCriteria(id);
}
QRect DockCorona::availableScreenRectWithCriteria(int id, QList<Dock::Visibility> modes, QList<Plasma::Types::Location> edges) const
QRect Corona::availableScreenRectWithCriteria(int id, QList<Dock::Visibility> modes, QList<Plasma::Types::Location> edges) const
{
const auto screens = qGuiApp->screens();
const QScreen *screen{qGuiApp->primaryScreen()};
@ -607,7 +607,7 @@ QRect DockCorona::availableScreenRectWithCriteria(int id, QList<Dock::Visibility
return available;
}
void DockCorona::addOutput(QScreen *screen)
void Corona::addOutput(QScreen *screen)
{
Q_ASSERT(screen);
@ -632,34 +632,34 @@ void DockCorona::addOutput(QScreen *screen)
emit screenAdded(m_screenPool->id(screen->name()));
}
void DockCorona::primaryOutputChanged()
void Corona::primaryOutputChanged()
{
m_docksScreenSyncTimer.start();
}
void DockCorona::screenRemoved(QScreen *screen)
void Corona::screenRemoved(QScreen *screen)
{
Q_ASSERT(screen);
}
void DockCorona::screenCountChanged()
void Corona::screenCountChanged()
{
m_docksScreenSyncTimer.start();
}
//! the central functions that updates loading/unloading latteviews
//! concerning screen changed (for multi-screen setups mainly)
void DockCorona::syncLatteViewsToScreens()
void Corona::syncLatteViewsToScreens()
{
m_layoutManager->syncLatteViewsToScreens();
}
int DockCorona::primaryScreenId() const
int Corona::primaryScreenId() const
{
return m_screenPool->id(qGuiApp->primaryScreen()->name());
}
void DockCorona::closeApplication()
void Corona::closeApplication()
{
//! this code must be called asynchronously because it is called
//! also from qml (Settings window).
@ -674,7 +674,7 @@ void DockCorona::closeApplication()
});
}
void DockCorona::aboutApplication()
void Corona::aboutApplication()
{
if (aboutDialog) {
aboutDialog->hide();
@ -689,7 +689,7 @@ void DockCorona::aboutApplication()
aboutDialog->show();
}
int DockCorona::screenForContainment(const Plasma::Containment *containment) const
int Corona::screenForContainment(const Plasma::Containment *containment) const
{
//FIXME: indexOf is not a proper way to support multi-screen
// as for environment to environment the indexes change
@ -741,7 +741,7 @@ int DockCorona::screenForContainment(const Plasma::Containment *containment) con
return -1;
}
void DockCorona::showAlternativesForApplet(Plasma::Applet *applet)
void Corona::showAlternativesForApplet(Plasma::Applet *applet)
{
const QString alternativesQML = kPackage().filePath("appletalternativesui");
@ -797,7 +797,7 @@ void DockCorona::showAlternativesForApplet(Plasma::Applet *applet)
});
}
void DockCorona::alternativesVisibilityChanged(bool visible)
void Corona::alternativesVisibilityChanged(bool visible)
{
if (visible) {
return;
@ -817,7 +817,7 @@ void DockCorona::alternativesVisibilityChanged(bool visible)
}
}
void DockCorona::loadDefaultLayout()
void Corona::loadDefaultLayout()
{
qDebug() << "loading default layout";
//! Settting mutable for create a containment
@ -869,7 +869,7 @@ void DockCorona::loadDefaultLayout()
defaultContainment->createApplet(QStringLiteral("org.kde.plasma.analogclock"));
}
QStringList DockCorona::containmentsIds()
QStringList Corona::containmentsIds()
{
QStringList ids;
@ -880,7 +880,7 @@ QStringList DockCorona::containmentsIds()
return ids;
}
QStringList DockCorona::appletsIds()
QStringList Corona::appletsIds()
{
QStringList ids;
@ -893,12 +893,12 @@ QStringList DockCorona::appletsIds()
}
//! Activate launcher menu through dbus interface
void DockCorona::activateLauncherMenu()
void Corona::activateLauncherMenu()
{
m_globalShortcuts->activateLauncherMenu();
}
void DockCorona::windowColorScheme(QString windowIdAndScheme)
void Corona::windowColorScheme(QString windowIdAndScheme)
{
int firstSlash = windowIdAndScheme.indexOf("-");
QString windowIdStr = windowIdAndScheme.mid(0, firstSlash);
@ -908,18 +908,18 @@ void DockCorona::windowColorScheme(QString windowIdAndScheme)
}
//! update badge for specific dock item
void DockCorona::updateDockItemBadge(QString identifier, QString value)
void Corona::updateDockItemBadge(QString identifier, QString value)
{
m_globalShortcuts->updateDockItemBadge(identifier, value);
}
void DockCorona::switchToLayout(QString layout)
void Corona::switchToLayout(QString layout)
{
m_layoutManager->switchToLayout(layout);
}
void DockCorona::showSettingsWindow(int page)
void Corona::showSettingsWindow(int page)
{
Dock::LatteConfigPage p = Dock::LayoutPage;
@ -930,7 +930,7 @@ void DockCorona::showSettingsWindow(int page)
m_layoutManager->showLatteSettingsDialog(p);
}
QStringList DockCorona::contextMenuData()
QStringList Corona::contextMenuData()
{
QStringList data;
@ -948,7 +948,7 @@ QStringList DockCorona::contextMenuData()
return data;
}
inline void DockCorona::qmlRegisterTypes() const
inline void Corona::qmlRegisterTypes() const
{
qmlRegisterType<QScreen>();
}

View File

@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DOCKCORONA_H
#define DOCKCORONA_H
#ifndef LATTECORONA_H
#define LATTECORONA_H
// local
#include "../liblattedock/dock.h"
@ -70,17 +70,17 @@ class PlasmaThemeExtended;
namespace Latte {
class DockCorona : public Plasma::Corona
class Corona : public Plasma::Corona
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.LatteDock")
public:
DockCorona(bool defaultLayoutOnStartup = false,
Corona(bool defaultLayoutOnStartup = false,
QString layoutNameOnStartUp = QString(),
int userSetMemoryUsage = -1,
QObject *parent = nullptr);
virtual ~DockCorona();
virtual ~Corona();
int numScreens() const override;
QRect screenGeometry(int id) const override;
@ -107,7 +107,7 @@ public:
LayoutManager *layoutManager() const;
PlasmaThemeExtended *themeExtended() const;
KWayland::Client::PlasmaShell *waylandDockCoronaInterface() const;
KWayland::Client::PlasmaShell *waylandCoronaInterface() const;
//! these functions are used from context menu through containmentactions
void switchToLayout(QString layout);
@ -175,7 +175,7 @@ private:
LayoutManager *m_layoutManager{nullptr};
PlasmaThemeExtended *m_themeExtended{nullptr};
KWayland::Client::PlasmaShell *m_waylandDockCorona{nullptr};
KWayland::Client::PlasmaShell *m_waylandCorona{nullptr};
friend class GlobalShortcuts;
friend class Layout;
@ -185,4 +185,4 @@ private:
}
#endif // DOCKCORONA_H
#endif // LATTECORONA_H

View File

@ -21,7 +21,7 @@
#include "launcherssignals.h"
// local
#include "dockcorona.h"
#include "lattecorona.h"
#include "layout.h"
// Qt

View File

@ -21,8 +21,8 @@
#include "layout.h"
// local
#include "dockcorona.h"
#include "importer.h"
#include "lattecorona.h"
#include "layoutmanager.h"
#include "screenpool.h"
#include "view/positioner.h"
@ -179,7 +179,7 @@ void Layout::init()
connect(this, &Layout::lastUsedActivityChanged, this, &Layout::saveConfig);
}
void Layout::initToCorona(DockCorona *corona)
void Layout::initToCorona(Latte::Corona *corona)
{
m_corona = corona;
@ -997,9 +997,9 @@ void Layout::addDock(Plasma::Containment *containment, bool forceOnPrimary, int
// connect(containment, &QObject::destroyed, this, &Layout::containmentDestroyed);
connect(containment, &Plasma::Applet::destroyedChanged, this, &Layout::destroyedChanged);
connect(containment, &Plasma::Applet::locationChanged, m_corona, &DockCorona::dockLocationChanged);
connect(containment, &Plasma::Applet::locationChanged, m_corona, &Latte::Corona::dockLocationChanged);
connect(containment, &Plasma::Containment::appletAlternativesRequested
, m_corona, &DockCorona::showAlternativesForApplet, Qt::QueuedConnection);
, m_corona, &Latte::Corona::showAlternativesForApplet, Qt::QueuedConnection);
if (m_corona->layoutManager()->memoryUsage() == Dock::MultipleLayouts) {
connect(containment, &Plasma::Containment::appletCreated, this, &Layout::appletCreated);

View File

@ -39,7 +39,7 @@ class Types;
}
namespace Latte {
class DockCorona;
class Corona;
class View;
}
@ -69,7 +69,7 @@ public:
static const QString MultipleLayoutsName;
void initToCorona(DockCorona *corona);
void initToCorona(Latte::Corona *corona);
void syncToLayoutFile(bool removeLayoutId = false);
void unloadContainments();
void unloadLatteViews();
@ -242,7 +242,7 @@ private:
QStringList m_unloadedContainmentsIds;
DockCorona *m_corona{nullptr};
Latte::Corona *m_corona{nullptr};
KConfigGroup m_layoutGroup;
QList<Plasma::Containment *> m_containments;

View File

@ -53,7 +53,7 @@ LayoutManager::LayoutManager(QObject *parent)
m_launchersSignals(new LaunchersSignals(this)),
m_activitiesController(new KActivities::Controller(this))
{
m_corona = qobject_cast<DockCorona *>(parent);
m_corona = qobject_cast<Latte::Corona *>(parent);
if (m_corona) {
connect(m_corona->universalSettings(), &UniversalSettings::currentLayoutNameChanged, this, &LayoutManager::currentLayoutNameChanged);
@ -164,7 +164,7 @@ void LayoutManager::unload()
file2.remove();
}
DockCorona *LayoutManager::corona()
Latte::Corona *LayoutManager::corona()
{
return m_corona;
}

View File

@ -43,7 +43,7 @@ class Controller;
}
namespace Latte {
class DockCorona;
class Corona;
class Importer;
class Layout;
class LaunchersSignals;
@ -69,7 +69,7 @@ public:
LayoutManager(QObject *parent = nullptr);
~LayoutManager() override;
DockCorona *corona();
Latte::Corona *corona();
Importer *importer();
void load();
@ -185,7 +185,7 @@ private:
QPointer<Latte::SettingsDialog> m_latteSettingsDialog;
DockCorona *m_corona{nullptr};
Latte::Corona *m_corona{nullptr};
Importer *m_importer{nullptr};
LaunchersSignals *m_launchersSignals{nullptr};

View File

@ -19,9 +19,9 @@
*/
// local
#include "dockcorona.h"
#include "config-latte.h"
#include "importer.h"
#include "lattecorona.h"
#include "../liblattedock/dock.h"
// C++
@ -256,7 +256,7 @@ int main(int argc, char **argv)
KCrash::setDrKonqiEnabled(true);
KCrash::setFlags(KCrash::AutoRestart | KCrash::AlwaysDirectly);
Latte::DockCorona corona(defaultLayoutOnStartup, layoutNameOnStartup, memoryUsage);
Latte::Corona corona(defaultLayoutOnStartup, layoutNameOnStartup, memoryUsage);
KDBusService service(KDBusService::Unique);
return app.exec();

View File

@ -22,7 +22,7 @@
// local
#include "commontools.h"
#include "dockcorona.h"
#include "lattecorona.h"
#include "schemecolors.h"
#include "view/panelshadows_p.h"
@ -43,7 +43,7 @@ PlasmaThemeExtended::PlasmaThemeExtended(KSharedConfig::Ptr config, QObject *par
QObject(parent),
m_themeGroup(KConfigGroup(config, QStringLiteral("PlasmaThemeExtended")))
{
m_corona = qobject_cast<DockCorona *>(parent);
m_corona = qobject_cast<Latte::Corona *>(parent);
loadConfig();

View File

@ -39,8 +39,10 @@
#include <Plasma/Theme>
namespace Latte {
class Corona;
}
class DockCorona;
namespace Latte {
class PlasmaThemeExtended: public QObject
{
@ -114,7 +116,7 @@ private:
KConfigGroup m_themeGroup;
Plasma::Theme m_theme;
DockCorona *m_corona{nullptr};
Latte::Corona *m_corona{nullptr};
SchemeColors *m_normalScheme{nullptr};
SchemeColors *m_reversedScheme{nullptr};
};

View File

@ -22,13 +22,13 @@
#include "settingsdialog.h"
// local
#include "dockcorona.h"
#include "layout.h"
#include "layoutmanager.h"
#include "importer.h"
#include "plasmathemeextended.h"
#include "universalsettings.h"
#include "ui_settingsdialog.h"
#include "../lattecorona.h"
#include "../liblattedock/dock.h"
#include "delegates/checkboxdelegate.h"
#include "delegates/colorcmbboxdelegate.h"
@ -74,7 +74,7 @@ const int THEMEDEFAULTROUNDNESS = 0; //Breeze default value is used 0px.
const QChar CheckMark{0x2714};
SettingsDialog::SettingsDialog(QWidget *parent, DockCorona *corona)
SettingsDialog::SettingsDialog(QWidget *parent, Latte::Corona *corona)
: QDialog(parent),
ui(new Ui::SettingsDialog),
m_corona(corona)
@ -211,8 +211,8 @@ SettingsDialog::SettingsDialog(QWidget *parent, DockCorona *corona)
updateApplyButtonsState();
});
connect(aboutAction, &QAction::triggered, m_corona, &DockCorona::aboutApplication);
connect(quitAction, &QAction::triggered, m_corona, &DockCorona::closeApplication);
connect(aboutAction, &QAction::triggered, m_corona, &Latte::Corona::aboutApplication);
connect(quitAction, &QAction::triggered, m_corona, &Latte::Corona::closeApplication);
//! update all layouts view when runningActivities changed. This way we update immediately
//! the running Activities in Activities checkboxes which are shown as bold

View File

@ -42,7 +42,7 @@ class Controller;
}
namespace Latte {
class DockCorona;
class Corona;
class Layout;
}
@ -52,7 +52,7 @@ class SettingsDialog : public QDialog
{
Q_OBJECT
public:
SettingsDialog(QWidget *parent, DockCorona *corona);
SettingsDialog(QWidget *parent, Latte::Corona *corona);
~SettingsDialog();
void setCurrentPage(Dock::LatteConfigPage page);
@ -122,7 +122,7 @@ private:
QTimer m_activityClosedTimer;
bool m_blockDeleteOnReject{false};
DockCorona *m_corona{nullptr};
Latte::Corona *m_corona{nullptr};
QStandardItemModel *m_model{nullptr};
Ui::SettingsDialog *ui;

View File

@ -44,7 +44,7 @@ UniversalSettings::UniversalSettings(KSharedConfig::Ptr config, QObject *parent)
m_config(config),
m_universalGroup(KConfigGroup(config, QStringLiteral("UniversalSettings")))
{
m_corona = qobject_cast<DockCorona *>(parent);
m_corona = qobject_cast<Latte::Corona *>(parent);
connect(this, &UniversalSettings::canDisableBordersChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::currentLayoutNameChanged, this, &UniversalSettings::saveConfig);
@ -483,24 +483,12 @@ void UniversalSettings::cleanupSettings()
QString UniversalSettings::splitterIconPath()
{
auto *dockCorona = qobject_cast<DockCorona *>(parent());
if (dockCorona) {
return dockCorona->kPackage().filePath("splitter");
}
return "";
return m_corona->kPackage().filePath("splitter");
}
QString UniversalSettings::trademarkIconPath()
{
auto *dockCorona = qobject_cast<DockCorona *>(parent());
if (dockCorona) {
return dockCorona->kPackage().filePath("trademark");
}
return "";
return m_corona->kPackage().filePath("trademark");
}
QAbstractItemModel *UniversalSettings::runningActivitiesModel() const

View File

@ -22,7 +22,7 @@
#define UNIVERSALSETTINGS_H
// local
#include "dockcorona.h"
#include "../lattecorona.h"
#include "../liblattedock/dock.h"
// Qt
@ -183,14 +183,14 @@ private:
SortedActivitiesModel *m_runningActivitiesModel{nullptr};
QPointer<DockCorona> m_corona;
QPointer<Latte::Corona> m_corona;
KConfigGroup m_universalGroup;
KSharedConfig::Ptr m_config;
KSharedConfig::Ptr m_shortcutsConfigPtr;
friend class LayoutManager;
friend class DockCorona;
friend class Latte::Corona;
};
}

View File

@ -22,7 +22,7 @@
// local
#include "view.h"
#include "visibilitymanager.h"
#include "../dockcorona.h"
#include "../lattecorona.h"
#include "../layoutmanager.h"
// Qt

View File

@ -23,7 +23,7 @@
// local
#include "view.h"
#include "panelshadows_p.h"
#include "../dockcorona.h"
#include "../lattecorona.h"
#include "../layoutmanager.h"
#include "../settings/universalsettings.h"
#include "../wm/abstractwindowinterface.h"
@ -51,7 +51,7 @@ DockConfigView::DockConfigView(Plasma::Containment *containment, Latte::View *vi
: PlasmaQuick::ConfigView(containment, parent),
m_latteView(view)
{
m_corona = qobject_cast<DockCorona *>(m_latteView->containment()->corona());
m_corona = qobject_cast<Latte::Corona *>(m_latteView->containment()->corona());
setupWaylandIntegration();
@ -374,7 +374,7 @@ void DockConfigView::setupWaylandIntegration()
if (m_corona) {
using namespace KWayland::Client;
PlasmaShell *interface = m_corona->waylandDockCoronaInterface();
PlasmaShell *interface = m_corona->waylandCoronaInterface();
if (!interface) {
return;

View File

@ -50,7 +50,7 @@ class PlasmaShellSurface;
}
namespace Latte {
class DockCorona;
class Corona;
class View;
}
@ -136,7 +136,7 @@ private:
Plasma::FrameSvg::EnabledBorders m_enabledBorders{Plasma::FrameSvg::AllBorders};
DockCorona *m_corona{nullptr};
Latte::Corona *m_corona{nullptr};
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
};

View File

@ -23,7 +23,7 @@
#include "dockconfigview.h"
#include "panelshadows_p.h"
#include "view.h"
#include "../dockcorona.h"
#include "../lattecorona.h"
#include "../wm/abstractwindowinterface.h"
// Qt
@ -50,7 +50,7 @@ DockSecConfigView::DockSecConfigView(Latte::View *view, QWindow *parent)
m_parent(parent),
m_latteView(view)
{
m_corona = qobject_cast<DockCorona *>(m_latteView->containment()->corona());
m_corona = qobject_cast<Latte::Corona *>(m_latteView->containment()->corona());
setupWaylandIntegration();
@ -277,7 +277,7 @@ void DockSecConfigView::setupWaylandIntegration()
if (m_corona) {
using namespace KWayland::Client;
PlasmaShell *interface = m_corona->waylandDockCoronaInterface();
PlasmaShell *interface = m_corona->waylandCoronaInterface();
if (!interface) {
return;

View File

@ -47,7 +47,7 @@ class PlasmaShellSurface;
}
namespace Latte {
class DockCorona;
class Corona;
class View;
}
@ -101,7 +101,7 @@ private:
Plasma::FrameSvg::EnabledBorders m_enabledBorders{Plasma::FrameSvg::AllBorders};
DockCorona *m_corona{nullptr};
Latte::Corona *m_corona{nullptr};
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
};

View File

@ -22,7 +22,7 @@
// local
#include "effects.h"
#include "view.h"
#include "../dockcorona.h"
#include "../lattecorona.h"
#include "../screenpool.h"
#include "../settings/universalsettings.h"
#include "../../liblattedock/dock.h"
@ -54,15 +54,15 @@ Positioner::Positioner(Latte::View *parent)
m_validateGeometryTimer.setInterval(500);
connect(&m_validateGeometryTimer, &QTimer::timeout, this, &Positioner::syncGeometry);
auto *dockCorona = qobject_cast<DockCorona *>(m_view->corona());
auto *latteCorona = qobject_cast<Latte::Corona *>(m_view->corona());
if (dockCorona) {
m_screenSyncTimer.setInterval(qMax(dockCorona->universalSettings()->screenTrackerInterval() - 500, 1000));
connect(dockCorona->universalSettings(), &UniversalSettings::screenTrackerIntervalChanged, this, [this, dockCorona]() {
m_screenSyncTimer.setInterval(qMax(dockCorona->universalSettings()->screenTrackerInterval() - 500, 1000));
if (latteCorona) {
m_screenSyncTimer.setInterval(qMax(latteCorona->universalSettings()->screenTrackerInterval() - 500, 1000));
connect(latteCorona->universalSettings(), &UniversalSettings::screenTrackerIntervalChanged, this, [this, latteCorona]() {
m_screenSyncTimer.setInterval(qMax(latteCorona->universalSettings()->screenTrackerInterval() - 500, 1000));
});
connect(dockCorona, &DockCorona::dockLocationChanged, this, [&]() {
connect(latteCorona, &Latte::Corona::dockLocationChanged, this, [&]() {
//! check if an edge has been freed for a primary dock
//! from another screen
if (m_view->onPrimary()) {
@ -131,10 +131,10 @@ void Positioner::init()
int Positioner::currentScreenId() const
{
auto *dockCorona = qobject_cast<DockCorona *>(m_view->corona());
auto *latteCorona = qobject_cast<Latte::Corona *>(m_view->corona());
if (dockCorona) {
return dockCorona->screenPool()->id(m_screenToFollowId);
if (latteCorona) {
return latteCorona->screenPool()->id(m_screenToFollowId);
}
return -1;
@ -335,10 +335,10 @@ void Positioner::syncGeometry()
if (m_view->formFactor() == Plasma::Types::Vertical) {
QString layoutName = m_view->managedLayout() ? m_view->managedLayout()->name() : QString();
auto dockCorona = qobject_cast<DockCorona *>(m_view->corona());
int fixedScreen = m_view->onPrimary() ? dockCorona->screenPool()->primaryScreenId() : m_view->containment()->screen();
auto latteCorona = qobject_cast<Latte::Corona *>(m_view->corona());
int fixedScreen = m_view->onPrimary() ? latteCorona->screenPool()->primaryScreenId() : m_view->containment()->screen();
freeRegion = dockCorona->availableScreenRegionWithCriteria(fixedScreen, layoutName);
freeRegion = latteCorona->availableScreenRegionWithCriteria(fixedScreen, layoutName);
maximumRect = maximumNormalGeometry();
QRegion availableRegion = freeRegion.intersected(maximumRect);
availableScreenRect = freeRegion.intersected(maximumRect).boundingRect();

View File

@ -21,7 +21,7 @@
// local
#include "view.h"
#include "../dockcorona.h"
#include "../lattecorona.h"
// Qt
#include <QDebug>
@ -191,10 +191,10 @@ void ScreenEdgeGhostWindow::setupWaylandIntegration()
return;
}
if (DockCorona *c = qobject_cast<DockCorona *>(m_latteView->containment()->corona())) {
if (Latte::Corona *c = qobject_cast<Latte::Corona *>(m_latteView->containment()->corona())) {
using namespace KWayland::Client;
PlasmaShell *interface = c->waylandDockCoronaInterface();
PlasmaShell *interface = c->waylandCoronaInterface();
if (!interface) {
return;

View File

@ -26,7 +26,7 @@
#include "effects.h"
#include "positioner.h"
#include "visibilitymanager.h"
#include "../dockcorona.h"
#include "../lattecorona.h"
#include "../layout.h"
#include "../layoutmanager.h"
#include "../screenpool.h"
@ -120,10 +120,10 @@ View::View(Plasma::Corona *corona, QScreen *targetScreen, bool dockWindowBehavio
connect(this->containment(), SIGNAL(statusChanged(Plasma::Types::ItemStatus)), SLOT(statusChanged(Plasma::Types::ItemStatus)));
}, Qt::DirectConnection);
auto *dockCorona = qobject_cast<DockCorona *>(this->corona());
auto *latteCorona = qobject_cast<Latte::Corona *>(this->corona());
if (dockCorona) {
connect(dockCorona, &DockCorona::dockLocationChanged, this, &View::dockLocationChanged);
if (latteCorona) {
connect(latteCorona, &Latte::Corona::dockLocationChanged, this, &View::dockLocationChanged);
}
}
@ -194,12 +194,12 @@ void View::init()
///!!!!!
rootContext()->setContextProperty(QStringLiteral("dock"), this);
auto *dockCorona = qobject_cast<DockCorona *>(this->corona());
auto *latteCorona = qobject_cast<Latte::Corona *>(this->corona());
if (dockCorona) {
rootContext()->setContextProperty(QStringLiteral("universalSettings"), dockCorona->universalSettings());
rootContext()->setContextProperty(QStringLiteral("layoutManager"), dockCorona->layoutManager());
rootContext()->setContextProperty(QStringLiteral("themeExtended"), dockCorona->themeExtended());
if (latteCorona) {
rootContext()->setContextProperty(QStringLiteral("universalSettings"), latteCorona->universalSettings());
rootContext()->setContextProperty(QStringLiteral("layoutManager"), latteCorona->layoutManager());
rootContext()->setContextProperty(QStringLiteral("themeExtended"), latteCorona->themeExtended());
}
setSource(corona()->kPackage().filePath("lattedockui"));
@ -243,9 +243,9 @@ void View::setupWaylandIntegration()
if (m_shellSurface)
return;
if (DockCorona *c = qobject_cast<DockCorona *>(corona())) {
if (Latte::Corona *c = qobject_cast<Latte::Corona *>(corona())) {
using namespace KWayland::Client;
PlasmaShell *interface {c->waylandDockCoronaInterface()};
PlasmaShell *interface {c->waylandCoronaInterface()};
if (!interface)
return;
@ -701,10 +701,10 @@ void View::setManagedLayout(Layout *layout)
connectionsManagedLayout[0] = connect(m_managedLayout, &Layout::preferredViewForShortcutsChanged, this, &View::preferredViewForShortcutsChangedSlot);
}
DockCorona *dockCorona = qobject_cast<DockCorona *>(this->corona());
Latte::Corona *latteCorona = qobject_cast<Latte::Corona *>(this->corona());
if (dockCorona->layoutManager()->memoryUsage() == Dock::MultipleLayouts) {
connectionsManagedLayout[1] = connect(dockCorona->activitiesConsumer(), &KActivities::Consumer::runningActivitiesChanged, this, [&]() {
if (latteCorona->layoutManager()->memoryUsage() == Dock::MultipleLayouts) {
connectionsManagedLayout[1] = connect(latteCorona->activitiesConsumer(), &KActivities::Consumer::runningActivitiesChanged, this, [&]() {
if (m_managedLayout && m_visibility) {
qDebug() << "DOCK VIEW FROM LAYOUT (runningActivitiesChanged) ::: " << m_managedLayout->name()
<< " - activities: " << m_managedLayout->appliedActivities();
@ -720,7 +720,7 @@ void View::setManagedLayout(Layout *layout)
}
});
connectionsManagedLayout[3] = connect(dockCorona->layoutManager(), &LayoutManager::layoutsChanged, this, [&]() {
connectionsManagedLayout[3] = connect(latteCorona->layoutManager(), &LayoutManager::layoutsChanged, this, [&]() {
if (m_managedLayout) {
applyActivitiesToWindows();
emit activitiesChanged();
@ -761,10 +761,10 @@ void View::moveToLayout(QString layoutName)
QList<Plasma::Containment *> containments = m_managedLayout->unassignFromLayout(this);
DockCorona *dockCorona = qobject_cast<DockCorona *>(this->corona());
Latte::Corona *latteCorona = qobject_cast<Latte::Corona *>(this->corona());
if (dockCorona && containments.size() > 0) {
Layout *newLayout = dockCorona->layoutManager()->activeLayout(layoutName);
if (latteCorona && containments.size() > 0) {
Layout *newLayout = latteCorona->layoutManager()->activeLayout(layoutName);
if (newLayout) {
newLayout->assignToLayout(this, containments);

View File

@ -25,7 +25,7 @@
#include "positioner.h"
#include "screenedgeghostwindow.h"
#include "view.h"
#include "../dockcorona.h"
#include "../lattecorona.h"
#include "../layoutmanager.h"
#include "../screenpool.h"
#include "../wm/windowinfowrap.h"
@ -45,8 +45,8 @@ VisibilityManagerPrivate::VisibilityManagerPrivate(PlasmaQuick::ContainmentView
: QObject(nullptr), q(q), view(view)
{
m_latteView = qobject_cast<Latte::View *>(view);
dockCorona = qobject_cast<DockCorona *>(view->corona());
wm = dockCorona->wm();
m_corona = qobject_cast<Latte::Corona *>(view->corona());
wm = m_corona->wm();
if (m_latteView) {
connect(m_latteView, &Latte::View::eventTriggered, this, &VisibilityManagerPrivate::viewEventManager);
@ -148,8 +148,8 @@ inline void VisibilityManagerPrivate::setMode(Dock::Visibility mode)
wm->setDockStruts(*view, dockGeometry, view->containment()->location());
});
if (dockCorona && dockCorona->layoutManager()->memoryUsage() == Dock::MultipleLayouts) {
connections[2] = connect(dockCorona->activitiesConsumer(), &KActivities::Consumer::currentActivityChanged, this, [&]() {
if (m_corona && m_corona->layoutManager()->memoryUsage() == Dock::MultipleLayouts) {
connections[2] = connect(m_corona->activitiesConsumer(), &KActivities::Consumer::currentActivityChanged, this, [&]() {
updateStrutsBasedOnLayoutsAndActivities();
});
@ -249,11 +249,11 @@ inline void VisibilityManagerPrivate::setMode(Dock::Visibility mode)
void VisibilityManagerPrivate::updateStrutsBasedOnLayoutsAndActivities()
{
bool multipleLayoutsAndCurrent = (dockCorona->layoutManager()->memoryUsage() == Dock::MultipleLayouts
bool multipleLayoutsAndCurrent = (m_corona->layoutManager()->memoryUsage() == Dock::MultipleLayouts
&& m_latteView->managedLayout() && !m_latteView->positioner()->inLocationChangeAnimation()
&& m_latteView->managedLayout()->name() == dockCorona->layoutManager()->currentLayoutName());
&& m_latteView->managedLayout()->name() == m_corona->layoutManager()->currentLayoutName());
if (dockCorona->layoutManager()->memoryUsage() == Dock::SingleLayout || multipleLayoutsAndCurrent) {
if (m_corona->layoutManager()->memoryUsage() == Dock::SingleLayout || multipleLayoutsAndCurrent) {
wm->setDockStruts(*view, dockGeometry, view->location());
} else {
wm->removeDockStruts(*view);
@ -291,10 +291,10 @@ inline void VisibilityManagerPrivate::setIsHidden(bool isHidden)
this->isHidden = isHidden;
if (q->supportsKWinEdges()) {
bool inCurrentLayout = (dockCorona->layoutManager()->memoryUsage() == Dock::SingleLayout ||
(dockCorona->layoutManager()->memoryUsage() == Dock::MultipleLayouts
bool inCurrentLayout = (m_corona->layoutManager()->memoryUsage() == Dock::SingleLayout ||
(m_corona->layoutManager()->memoryUsage() == Dock::MultipleLayouts
&& m_latteView->managedLayout() && !m_latteView->positioner()->inLocationChangeAnimation()
&& m_latteView->managedLayout()->name() == dockCorona->layoutManager()->currentLayoutName()));
&& m_latteView->managedLayout()->name() == m_corona->layoutManager()->currentLayoutName()));
if (inCurrentLayout) {
wm->setEdgeStateFor(edgeGhostWindow, isHidden);
@ -804,7 +804,7 @@ void VisibilityManagerPrivate::updateAvailableScreenGeometry()
}
int currentScrId = m_latteView->positioner()->currentScreenId();
QRect tempAvailableScreenGeometry = dockCorona->availableScreenRectWithCriteria(currentScrId, {Dock::AlwaysVisible}, {});
QRect tempAvailableScreenGeometry = m_corona->availableScreenRectWithCriteria(currentScrId, {Dock::AlwaysVisible}, {});
if (tempAvailableScreenGeometry != availableScreenGeometry) {
availableScreenGeometry = tempAvailableScreenGeometry;
@ -1020,10 +1020,10 @@ void VisibilityManagerPrivate::createEdgeGhostWindow()
connectionsKWinEdges[0] = connect(wm, &WindowSystem::currentActivityChanged,
this, [&]() {
bool inCurrentLayout = (dockCorona->layoutManager()->memoryUsage() == Dock::SingleLayout ||
(dockCorona->layoutManager()->memoryUsage() == Dock::MultipleLayouts
bool inCurrentLayout = (m_corona->layoutManager()->memoryUsage() == Dock::SingleLayout ||
(m_corona->layoutManager()->memoryUsage() == Dock::MultipleLayouts
&& m_latteView->managedLayout() && !m_latteView->positioner()->inLocationChangeAnimation()
&& m_latteView->managedLayout()->name() == dockCorona->layoutManager()->currentLayoutName()));
&& m_latteView->managedLayout()->name() == m_corona->layoutManager()->currentLayoutName()));
if (edgeGhostWindow) {
if (inCurrentLayout) {

View File

@ -23,7 +23,7 @@
namespace Latte {
class DockCorona;
class Corona;
class View;
class VisibilityManager;
class ScreenEdgeGhostWindow;
@ -133,7 +133,7 @@ public:
std::array<QMetaObject::Connection, 1> connectionsKWinEdges;
ScreenEdgeGhostWindow *edgeGhostWindow{nullptr};
DockCorona *dockCorona{nullptr};
Latte::Corona *m_corona{nullptr};
Latte::View *m_latteView{nullptr};
};

View File

@ -21,9 +21,9 @@
#include "waylandinterface.h"
// local
#include "dockcorona.h"
#include "view/screenedgeghostwindow.h"
#include "view/view.h"
#include "../lattecorona.h"
#include "../liblattedock/extras.h"
// Qt
@ -83,7 +83,7 @@ public:
if (!s)
return;
m_shellSurface = m_waylandInterface->waylandDockCoronaInterface()->createSurface(s, this);
m_shellSurface = m_waylandInterface->waylandCoronaInterface()->createSurface(s, this);
qDebug() << "wayland ghost window surface was created...";
m_shellSurface->setSkipTaskbar(true);
@ -99,7 +99,7 @@ public:
WaylandInterface::WaylandInterface(QObject *parent)
: AbstractWindowInterface(parent)
{
m_corona = qobject_cast<DockCorona *>(parent);
m_corona = qobject_cast<Latte::Corona *>(parent);
m_activities = new KActivities::Consumer(this);
@ -127,9 +127,9 @@ void WaylandInterface::initWindowManagement(KWayland::Client::PlasmaWindowManage
}, Qt::QueuedConnection);
}
KWayland::Client::PlasmaShell *WaylandInterface::waylandDockCoronaInterface() const
KWayland::Client::PlasmaShell *WaylandInterface::waylandCoronaInterface() const
{
return m_corona->waylandDockCoronaInterface();
return m_corona->waylandCoronaInterface();
}
void WaylandInterface::setDockExtraFlags(QWindow &view)

View File

@ -41,7 +41,7 @@
namespace Latte {
class DockCorona;
class Corona;
namespace Private {
/**
@ -90,7 +90,7 @@ private:
inline bool isValidWindow(const KWayland::Client::PlasmaWindow *w) const;
void windowCreatedProxy(KWayland::Client::PlasmaWindow *w);
KWayland::Client::PlasmaWindow *windowFor(WindowId wid) const;
KWayland::Client::PlasmaShell *waylandDockCoronaInterface() const;
KWayland::Client::PlasmaShell *waylandCoronaInterface() const;
QSignalMapper *mapper{nullptr};
@ -99,7 +99,7 @@ private:
KWayland::Client::PlasmaWindowManagement *m_windowManagement{nullptr};
DockCorona *m_corona{nullptr};
Latte::Corona *m_corona{nullptr};
};