1/*
2 This file is part of the KDE Frameworks
3
4 SPDX-FileCopyrightText: 2011 Nokia Corporation and/or its subsidiary(-ies).
5 SPDX-FileCopyrightText: 2019 David Hallas <david@davidhallas.dk>
6
7 SPDX-License-Identifier: LGPL-2.1-only WITH Qt-LGPL-exception-1.1 OR LicenseRef-Qt-Commercial
8*/
9
10#include "kprocesslist.h"
11#include "kprocesslist_p.h"
12
13using namespace KProcessList;
14
15KProcessInfoPrivate::KProcessInfoPrivate()
16{
17}
18
19KProcessInfo::KProcessInfo()
20 : d_ptr(new KProcessInfoPrivate)
21{
22}
23
24KProcessInfo::KProcessInfo(qint64 pid, const QString &command, const QString &user)
25 : KProcessInfo(pid, command, command, user)
26{
27}
28
29KProcessInfo::KProcessInfo(qint64 pid, const QString &command, const QString &name, const QString &user)
30 : d_ptr(new KProcessInfoPrivate)
31{
32 d_ptr->valid = true;
33 d_ptr->pid = pid;
34 d_ptr->name = name;
35 d_ptr->command = command;
36 d_ptr->user = user;
37}
38
39KProcessInfo::KProcessInfo(const KProcessInfo &other)
40 : d_ptr(new KProcessInfoPrivate)
41{
42 *this = other;
43}
44
45KProcessInfo::~KProcessInfo()
46{
47}
48
49KProcessInfo &KProcessInfo::operator=(const KProcessInfo &other)
50{
51 d_ptr = other.d_ptr;
52 return *this;
53}
54
55bool KProcessInfo::isValid() const
56{
57 return d_ptr->valid;
58}
59
60qint64 KProcessInfo::pid() const
61{
62 return d_ptr->pid;
63}
64
65QString KProcessInfo::name() const
66{
67 return d_ptr->name;
68}
69
70QString KProcessInfo::command() const
71{
72 return d_ptr->command;
73}
74
75QString KProcessInfo::user() const
76{
77 return d_ptr->user;
78}
79

source code of kcoreaddons/src/lib/util/kprocesslist.cpp