~cimi/unity8/card_touchdown

« back to all changes in this revision

Viewing changes to tests/mocks/SessionManager/SessionManager.cpp

  • Committer: Andrea Cimitan
  • Date: 2014-06-20 15:02:12 UTC
  • mfrom: (917.1.36 obeyArtShapeFixedSize)
  • Revision ID: andrea.cimitan@gmail.com-20140620150212-an6nkcv515i22usy
Merged albert branch with fixes for icon size

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
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
 * Author: Michael Terry <michael.terry@canonical.com>
 
17
 */
 
18
 
 
19
#include "SessionManager.h"
 
20
 
 
21
SessionManager::SessionManager(QObject* parent)
 
22
  : QObject(parent),
 
23
    m_active(true)
 
24
{
 
25
}
 
26
 
 
27
bool SessionManager::active() const
 
28
{
 
29
    return m_active;
 
30
}
 
31
 
 
32
void SessionManager::setActive(bool active)
 
33
{
 
34
    if (m_active != active) {
 
35
        m_active = active;
 
36
        activeChanged();
 
37
    }
 
38
}
 
39
 
 
40
void SessionManager::lock()
 
41
{
 
42
    setActive(false);
 
43
}