rename launchersignals to syncedLaunchers

--that is more appropriate name for synced
launchers latte launchers handler
work/spdx
Michail Vourlakos 4 years ago
parent f771100e87
commit 69df6400f2

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

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

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

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

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

@ -1,6 +1,5 @@
/* /*
* Copyright 2017 Smith AR <audoban@openmailbox.org> * Copyright 2021 Michail Vourlakos <mvourlakos@gmail.com>
* Michail Vourlakos <mvourlakos@gmail.com>
* *
* This file is part of Latte-Dock * This file is part of Latte-Dock
* *
@ -18,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "launcherssignals.h" #include "syncedlaunchers.h"
// local // local
#include <coretypes.h> #include <coretypes.h>
@ -38,17 +37,17 @@
namespace Latte { namespace Latte {
namespace Layouts { namespace Layouts {
LaunchersSignals::LaunchersSignals(QObject *parent) SyncedLaunchers::SyncedLaunchers(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
m_manager = qobject_cast<Layouts::Manager *>(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)) { if (m_clients.contains(client)) {
return; return;
@ -56,20 +55,20 @@ void LaunchersSignals::addAbilityClient(QQuickItem *client)
m_clients << 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)) { if (!m_clients.contains(client)) {
return; return;
} }
disconnect(client, &QObject::destroyed, this, &LaunchersSignals::removeClientObject); disconnect(client, &QObject::destroyed, this, &SyncedLaunchers::removeClientObject);
m_clients.removeAll(client); m_clients.removeAll(client);
} }
void LaunchersSignals::removeClientObject(QObject *obj) void SyncedLaunchers::removeClientObject(QObject *obj)
{ {
QQuickItem *item = qobject_cast<QQuickItem *>(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; QList<QQuickItem *> items;
@ -96,7 +95,7 @@ QList<QQuickItem *> LaunchersSignals::clients(QString layoutName)
return items; 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); 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); 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); 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); 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); 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); Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);

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

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

Loading…
Cancel
Save