1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 13:33:50 +03:00

tasks:fix launchers behavior in different applets

BUG:450986
This commit is contained in:
Michail Vourlakos 2022-03-05 11:09:36 +02:00
parent ac021a38b7
commit 21d8728498
4 changed files with 21 additions and 20 deletions

View File

@ -78,13 +78,13 @@ QQuickItem *SyncedLaunchers::client(const int &id)
return nullptr;
}
QList<QQuickItem *> SyncedLaunchers::clients(QString layoutName, int groupId)
QList<QQuickItem *> SyncedLaunchers::clients(QString layoutName, QString groupId)
{
QList<QQuickItem *> items;
for(const auto client: m_clients) {
QString cLayoutName = layoutName.isEmpty() ? QString() : client->property("layoutName").toString();
int gid = client->property("syncedGroupId").toInt();
QString gid = client->property("syncedGroupId").toString();
if (cLayoutName == layoutName && gid == groupId) {
items << client;
}
@ -93,11 +93,11 @@ QList<QQuickItem *> SyncedLaunchers::clients(QString layoutName, int groupId)
return items;
}
QList<QQuickItem *> SyncedLaunchers::clients(QString layoutName, uint senderId, Latte::Types::LaunchersGroup launcherGroup, int launcherGroupId)
QList<QQuickItem *> SyncedLaunchers::clients(QString layoutName, uint senderId, Latte::Types::LaunchersGroup launcherGroup, QString launcherGroupId)
{
QList<QQuickItem *> temclients;
if (launcherGroup == Types::UniqueLaunchers && launcherGroupId < 0) {
if (launcherGroup == Types::UniqueLaunchers && launcherGroupId.isEmpty()) {
//! on its own, single taskmanager
auto c = client(senderId);
if (c) {
@ -110,7 +110,7 @@ QList<QQuickItem *> SyncedLaunchers::clients(QString layoutName, uint senderId,
return temclients;
}
void SyncedLaunchers::addLauncher(QString layoutName, uint senderId, int launcherGroup, int launcherGroupId, QString launcher)
void SyncedLaunchers::addLauncher(QString layoutName, uint senderId, int launcherGroup, QString launcherGroupId, QString launcher)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);
QString lName = (group == Types::LayoutLaunchers) ? layoutName : "";
@ -130,7 +130,7 @@ void SyncedLaunchers::addLauncher(QString layoutName, uint senderId, int launche
}
}
void SyncedLaunchers::removeLauncher(QString layoutName, uint senderId, int launcherGroup, int launcherGroupId, QString launcher)
void SyncedLaunchers::removeLauncher(QString layoutName, uint senderId, int launcherGroup, QString launcherGroupId, QString launcher)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);
QString lName = (group == Types::LayoutLaunchers) ? layoutName : "";
@ -150,7 +150,7 @@ void SyncedLaunchers::removeLauncher(QString layoutName, uint senderId, int laun
}
}
void SyncedLaunchers::addLauncherToActivity(QString layoutName, uint senderId, int launcherGroup, int launcherGroupId, QString launcher, QString activity)
void SyncedLaunchers::addLauncherToActivity(QString layoutName, uint senderId, int launcherGroup, QString launcherGroupId, QString launcher, QString activity)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);
QString lName = (group == Types::LayoutLaunchers) ? layoutName : "";
@ -170,7 +170,7 @@ void SyncedLaunchers::addLauncherToActivity(QString layoutName, uint senderId, i
}
}
void SyncedLaunchers::removeLauncherFromActivity(QString layoutName, uint senderId, int launcherGroup, int launcherGroupId, QString launcher, QString activity)
void SyncedLaunchers::removeLauncherFromActivity(QString layoutName, uint senderId, int launcherGroup, QString launcherGroupId, QString launcher, QString activity)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);
QString lName = (group == Types::LayoutLaunchers) ? layoutName : "";
@ -190,7 +190,7 @@ void SyncedLaunchers::removeLauncherFromActivity(QString layoutName, uint sender
}
}
void SyncedLaunchers::urlsDropped(QString layoutName, uint senderId, int launcherGroup, int launcherGroupId, QStringList urls)
void SyncedLaunchers::urlsDropped(QString layoutName, uint senderId, int launcherGroup, QString launcherGroupId, QStringList urls)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);
QString lName = (group == Types::LayoutLaunchers) ? layoutName : "";
@ -210,7 +210,7 @@ void SyncedLaunchers::urlsDropped(QString layoutName, uint senderId, int launche
}
}
void SyncedLaunchers::validateLaunchersOrder(QString layoutName, uint senderId, int launcherGroup, int launcherGroupId, QStringList launchers)
void SyncedLaunchers::validateLaunchersOrder(QString layoutName, uint senderId, int launcherGroup, QString launcherGroupId, QStringList launchers)
{
Types::LaunchersGroup group = static_cast<Types::LaunchersGroup>(launcherGroup);
QString lName = (group == Types::LayoutLaunchers) ? layoutName : "";

View File

@ -45,16 +45,16 @@ public slots:
Q_INVOKABLE void addAbilityClient(QQuickItem *client);
Q_INVOKABLE void removeAbilityClient(QQuickItem *client);
Q_INVOKABLE void addLauncher(QString layoutName, uint senderId, int launcherGroup, int launcherGroupId, QString launcher);
Q_INVOKABLE void removeLauncher(QString layoutName, uint senderId, int launcherGroup, int launcherGroupId, QString launcher);
Q_INVOKABLE void addLauncherToActivity(QString layoutName, uint senderId, int launcherGroup,int launcherGroupId, QString launcher, QString activity);
Q_INVOKABLE void removeLauncherFromActivity(QString layoutName, uint senderId, int launcherGroup, int launcherGroupId, QString launcher, QString activity);
Q_INVOKABLE void urlsDropped(QString layoutName, uint senderId, int launcherGroup, int launcherGroupId, QStringList urls);
Q_INVOKABLE void validateLaunchersOrder(QString layoutName, uint senderId, int launcherGroup, int launcherGroupId, QStringList launchers);
Q_INVOKABLE void addLauncher(QString layoutName, uint senderId, int launcherGroup, QString launcherGroupId, QString launcher);
Q_INVOKABLE void removeLauncher(QString layoutName, uint senderId, int launcherGroup, QString launcherGroupId, QString launcher);
Q_INVOKABLE void addLauncherToActivity(QString layoutName, uint senderId, int launcherGroup,QString launcherGroupId, QString launcher, QString activity);
Q_INVOKABLE void removeLauncherFromActivity(QString layoutName, uint senderId, int launcherGroup, QString launcherGroupId, QString launcher, QString activity);
Q_INVOKABLE void urlsDropped(QString layoutName, uint senderId, int launcherGroup, QString launcherGroupId, QStringList urls);
Q_INVOKABLE void validateLaunchersOrder(QString layoutName, uint senderId, int launcherGroup, QString launcherGroupId, QStringList launchers);
private:
QList<QQuickItem *> clients(QString layoutName, int groupId);
QList<QQuickItem *> clients(QString layoutName, uint senderId, Latte::Types::LaunchersGroup launcherGroup, int launcherGroupId);
QList<QQuickItem *> clients(QString layoutName, QString groupId);
QList<QQuickItem *> clients(QString layoutName, uint senderId, Latte::Types::LaunchersGroup launcherGroup, QString launcherGroupId);
QQuickItem *client(const int &id);
private slots:

View File

@ -30,8 +30,9 @@ Item {
property bool __isLoadedDuringViewStartup: false
property string appletIndex: bridge && bridge.indexer ? String(bridge.indexer.appletIndex) : ""
property int group: LatteCore.Types.UniqueLaunchers
property int groupId: view && group === LatteCore.Types.UniqueLaunchers ? view.groupId : -1
property string groupId: view && group === LatteCore.Types.UniqueLaunchers ? String(view.groupId) + "#" + appletIndex : ""
property Item bridge: null
property Item layout: null

View File

@ -16,7 +16,7 @@ Item {
readonly property int clientId: plasmoid.id
// used to identify launchers that need to be synced event though their launchers group type
// does not support it e.g. taskmanagers synced in different screens
readonly property int syncedGroupId: _launchers.groupId
readonly property string syncedGroupId: _launchers.groupId
//! Connections
Component.onCompleted: {