initial plasma6 support

This commit is contained in:
2024-03-07 12:09:46 +02:00
parent eecb128865
commit 4d01b87088
176 changed files with 2569 additions and 3795 deletions

View File

@ -49,9 +49,7 @@ DPAdds::DPAdds(QObject *_parent)
m_vdi = new TaskManager::VirtualDesktopInfo(this);
m_taskModel = new TaskManager::WindowTasksModel(this);
connect(m_vdi, SIGNAL(currentDesktopChanged()), this, SIGNAL(desktopChanged()));
connect(KWindowSystem::self(), SIGNAL(windowAdded(WId)), this, SIGNAL(windowListChanged()));
connect(KWindowSystem::self(), SIGNAL(windowRemoved(WId)), this, SIGNAL(windowListChanged()));
connect(m_vdi, &TaskManager::VirtualDesktopInfo::currentDesktopChanged, this, &DPAdds::desktopChanged);
}
@ -64,13 +62,6 @@ DPAdds::~DPAdds()
}
// HACK: since QML could not use QLoggingCategory I need this hack
bool DPAdds::isDebugEnabled()
{
return LOG_DP().isDebugEnabled();
}
int DPAdds::currentDesktop() const
{
auto current = m_vdi->currentDesktop();
@ -92,7 +83,7 @@ QStringList DPAdds::dictKeys(const bool _sorted, const QString &_regexp)
if (_sorted)
allKeys.sort();
return allKeys.filter(QRegExp(_regexp));
return allKeys.filter(QRegularExpression(_regexp));
}
@ -223,7 +214,7 @@ QString DPAdds::valueByKey(const QString &_key, int _desktop) const
QString currentMark = currentDesktop() == _desktop ? m_mark : "";
if (_key == "mark")
return QString("%1").arg(currentMark, m_mark.count(), QLatin1Char(' ')).replace(" ", " ");
return QString("%1").arg(currentMark, m_mark.size(), QLatin1Char(' ')).replace(" ", " ");
else if (_key == "name") {
auto name = m_vdi->desktopNames().at(_desktop);
return name.replace(" ", " ");