~mir-team/qtmir/trunk

« back to all changes in this revision

Viewing changes to src/platforms/mirserver/nativeinterface.h

  • Committer: Bileto Bot
  • Author(s): Albert Astals Cid, Gerry Boland
  • Date: 2017-03-20 21:15:13 UTC
  • mfrom: (606.4.12 make_sure_surface_not_null)
  • Revision ID: ci-train-bot@canonical.com-20170320211513-z7v3z0ldes3gtcc0
Check for find() result not being null before using it

We do it in onWindowReady, onWindowMoved, onWindowFocusChanged, etc so no reason to not do it in onWindowRemoved

Approved by: Lukáš Tinkl, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2013-2015 Canonical, Ltd.
 
2
 * Copyright (C) 2013-2016 Canonical, Ltd.
3
3
 *
4
4
 * This program is free software: you can redistribute it and/or modify it under
5
5
 * the terms of the GNU Lesser General Public License version 3, as published by
21
21
#include <QSharedPointer>
22
22
#include <qpa/qplatformnativeinterface.h>
23
23
 
 
24
#include <memory>
 
25
 
24
26
// local
25
 
#include "mirserver.h"
 
27
class QMirServer;
 
28
 
 
29
// mir
 
30
namespace qtmir { class PromptSessionManager; }
 
31
namespace mir { namespace shell { class PersistentSurfaceStore; }}
26
32
 
27
33
class NativeInterface : public QPlatformNativeInterface
28
34
{
 
35
    Q_OBJECT
29
36
public:
30
 
    NativeInterface(const QWeakPointer<MirServer> &);
31
 
 
32
 
    virtual void *nativeResourceForIntegration(const QByteArray &resource);
33
 
 
34
 
    QWeakPointer<MirServer> m_mirServer;
 
37
    NativeInterface(QMirServer *);
 
38
 
 
39
    void *nativeResourceForIntegration(const QByteArray &resource) override;
 
40
 
 
41
    QVariantMap windowProperties(QPlatformWindow *window) const override;
 
42
    QVariant windowProperty(QPlatformWindow *window, const QString &name) const override;
 
43
    QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const override;
 
44
 
 
45
    std::shared_ptr<qtmir::PromptSessionManager> thePromptSessionManager() const;
 
46
    std::shared_ptr<mir::shell::PersistentSurfaceStore> thePersistentSurfaceStore() const;
 
47
 
 
48
private:
 
49
    QMirServer *m_qMirServer;
35
50
};
36
51
 
37
52
#endif // NATIVEINTEGRATION_H