mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-12 21:35:49 +00:00
initial plasma6 support
This commit is contained in:
@ -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(" ", " ");
|
||||
|
Reference in New Issue
Block a user