2022-04-29 Fred Gleason <fredg@paravelsystems.com>

* Added an 'RDNotification::dump()' method.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2022-04-29 12:50:26 -04:00
parent 7f9e8f4739
commit e66cf868e8
3 changed files with 32 additions and 1 deletions

View File

@ -23000,3 +23000,5 @@
* Fixed a regression in rdcatch(1) where creating a new event
using the 'Save As' button would fail to send notifications of
the added event.
2022-04-29 Fred Gleason <fredg@paravelsystems.com>
* Added an 'RDNotification::dump()' method.

View File

@ -190,6 +190,34 @@ QString RDNotification::write() const
}
QString RDNotification::dump() const
{
QString ret;
switch((QMetaType::Type)id().type()) {
case QMetaType::Int:
ret+=QString::asprintf("id: %d",id().toInt());
break;
case QMetaType::UInt:
ret+=QString::asprintf("id: %u",id().toUInt());
break;
case QMetaType::QString:
ret+="id: "+id().toString();
break;
default:
ret+="Unknown QMetaType type value: %u\n",id().type();
break;
}
ret+="type: "+RDNotification::typeString(type());
ret+="action: "+RDNotification::actionString(action());
return ret;
}
QString RDNotification::typeString(RDNotification::Type type)
{
QString ret="UNKNOWN";

View File

@ -2,7 +2,7 @@
//
// A container class for a Rivendell Notification message.
//
// (C) Copyright 2018-2020 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2018-2022 Fred Gleason <fredg@paravelsystems.com>
//
// 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
@ -42,6 +42,7 @@ class RDNotification
bool isValid() const;
bool read(const QString &str);
QString write() const;
QString dump() const;
static QString typeString(Type type);
static QString actionString(Action action);