2 Copyright (C) 2015-2024 Ben Kibbey <bjk@luxsci.net>
4 This file is part of qpwmc.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
21 #include <QStringList>
22 #include "pwmdClientInfo.h"
24 ClientInfo::ClientInfo (QString id
, QString name
, QString filename
,
25 QString host
, bool lock
, bool self
, unsigned state
,
26 QString userId
, QString username
, time_t connected
)
30 _filename
= filename
.at(0) == '/' ? "-" : filename
;
37 _connectedAt
= connected
;
41 ClientInfo::~ClientInfo ()
46 ClientInfo::parseLine (const QString
&line
)
48 QStringList fields
= line
.split (" ");
49 ClientInfo
*ci
= new ClientInfo (fields
.at(0), fields
.at(1), fields
.at(2),
50 fields
.at(3), fields
.at(4).toInt() == 1,
51 fields
.at(5).toInt() == 1,
52 fields
.at(6).toUInt(), fields
.at(7),
53 fields
.at(8), fields
.at(9).toUInt());
70 ClientInfo::filename ()
88 ClientInfo::setLocked (bool b
)
106 ClientInfo::setState (unsigned s
)
112 ClientInfo::userId ()
118 ClientInfo::username ()
124 ClientInfo::connectedAt ()
130 ClientInfo::setStale (time_t t
)