1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-10 21:18:19 +03:00

rename launchersignals to syncedLaunchers

--that is more appropriate name for synced
launchers latte launchers handler
This commit is contained in:
Michail Vourlakos 2021-01-14 20:21:12 +02:00
parent f771100e87
commit 69df6400f2
8 changed files with 57 additions and 62 deletions

View File

@ -34,7 +34,6 @@
#include "layouts/importer.h"
#include "layouts/manager.h"
#include "layouts/synchronizer.h"
#include "layouts/launcherssignals.h"
#include "shortcuts/globalshortcuts.h"
#include "package/lattepackage.h"
#include "plasma/extended/backgroundcache.h"

View File

@ -75,7 +75,6 @@ namespace Layout{
class GenericLayout;
}
namespace Layouts{
class LaunchersSignals;
class Manager;
}
namespace PlasmaExtended{
@ -254,7 +253,6 @@ private:
KWayland::Client::PlasmaShell *m_waylandCorona{nullptr};
friend class GlobalShortcuts;
friend class Layouts::LaunchersSignals;
friend class Layouts::Manager;
friend class Layouts::Storage;
};

View File

@ -1,9 +1,9 @@
set(lattedock-app_SRCS
${lattedock-app_SRCS}
${CMAKE_CURRENT_SOURCE_DIR}/importer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/launcherssignals.cpp
${CMAKE_CURRENT_SOURCE_DIR}/manager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/storage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/syncedlaunchers.cpp
${CMAKE_CURRENT_SOURCE_DIR}/synchronizer.cpp
PARENT_SCOPE
)

View File

@ -24,7 +24,7 @@
// local
#include "importer.h"
#include "launcherssignals.h"
#include "syncedlaunchers.h"
#include "../infoview.h"
#include "../screenpool.h"
#include "../data/layoutdata.h"
@ -49,7 +49,7 @@ namespace Layouts {
Manager::Manager(QObject *parent)
: QObject(parent),
m_importer(new Importer(this)),
m_launchersSignals(new LaunchersSignals(this))
m_syncedLaunchers(new SyncedLaunchers(this))
{
m_corona = qobject_cast<Latte::Corona *>(parent);
//! needs to be created AFTER corona assignment
@ -65,7 +65,7 @@ Manager::Manager(QObject *parent)
Manager::~Manager()
{
m_importer->deleteLater();
m_launchersSignals->deleteLater();
m_syncedLaunchers->deleteLater();
//! no needed because Latte:Corona is calling it at better place
// unload();
@ -131,9 +131,9 @@ Importer *Manager::importer()
return m_importer;
}
LaunchersSignals *Manager::launchersSignals() const
SyncedLaunchers *Manager::syncedLaunchers() const
{
return m_launchersSignals;
return m_syncedLaunchers;
}
Synchronizer *Manager::synchronizer() const

View File

@ -22,7 +22,7 @@
#define LAYOUTSMANAGER_H
// local
#include "launcherssignals.h"
#include "syncedlaunchers.h"
#include "synchronizer.h"
#include "../apptypes.h"
#include "../settings/dialogs/settingsdialog.h"
@ -45,7 +45,7 @@ class Corona;
class CentralLayout;
namespace Layouts {
class Importer;
class LaunchersSignals;
class SyncedLaunchers;
class Synchronizer;
}
}
@ -69,7 +69,7 @@ namespace Layouts {
class Manager : public QObject
{
Q_OBJECT
Q_PROPERTY(LaunchersSignals *launchersSignals READ launchersSignals NOTIFY launchersSignalsChanged)
Q_PROPERTY(SyncedLaunchers *syncedLaunchers READ syncedLaunchers NOTIFY syncedLaunchersChanged)
public:
Manager(QObject *parent = nullptr);
@ -95,7 +95,7 @@ public:
//! returns the current and central layout based on activities and user preferences
QList<CentralLayout *>currentLayouts() const;
LaunchersSignals *launchersSignals() const;
SyncedLaunchers *syncedLaunchers() const;
Synchronizer *synchronizer() const;
public slots:
@ -107,7 +107,7 @@ public slots:
signals:
void centralLayoutsChanged();
void launchersSignalsChanged();
void syncedLaunchersChanged();
void currentLayoutIsSwitching(QString layoutName);
@ -127,7 +127,7 @@ private:
Latte::Corona *m_corona{nullptr};
Importer *m_importer{nullptr};
LaunchersSignals *m_launchersSignals{nullptr};
SyncedLaunchers *m_syncedLaunchers{nullptr};
Synchronizer *m_synchronizer{nullptr};
friend class Latte::Settings::Dialog::SettingsDialog;

View File

@ -1,6 +1,5 @@
/*
* Copyright 2017 Smith AR <audoban@openmailbox.org>
* Michail Vourlakos <mvourlakos@gmail.com>
* Copyright 2021 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
@ -18,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "launcherssignals.h"
#include "syncedlaunchers.h"
// local
#include <coretypes.h>
@ -38,17 +37,17 @@
namespace Latte {
namespace Layouts {
LaunchersSignals::LaunchersSignals(QObject *parent)
SyncedLaunchers::SyncedLaunchers(QObject *parent)
: QObject(parent)
{
m_manager = qobject_cast<Layouts::Manager *>(parent);
}
LaunchersSignals::~LaunchersSignals()
SyncedLaunchers::~SyncedLaunchers()
{
}
void LaunchersSignals::addAbilityClient(QQuickItem *client)
void SyncedLaunchers::addAbilityClient(QQuickItem *client)
{
if (m_clients.contains(client)) {
return;
@ -56,20 +55,20 @@ void LaunchersSignals::addAbilityClient(QQuickItem *client)
m_clients << client;
connect(client, &QObject::destroyed, this, &LaunchersSignals::removeClientObject);
connect(client, &QObject::destroyed, this, &SyncedLaunchers::removeClientObject);
}
void LaunchersSignals::removeAbilityClient(QQuickItem *client)
void SyncedLaunchers::removeAbilityClient(QQuickItem *client)
{
if (!m_clients.contains(client)) {
return;
}
disconnect(client, &QObject::destroyed, this, &LaunchersSignals::removeClientObject);
disconnect(client, &QObject::destroyed, this, &SyncedLaunchers::removeClientObject);
m_clients.removeAll(client);
}
void LaunchersSignals::removeClientObject(QObject *obj)
void SyncedLaunchers::removeClientObject(QObject *obj)
{
QQuickItem *item = qobject_cast<QQuickItem *>(obj);
@ -78,7 +77,7 @@ void LaunchersSignals::removeClientObject(QObject *obj)
}
}
QList<QQuickItem *> LaunchersSignals::clients(QString layoutName)
QList<QQuickItem *> SyncedLaunchers::clients(QString layoutName)
{
QList<QQuickItem *> items;
@ -96,7 +95,7 @@ QList<QQuickItem *> LaunchersSignals::clients(QString layoutName)
return items;
}
void LaunchersSignals::addLauncher(QString layoutName, int launcherGroup, QString launcher)
void SyncedLaunchers::addLauncher(QString layoutName, int launcherGroup, QString launcher)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);
@ -121,7 +120,7 @@ void LaunchersSignals::addLauncher(QString layoutName, int launcherGroup, QStrin
}
}
void LaunchersSignals::removeLauncher(QString layoutName, int launcherGroup, QString launcher)
void SyncedLaunchers::removeLauncher(QString layoutName, int launcherGroup, QString launcher)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);
@ -146,7 +145,7 @@ void LaunchersSignals::removeLauncher(QString layoutName, int launcherGroup, QSt
}
}
void LaunchersSignals::addLauncherToActivity(QString layoutName, int launcherGroup, QString launcher, QString activity)
void SyncedLaunchers::addLauncherToActivity(QString layoutName, int launcherGroup, QString launcher, QString activity)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);
@ -171,7 +170,7 @@ void LaunchersSignals::addLauncherToActivity(QString layoutName, int launcherGro
}
}
void LaunchersSignals::removeLauncherFromActivity(QString layoutName, int launcherGroup, QString launcher, QString activity)
void SyncedLaunchers::removeLauncherFromActivity(QString layoutName, int launcherGroup, QString launcher, QString activity)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);
@ -196,7 +195,7 @@ void LaunchersSignals::removeLauncherFromActivity(QString layoutName, int launch
}
}
void LaunchersSignals::urlsDropped(QString layoutName, int launcherGroup, QStringList urls)
void SyncedLaunchers::urlsDropped(QString layoutName, int launcherGroup, QStringList urls)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);
@ -221,7 +220,7 @@ void LaunchersSignals::urlsDropped(QString layoutName, int launcherGroup, QStrin
}
}
void LaunchersSignals::validateLaunchersOrder(QString layoutName, uint senderId, int launcherGroup, QStringList launchers)
void SyncedLaunchers::validateLaunchersOrder(QString layoutName, uint senderId, int launcherGroup, QStringList launchers)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);

View File

@ -1,6 +1,5 @@
/*
* Copyright 2017 Smith AR <audoban@openmailbox.org>
* Michail Vourlakos <mvourlakos@gmail.com>
* Copyright 2021 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
@ -18,8 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LAUNCHERSSIGNALS_H
#define LAUNCHERSSIGNALS_H
#ifndef SYNCEDLAUNCHERS_H
#define SYNCEDLAUNCHERS_H
// Qt
#include <QList>
@ -45,13 +44,13 @@ namespace Layouts {
//! crashes that occur by setting the launcherList of the tasksModel so
//! often. The plasma devs of libtaskmanager have designed the launchers
//! model to be initialized only once during startup
class LaunchersSignals : public QObject
class SyncedLaunchers : public QObject
{
Q_OBJECT
public:
LaunchersSignals(QObject *parent);
~LaunchersSignals() override;
SyncedLaunchers(QObject *parent);
~SyncedLaunchers() override;
public slots:
Q_INVOKABLE void addAbilityClient(QQuickItem *client);

View File

@ -26,49 +26,49 @@ Item {
property string layoutName: ""
function addAbilityClient(client) {
layoutsManager.launchersSignals.addAbilityClient(client);
layoutsManager.syncedLaunchers.addAbilityClient(client);
}
function removeAbilityClient(client) {
layoutsManager.launchersSignals.removeAbilityClient(client);
layoutsManager.syncedLaunchers.removeAbilityClient(client);
}
function addSyncedLauncher(group, launcherUrl) {
layoutsManager.launchersSignals.addLauncher(layoutName,
group,
launcherUrl);
layoutsManager.syncedLaunchers.addLauncher(layoutName,
group,
launcherUrl);
}
function removeSyncedLauncher(group, launcherUrl) {
layoutsManager.launchersSignals.removeLauncher(layoutName,
group,
launcherUrl);
layoutsManager.syncedLaunchers.removeLauncher(layoutName,
group,
launcherUrl);
}
function addSyncedLauncherToActivity(group, launcherUrl, activityId) {
layoutsManager.launchersSignals.addLauncherToActivity(layoutName,
group,
launcherUrl,
activityId);
layoutsManager.syncedLaunchers.addLauncherToActivity(layoutName,
group,
launcherUrl,
activityId);
}
function removeSyncedLauncherFromActivity(group, launcherUrl, activityId) {
layoutsManager.launchersSignals.removeLauncherFromActivity(layoutName,
group,
launcherUrl,
activityId);
layoutsManager.syncedLaunchers.removeLauncherFromActivity(layoutName,
group,
launcherUrl,
activityId);
}
function addDroppedLaunchers(group, urls) {
layoutsManager.launchersSignals.urlsDropped(layoutName,
group,
urls);
layoutsManager.syncedLaunchers.urlsDropped(layoutName,
group,
urls);
}
function validateSyncedLaunchersOrder(senderId, group, orderedlaunchers) {
layoutsManager.launchersSignals.validateLaunchersOrder(layoutName,
senderId,
group,
orderedlaunchers);
layoutsManager.syncedLaunchers.validateLaunchersOrder(layoutName,
senderId,
group,
orderedlaunchers);
}
}