#ifndef GLOBALINSTANCE_H
#define GLOBALINSTANCE_H

#include <QObject>

class GlobalInstance : public QObject
{
    Q_OBJECT
public:
    static GlobalInstance* getInstance();
    explicit GlobalInstance(QObject *parent = nullptr);
    static GlobalInstance *instance;
    ~GlobalInstance();

    enum   XDG_SESSION_DESKTOP {
        UNKNOWN,
        KYLIN_WLCOM,
        UKUI_WAYLAND,
        UKUI
    };
    XDG_SESSION_DESKTOP session_desktop(){
        if(m_desktop_type == UNKNOWN){
            if(QString(qgetenv("XDG_SESSION_DESKTOP")) == "kylin-wlcom"){
                m_desktop_type = KYLIN_WLCOM;
            }else if(QString(qgetenv("XDG_SESSION_DESKTOP")) == "ukui-wayland"){
                m_desktop_type = UKUI_WAYLAND;
            }else if(QString(qgetenv("XDG_SESSION_DESKTOP")) == "ukui"){
                m_desktop_type = UKUI;
            }
        }
        return m_desktop_type;
    }
signals:

private:
    XDG_SESSION_DESKTOP m_desktop_type = UNKNOWN;
};




#endif // GLOBALINSTANCE_H
