mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-28 06:32:32 +02:00
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:
parent
7f9e8f4739
commit
e66cf868e8
@ -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.
|
||||
|
@ -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";
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user