mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-08 13:18:09 +03:00
update layout viewsScreens function
--use Layout::views() function to implement this
This commit is contained in:
parent
40496ca32f
commit
01e60e0aab
@ -1516,36 +1516,17 @@ QList<int> GenericLayout::subContainmentsOf(Plasma::Containment *containment) co
|
||||
|
||||
QList<int> GenericLayout::viewsScreens()
|
||||
{
|
||||
Data::ViewsTable views = viewsTable();
|
||||
QList<int> screens;
|
||||
|
||||
if (isActive()) {
|
||||
for (const auto containment : m_containments) {
|
||||
if (Layouts::Storage::self()->isLatteContainment(containment)) {
|
||||
int screenId{Layouts::Storage::IDNULL};
|
||||
|
||||
//! valid screen id
|
||||
if (latteViewExists(containment)) {
|
||||
screenId = m_latteViews[containment]->positioner()->currentScreenId();
|
||||
} else {
|
||||
screenId = containment->screen();
|
||||
|
||||
if (!Layouts::Storage::isValid(screenId)) {
|
||||
screenId = containment->lastScreen();
|
||||
}
|
||||
}
|
||||
|
||||
if (Layouts::Storage::isValid(screenId) && !screens.contains(screenId)) {
|
||||
screens << screenId;
|
||||
}
|
||||
}
|
||||
for (int i=0; i<views.rowCount(); ++i) {
|
||||
if (!views[i].onPrimary && !screens.contains(views[i].screen)) {
|
||||
screens << views[i].screen;
|
||||
}
|
||||
|
||||
return screens;
|
||||
} else {
|
||||
return Layouts::Storage::self()->viewsScreens(file());
|
||||
}
|
||||
}
|
||||
|
||||
return screens;
|
||||
}
|
||||
|
||||
//! STORAGE
|
||||
|
||||
|
@ -1733,26 +1733,5 @@ Data::ViewsTable Storage::views(const QString &file)
|
||||
return vtable;
|
||||
}
|
||||
|
||||
QList<int> Storage::viewsScreens(const QString &file)
|
||||
{
|
||||
QList<int> screens;
|
||||
|
||||
KSharedConfigPtr lFile = KSharedConfig::openConfig(file);
|
||||
|
||||
KConfigGroup containmentGroups = KConfigGroup(lFile, "Containments");
|
||||
|
||||
for (const auto &cId : containmentGroups.groupList()) {
|
||||
if (Layouts::Storage::self()->isLatteContainment(containmentGroups.group(cId))) {
|
||||
int screenId = containmentGroups.group(cId).readEntry("lastScreen", IDNULL);
|
||||
|
||||
if (isValid(screenId) && !screens.contains(screenId)) {
|
||||
screens << screenId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return screens;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -102,9 +102,6 @@ public:
|
||||
Data::AppletsTable plugins(const Layout::GenericLayout *layout, const int containmentid = IDNULL);
|
||||
Data::AppletsTable plugins(const QString &layoutfile, const int containmentid = IDNULL);
|
||||
|
||||
//! list<screens ids>
|
||||
QList<int> viewsScreens(const QString &file);
|
||||
|
||||
Data::GenericTable<Data::Generic> subcontainments(const KConfigGroup &containmentGroup);
|
||||
Data::GenericTable<Data::Generic> subcontainments(const Layout::GenericLayout *layout, const Plasma::Containment *lattecontainment) const;
|
||||
Data::View view(const KConfigGroup &containmentGroup);
|
||||
|
Loading…
Reference in New Issue
Block a user