KCoreAddons

kprocesslist.cpp
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 <[email protected]>
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 
13 using namespace KProcessList;
14 
15 KProcessInfoPrivate::KProcessInfoPrivate()
16 {
17 }
18 
19 KProcessInfo::KProcessInfo()
20  : d_ptr(new KProcessInfoPrivate)
21 {
22 }
23 
24 KProcessInfo::KProcessInfo(qint64 pid, const QString &command, const QString &user)
25  : KProcessInfo(pid, command, command, user)
26 {
27 }
28 
29 KProcessInfo::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 
39 KProcessInfo::KProcessInfo(const KProcessInfo &other)
40  : d_ptr(new KProcessInfoPrivate)
41 {
42  *this = other;
43 }
44 
45 KProcessInfo::~KProcessInfo()
46 {
47 }
48 
49 KProcessInfo &KProcessInfo::operator=(const KProcessInfo &other)
50 {
51  d_ptr = other.d_ptr;
52  return *this;
53 }
54 
55 bool KProcessInfo::isValid() const
56 {
57  return d_ptr->valid;
58 }
59 
60 qint64 KProcessInfo::pid() const
61 {
62  return d_ptr->pid;
63 }
64 
65 QString KProcessInfo::name() const
66 {
67  return d_ptr->name;
68 }
69 
70 QString KProcessInfo::command() const
71 {
72  return d_ptr->command;
73 }
74 
75 QString KProcessInfo::user() const
76 {
77  return d_ptr->user;
78 }
std::unique_ptr< KProcessPrivate > const d_ptr
Definition: kprocess.h:320
Contains information about a process.
Definition: kprocesslist.h:27
int pid() const
Obtain the process&#39; ID as known to the system.
Definition: kprocess.cpp:306
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Apr 21 2021 23:01:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.