mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-10 16:43:35 +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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user