summaryrefslogtreecommitdiffstats
path: root/src/bus.h
blob: 34da9ac398e98bc4443b3b6e0eab1d49776d93f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef BUS_H
#define BUS_H

#include <QObject>

class QDBusConnection;

class Bus : public QObject
{
    Q_OBJECT
public:
    bool registerListener();
	bool registerService();
    inline static Bus* inst() {
        if (_instance == nullptr) _instance = new Bus();
        return _instance;
    }

signals:
	void serviceConnected(bool sessionBus);

private:
	explicit Bus(QObject *parent = nullptr);
    bool _hasListener;
    static Bus *_instance;
};

#endif // BUS_H