~mir-team/qtmir/trunk

« back to all changes in this revision

Viewing changes to src/platforms/mirserver/promptsessionmanager.cpp

  • 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
/*
 
2
 * Copyright © 2016 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 3,
 
6
 * as published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
#include "promptsessionmanager.h"
 
18
#include "promptsession.h"
 
19
 
 
20
#include <mir/scene/prompt_session_manager.h>
 
21
 
 
22
qtmir::PromptSessionManager::PromptSessionManager(std::shared_ptr<mir::scene::PromptSessionManager> const &promptSessionManager) :
 
23
    m_promptSessionManager{promptSessionManager}
 
24
{
 
25
}
 
26
 
 
27
qtmir::PromptSessionManager::~PromptSessionManager() = default;
 
28
 
 
29
miral::Application qtmir::PromptSessionManager::applicationFor(const PromptSession &promptSession) const
 
30
{
 
31
    return m_promptSessionManager->application_for(promptSession);
 
32
}
 
33
 
 
34
void qtmir::PromptSessionManager::stopPromptSession(const PromptSession &promptSession) const
 
35
{
 
36
    m_promptSessionManager->stop_prompt_session(promptSession);
 
37
}
 
38
 
 
39
void qtmir::PromptSessionManager::suspendPromptSession(const PromptSession &promptSession) const
 
40
{
 
41
    m_promptSessionManager->suspend_prompt_session(promptSession);
 
42
}
 
43
 
 
44
void qtmir::PromptSessionManager::resumePromptSession(const PromptSession &promptSession) const
 
45
{
 
46
    m_promptSessionManager->resume_prompt_session(promptSession);
 
47
}