diff options
author | Ken Moore <ken@ixsystems.com> | 2017-11-16 13:19:48 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-11-16 13:19:48 -0500 |
commit | 31e8c393ea88c99f43817bb91d35355015597e4b (patch) | |
tree | fca8bec343e833bb2cbff4b44cb11d6537cbc5dc /src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp | |
parent | Add a bunch of ZFS information routines to LFileInfo. (diff) | |
download | lumina-31e8c393ea88c99f43817bb91d35355015597e4b.tar.gz lumina-31e8c393ea88c99f43817bb91d35355015597e4b.tar.bz2 lumina-31e8c393ea88c99f43817bb91d35355015597e4b.zip |
Another attempt to fix the Repeater of objects issue in Lumina 2.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp')
3 files changed, 9 insertions, 1 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp index 9842712e..ee15c9c2 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp @@ -36,6 +36,13 @@ QList<ScreenObject*> RootDesktopObject::screens(){ return s_objects; } +ScreenObject* RootDesktopObject::screen(QString id){ + for(int i=0; i<s_objects.length(); i++){ + if(s_objects[i]->name()==id){ return s_objects[i]; } + } + return 0; +} + void RootDesktopObject::logout(){ emit startLogout(); } diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h index dd7c7ab3..786d90e2 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h @@ -30,6 +30,7 @@ public: //QML Read Functions QList<ScreenObject*> screens(); + Q_INVOKABLE ScreenObject* screen(QString id); //QML Access Functions Q_INVOKABLE void logout(); diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp index 4c1d6189..7b84882e 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp @@ -16,7 +16,7 @@ void ScreenObject::RegisterType(){ qmlRegisterType<ScreenObject>("Lumina.Backend.ScreenObject",2,0, "ScreenObject"); } -QString ScreenObject::name(){ return bg_screen->name(); } +QString ScreenObject::name(){ return bg_screen->name().replace("-","_"); } QString ScreenObject::background(){ qDebug() << "Got Background:" << bg_screen->name() << bg << bg_screen->geometry(); return bg; } int ScreenObject::x(){ return bg_screen->geometry().x(); } int ScreenObject::y(){ return bg_screen->geometry().y(); } |