~faenil/ubuntu-ui-toolkit/UbuntuTestCase_flick_flakiness_fix

« back to all changes in this revision

Viewing changes to src/Ubuntu/Components/plugin/ucapplication.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:
33
33
private:
34
34
    Q_DISABLE_COPY(UCApplication)
35
35
    explicit UCApplication(QObject* parent = 0);
36
 
 
 
36
    ~UCApplication();
37
37
 
38
38
public:
39
 
    static UCApplication& instance() {
40
 
        static UCApplication instance;
41
 
        return instance;
 
39
    static UCApplication *instance(QObject *parent = Q_NULLPTR) {
 
40
        if (!m_app) {
 
41
            Q_ASSERT(parent);
 
42
            m_app = new UCApplication(parent);
 
43
        }
 
44
        return m_app;
42
45
    }
43
46
 
44
47
    // getter
53
56
private:
54
57
    QQmlContext* m_context;
55
58
    QObject* m_inputMethod;
 
59
    static UCApplication *m_app;
56
60
 
57
61
Q_SIGNALS:
58
62
    void applicationNameChanged();