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 <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
56{
57 return d_ptr->valid;
58}
59
60qint64 KProcessInfo::pid() const
61{
62 return d_ptr->pid;
63}
64
66{
67 return d_ptr->name;
68}
69
71{
72 return d_ptr->command;
73}
74
76{
77 return d_ptr->user;
78}
Contains information about a process.
QString command() const
The command line running this process e.g /bin/ls /some/path -R.
qint64 pid() const
The pid of the process.
QString user() const
The username the process is running under.
bool isValid() const
If the KProcessInfo contains valid information.
QString name() const
The name of the process.
QString name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:00:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.