2018-03-24 Fred Gleason <fredg@paravelsystems.com>

* Added a 'LogType' value to the 'RDNotification::Type
	enumeration.
	* Added support for notifications to rdlogedit(1).
This commit is contained in:
Fred Gleason
2018-03-24 15:47:20 -04:00
parent 04cc669175
commit af0ac339a6
11 changed files with 246 additions and 33 deletions

View File

@@ -92,7 +92,19 @@ bool RDNotification::read(const QString &str)
RDNotification::Type type=(RDNotification::Type)i;
if(args[1]==RDNotification::typeString(type)) {
notify_type=type;
notify_id=QVariant(args[3].toUInt());
switch(type) {
case RDNotification::CartType:
notify_id=QVariant(args[3].toUInt());
break;
case RDNotification::LogType:
notify_id=QVariant(args[3]);
break;
case RDNotification::NullType:
case RDNotification::LastType:
break;
}
}
}
if(notify_type==RDNotification::NullType) {
@@ -124,6 +136,10 @@ QString RDNotification::write() const
ret+=QString().sprintf("%u",notify_id.toUInt());
break;
case RDNotification::LogType:
ret+=notify_id.toString();
break;
case RDNotification::NullType:
case RDNotification::LastType:
break;
@@ -141,6 +157,10 @@ QString RDNotification::typeString(RDNotification::Type type)
ret="CART";
break;
case RDNotification::LogType:
ret="LOG";
break;
case RDNotification::NullType:
case RDNotification::LastType:
break;

View File

@@ -27,7 +27,7 @@
class RDNotification
{
public:
enum Type {NullType=0,CartType=1,LastType=2};
enum Type {NullType=0,CartType=1,LogType=2,LastType=3};
enum Action {NoAction=0,AddAction=1,DeleteAction=2,ModifyAction=3,
LastAction=4};
RDNotification(Type type,Action action,const QVariant &id);