2
* eventattribute.cpp - per-user attributes for individual events
4
* Copyright © 2010 by David Jarvie <djarvie@kde.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program 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
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program; if not, write to the Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
#include "eventattribute.h"
29
EventAttribute* EventAttribute::clone() const
31
return new EventAttribute(*this);
34
QByteArray EventAttribute::serialized() const
36
kDebug()<<QByteArray::number(mCommandError);
37
return QByteArray::number(mCommandError);
40
void EventAttribute::deserialize(const QByteArray& data)
43
mCommandError = KAEvent::CMD_NO_ERROR;
47
const QList<QByteArray> items = data.simplified().split(' ');
48
switch (items.count())
51
c[0] = items[0].toInt(&ok);
52
if (!ok || (c[0] & ~(KAEvent::CMD_ERROR | KAEvent::CMD_ERROR_PRE | KAEvent::CMD_ERROR_POST)))
54
mCommandError = static_cast<KAEvent::CmdErrType>(c[0]);
55
kDebug()<<"command error="<<mCommandError;