diff options
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp')
3 files changed, 9 insertions, 5 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 ee15c9c2..60cf56c3 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 @@ -32,11 +32,15 @@ RootDesktopObject* RootDesktopObject::instance(){ } //QML Read Functions -QList<ScreenObject*> RootDesktopObject::screens(){ - return s_objects; +QStringList RootDesktopObject::screens(){ + qDebug() << "Request Screens:" << s_objects.length(); + QStringList names; + for(int i=0; i<s_objects.length(); i++){ names << s_objects[i]->name(); } + return names; } ScreenObject* RootDesktopObject::screen(QString id){ + qDebug() << "Got Screen Request:" << id; for(int i=0; i<s_objects.length(); i++){ if(s_objects[i]->name()==id){ return s_objects[i]; } } 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 786d90e2..ba586701 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 @@ -16,7 +16,7 @@ class RootDesktopObject : public QObject{ Q_OBJECT //Define all the QML Properties here (interface between QML and the C++ methods below) - Q_PROPERTY( QList<ScreenObject*> screens READ screens NOTIFY screensChanged) + Q_PROPERTY( QStringList screens READ screens NOTIFY screensChanged) public: //main contructor/destructor @@ -29,7 +29,7 @@ public: static RootDesktopObject* instance(); //QML Read Functions - QList<ScreenObject*> screens(); + QStringList screens(); Q_INVOKABLE ScreenObject* screen(QString id); //QML Access Functions 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 7b84882e..4c1d6189 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().replace("-","_"); } +QString ScreenObject::name(){ return bg_screen->name(); } 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(); } |