KWin
|
An item model around KWin's D-Bus API for virtual desktops. More...
#include <desktopsmodel.h>
Public Types | |
enum | AdditionalRoles { Id = Qt::UserRole + 1 , DesktopRow , IsDefault } |
Signals | |
void | readyChanged () const |
void | errorChanged () const |
void | userModifiedChanged () const |
void | serverModifiedChanged () const |
void | rowsChanged () const |
void | desktopCountChanged () |
Public Member Functions | |
DesktopsModel (QObject *parent=nullptr) | |
~DesktopsModel () override | |
QHash< int, QByteArray > | roleNames () const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
int | rowCount (const QModelIndex &parent={}) const override |
bool | ready () const |
QString | error () const |
bool | userModified () const |
bool | serverModified () const |
int | rows () const |
void | setRows (int rows) |
int | desktopCount () const |
QString | createDesktopName () const |
Q_INVOKABLE void | createDesktop () |
Q_INVOKABLE void | removeDesktop (const QString &id) |
Q_INVOKABLE void | setDesktopName (const QString &id, const QString &name) |
Q_INVOKABLE void | syncWithServer () |
bool | needsSave () const |
void | load () |
void | defaults () |
bool | isDefaults () const |
Protected Slots | |
void | reset () |
void | getAllAndConnect (const QDBusMessage &msg) |
void | desktopCreated (const QString &id, const KWin::DBusDesktopDataStruct &data) |
void | desktopRemoved (const QString &id) |
void | desktopDataChanged (const QString &id, const KWin::DBusDesktopDataStruct &data) |
void | desktopRowsChanged (uint rows) |
void | updateModifiedState (bool server=false) |
void | handleCallError () |
Properties | |
bool | ready |
QString | error |
bool | userModified |
bool | serverModified |
int | rows |
int | desktopCount |
An item model around KWin's D-Bus API for virtual desktops.
The model initially gets the state from KWin and populates.
As long as the user makes no changes, KWin-side changes are directly exposed in the model.
If the user makes changes (see the userModified
property), it stops exposing KWin-side changes live, but it keeps track of the KWin-side changes, so it can figure out and apply the delta when syncWithServer
is called.
When KWin-side changes happen while the model is user-modified, the model signals this via the serverModified
property. A call to syncWithServer
will overwrite the KWin-side changes.
After synchronization, the model tracks Kwin-side changes again, until the user makes further changes.
Definition at line 44 of file desktopsmodel.h.
Enumerator | |
---|---|
Id | |
DesktopRow | |
IsDefault |
Definition at line 55 of file desktopsmodel.h.
|
explicit |
Definition at line 35 of file desktopsmodel.cpp.
|
override |
Definition at line 91 of file desktopsmodel.cpp.
void KWin::DesktopsModel::createDesktop | ( | ) |
Definition at line 198 of file desktopsmodel.cpp.
QString KWin::DesktopsModel::createDesktopName | ( | ) | const |
Definition at line 187 of file desktopsmodel.cpp.
|
override |
Definition at line 108 of file desktopsmodel.cpp.
void KWin::DesktopsModel::defaults | ( | ) |
Definition at line 401 of file desktopsmodel.cpp.
int KWin::DesktopsModel::desktopCount | ( | ) | const |
Definition at line 182 of file desktopsmodel.cpp.
|
signal |
|
protectedslot |
Definition at line 540 of file desktopsmodel.cpp.
|
protectedslot |
Definition at line 586 of file desktopsmodel.cpp.
|
protectedslot |
Definition at line 566 of file desktopsmodel.cpp.
|
protectedslot |
Definition at line 606 of file desktopsmodel.cpp.
QString KWin::DesktopsModel::error | ( | ) | const |
Definition at line 146 of file desktopsmodel.cpp.
|
signal |
|
protectedslot |
Definition at line 430 of file desktopsmodel.cpp.
|
protectedslot |
Definition at line 671 of file desktopsmodel.cpp.
bool KWin::DesktopsModel::isDefaults | ( | ) | const |
Definition at line 396 of file desktopsmodel.cpp.
void KWin::DesktopsModel::load | ( | ) |
Definition at line 418 of file desktopsmodel.cpp.
bool KWin::DesktopsModel::needsSave | ( | ) | const |
Definition at line 391 of file desktopsmodel.cpp.
bool KWin::DesktopsModel::ready | ( | ) | const |
Definition at line 141 of file desktopsmodel.cpp.
|
signal |
void KWin::DesktopsModel::removeDesktop | ( | const QString & | id | ) |
Definition at line 217 of file desktopsmodel.cpp.
|
protectedslot |
Definition at line 374 of file desktopsmodel.cpp.
|
override |
Definition at line 95 of file desktopsmodel.cpp.
|
override |
Definition at line 132 of file desktopsmodel.cpp.
int KWin::DesktopsModel::rows | ( | ) | const |
Definition at line 161 of file desktopsmodel.cpp.
|
signal |
bool KWin::DesktopsModel::serverModified | ( | ) | const |
Definition at line 156 of file desktopsmodel.cpp.
|
signal |
void KWin::DesktopsModel::setDesktopName | ( | const QString & | id, |
const QString & | name ) |
Definition at line 236 of file desktopsmodel.cpp.
void KWin::DesktopsModel::setRows | ( | int | rows | ) |
Definition at line 166 of file desktopsmodel.cpp.
void KWin::DesktopsModel::syncWithServer | ( | ) |
Definition at line 251 of file desktopsmodel.cpp.
|
protectedslot |
Definition at line 626 of file desktopsmodel.cpp.
bool KWin::DesktopsModel::userModified | ( | ) | const |
Definition at line 151 of file desktopsmodel.cpp.
|
signal |
|
read |
Definition at line 52 of file desktopsmodel.h.
|
read |
Definition at line 48 of file desktopsmodel.h.
|
read |
Definition at line 47 of file desktopsmodel.h.
|
readwrite |
Definition at line 51 of file desktopsmodel.h.
|
read |
Definition at line 50 of file desktopsmodel.h.
|
read |
Definition at line 49 of file desktopsmodel.h.