KPeople

declarativepersondata.cpp
1 /*
2  SPDX-FileCopyrightText: 2013 David Edmundson <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6 
7 #include "declarativepersondata.h"
8 
9 #include "../persondata.h"
10 #include "kpeople_debug.h"
11 
12 DeclarativePersonData::DeclarativePersonData(QObject *parent)
13  : QObject(parent)
14  , m_person(nullptr)
15 {
16 }
17 
18 void DeclarativePersonData::setPersonUri(const QString &id)
19 {
20  if (id == m_id) {
21  return;
22  }
23 
24  m_id = id;
25  delete m_person;
26  if (m_id.isEmpty()) {
27  m_person = nullptr;
28  } else {
29  m_person = new KPeople::PersonData(id, this);
30  }
31 
32  Q_EMIT personChanged();
33 }
34 
35 KPeople::PersonData *DeclarativePersonData::person() const
36 {
37  return m_person;
38 }
39 
40 QString DeclarativePersonData::personUri() const
41 {
42  return m_id;
43 }
Allows to query the information about a given person.
Definition: persondata.h:34
Q_EMITQ_EMIT
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jan 27 2022 22:42:01 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.