// rdnotification.cpp // // A container class for a Rivendell Notification message. // // (C) Copyright 2018-2020 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // #include #include "rdnotification.h" RDNotification::RDNotification(Type type,Action action,const QVariant &id) { notify_type=type; notify_action=action; notify_id=id; } RDNotification::RDNotification() { notify_type=RDNotification::NullType; notify_action=RDNotification::NoAction; } RDNotification::Type RDNotification::type() const { return notify_type; } void RDNotification::setType(RDNotification::Type type) { notify_type=type; } RDNotification::Action RDNotification::action() const { return notify_action; } void RDNotification::setAction(RDNotification::Action action) { notify_action=action; } QVariant RDNotification::id() const { return notify_id; } void RDNotification::setId(const QVariant id) { notify_id=id; } bool RDNotification::isValid() const { return true; } bool RDNotification::read(const QString &str) { notify_type=RDNotification::NullType; notify_action=RDNotification::NoAction; notify_id=QVariant(); QStringList args=str.split(" "); if(args.size()==4) { if(args[0]!="NOTIFY") { return false; } for(int i=0;i