~lightdm-team/lightdm/1.4

« back to all changes in this revision

Viewing changes to liblightdm-qt/QLightDM/user.cpp

  • Committer: David Edmundson
  • Date: 2011-05-21 19:47:27 UTC
  • mfrom: (458.1.7 fix_namespace)
  • Revision ID: david@davidedmundson.co.uk-20110521194727-c3wmqlx2n4wjdiqb
Merge branch that puts Qt LightDM into a namespace, removes possibility of file clash. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "ldmuser.h"
2
 
 
3
 
class LdmUserPrivate
 
1
#include "user.h"
 
2
 
 
3
using namespace QLightDM;
 
4
 
 
5
class UserPrivate
4
6
{
5
7
public:
6
8
    QString name;
10
12
    bool isLoggedIn;
11
13
};
12
14
 
13
 
LdmUser::LdmUser():
14
 
    d(new LdmUserPrivate)
 
15
User::User():
 
16
    d(new UserPrivate)
15
17
{
16
18
}
17
19
 
18
 
LdmUser::LdmUser(const QString& name, const QString& realName, const QString& homeDirectory, const QString& image, bool isLoggedIn) :
19
 
    d(new LdmUserPrivate)
 
20
User::User(const QString& name, const QString& realName, const QString& homeDirectory, const QString& image, bool isLoggedIn) :
 
21
    d(new UserPrivate)
20
22
{
21
23
    d->name = name;
22
24
    d->realName = realName;
25
27
    d->isLoggedIn = isLoggedIn;
26
28
}
27
29
 
28
 
LdmUser::LdmUser(const LdmUser &other)
29
 
    :d(new LdmUserPrivate(*other.d))
 
30
User::User(const User &other)
 
31
    :d(new UserPrivate(*other.d))
30
32
{
31
33
}
32
34
 
33
 
LdmUser::~LdmUser()
 
35
User::~User()
34
36
{
35
37
    delete d;
36
38
}
37
39
 
38
40
 
39
 
LdmUser& LdmUser::operator=(const LdmUser& other)
 
41
User& User::operator=(const User& other)
40
42
{
41
43
    *d = *other.d;
42
44
    return *this;
43
45
}
44
46
 
45
 
bool LdmUser::update(const QString& realName, const QString& homeDirectory, const QString& image, bool isLoggedIn)
 
47
bool User::update(const QString& realName, const QString& homeDirectory, const QString& image, bool isLoggedIn)
46
48
{
47
49
    if (d->realName == realName && d->homeDirectory == homeDirectory && d->image == image && d->isLoggedIn == isLoggedIn)
48
50
        return false;
55
57
    return true;
56
58
}
57
59
 
58
 
QString LdmUser::displayName() const
 
60
QString User::displayName() const
59
61
{
60
62
    if (!d->realName.isEmpty())
61
63
    {
67
69
    }
68
70
}
69
71
 
70
 
QString LdmUser::name() const
 
72
QString User::name() const
71
73
{
72
74
    return d->name;
73
75
}
74
76
 
75
 
QString LdmUser::realName() const
 
77
QString User::realName() const
76
78
{
77
79
    return d->realName;
78
80
}
79
81
 
80
 
QString LdmUser::homeDirectory() const
 
82
QString User::homeDirectory() const
81
83
{
82
84
    return d->homeDirectory;
83
85
}
84
86
 
85
 
QString LdmUser::image() const
 
87
QString User::image() const
86
88
{
87
89
    return d->image;
88
90
}
89
91
 
90
 
bool LdmUser::isLoggedIn() const
 
92
bool User::isLoggedIn() const
91
93
{
92
94
    return d->isLoggedIn;
93
95
}