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  valid(false),
17  pid(-1)
18 {
19 }
20 
21 KProcessInfo::KProcessInfo() :
22  d_ptr(new KProcessInfoPrivate)
23 {
24 }
25 
26 KProcessInfo::KProcessInfo(qint64 pid, const QString& command, const QString& user) :
27  KProcessInfo(pid, command, command, user)
28 {}
29 
30 
31 KProcessInfo::KProcessInfo(qint64 pid, const QString& command, const QString &name, const QString& user) :
32  d_ptr(new KProcessInfoPrivate)
33 {
34  d_ptr->valid = true;
35  d_ptr->pid = pid;
36  d_ptr->name = name;
37  d_ptr->command = command;
38  d_ptr->user = user;
39 }
40 
41 KProcessInfo::KProcessInfo(const KProcessInfo &other) :
42  d_ptr(new KProcessInfoPrivate)
43 {
44  *this = other;
45 }
46 
47 KProcessInfo::~KProcessInfo()
48 {
49 }
50 
51 KProcessInfo &KProcessInfo::operator=(const KProcessInfo &other)
52 {
53  d_ptr = other.d_ptr;
54  return *this;
55 }
56 
57 bool KProcessInfo::isValid() const
58 {
59  return d_ptr->valid;
60 }
61 
62 qint64 KProcessInfo::pid() const
63 {
64  return d_ptr->pid;
65 }
66 
67 QString KProcessInfo::name() const
68 {
69  return d_ptr->name;
70 }
71 
72 QString KProcessInfo::command() const
73 {
74  return d_ptr->command;
75 }
76 
77 QString KProcessInfo::user() const
78 {
79  return d_ptr->user;
80 }
Contains information about a process.
Definition: kprocesslist.h:28
KProcessPrivate *const d_ptr
Definition: kprocess.h:315
int pid() const
Obtain the process&#39; ID as known to the system.
Definition: kprocess.cpp:308
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri May 29 2020 23:04:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.