2 * Copyright (C) 2010-2011 David Edmundson.
3 * Author: David Edmundson <kde@davidedmundson.co.uk>
5 * This library is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License as published by the Free
7 * Software Foundation; either version 3 of the License, or (at your option) any
8 * later version. See http://www.gnu.org/copyleft/lgpl.html the full text of the
12 #include "QLightDM/User"
14 #include <QtCore/QSharedData>
16 using namespace QLightDM;
18 class UserPrivate : public QSharedData
23 QString homeDirectory;
33 User::User(const QString& name, const QString& realName, const QString& homeDirectory, const QString& image, bool isLoggedIn) :
37 d->realName = realName;
38 d->homeDirectory = homeDirectory;
40 d->isLoggedIn = isLoggedIn;
43 User::User(const User &other)
53 User& User::operator=(const User& other)
59 bool User::update(const QString& realName, const QString& homeDirectory, const QString& image, bool isLoggedIn)
61 if (d->realName == realName && d->homeDirectory == homeDirectory && d->image == image && d->isLoggedIn == isLoggedIn) {
65 d->realName = realName;
66 d->homeDirectory = homeDirectory;
68 d->isLoggedIn = isLoggedIn;
73 QString User::displayName() const
75 if (!d->realName.isEmpty()) {
83 QString User::name() const
88 QString User::realName() const
93 QString User::homeDirectory() const
95 return d->homeDirectory;
98 QString User::image() const
103 bool User::isLoggedIn() const
105 return d->isLoggedIn;