~faenil/ubuntu-ui-toolkit/UbuntuTestCase_flick_flakiness_fix

« back to all changes in this revision

Viewing changes to src/Ubuntu/Components/plugin/statesaverbackend_p.h

  • Committer: Andrea Bernabei
  • Date: 2016-02-09 21:30:24 UTC
  • mfrom: (1795.2.47 staging)
  • Revision ID: andrea.bernabei@canonical.com-20160209213024-txzjng3d5bewlu1l
merge staging

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
public:
33
33
    ~StateSaverBackend();
34
34
 
35
 
    static StateSaverBackend &instance() {
36
 
        static StateSaverBackend instance;
37
 
        return instance;
 
35
    // FIXME: with multiple engines/views in an application, we must provide
 
36
    // separate SatteSaver backends per engine! This must be refactored!
 
37
    static StateSaverBackend *instance(QObject *parent = Q_NULLPTR) {
 
38
        if (!m_instance) {
 
39
            Q_ASSERT(parent);
 
40
            m_instance = new StateSaverBackend(parent);
 
41
        }
 
42
        return m_instance;
38
43
    }
39
44
 
40
45
    bool enabled() const;
66
71
    QSet<QString> m_register;
67
72
    QStack<QString> m_groupStack;
68
73
    bool m_globalEnabled;
 
74
 
 
75
    static StateSaverBackend *m_instance;
69
76
};
70
77
 
71
78
#endif // STATESAVERBACKEND_P_H