diff --git a/ChangeLog b/ChangeLog index 6b591c7d..88d8eda4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23577,3 +23577,6 @@ 2022-10-30 Fred Gleason * Fixed a regression in rdcatch(1) that caused status indication to break for record events. +2022-10-30 Fred Gleason + * Refactored rdcatch(1) to use the notification mechanism instead of + the 'PurgeEvent' command. diff --git a/docs/apis/notification.xml b/docs/apis/notification.xml index 0793e167..a396fad1 100644 --- a/docs/apis/notification.xml +++ b/docs/apis/notification.xml @@ -578,40 +578,6 @@ - - Purge Event Operation - - Emitted by rdcatch1 to - report purging of a one-shot event. - - - RDCatch Event Request Fields - - - - - - Field - Value - - - Hostname - String, from STATIONS.NAME - - - Operation - Integer. 4 [RDCatchEvent::PurgeEventOp] - - - Event ID - - Unsigned Integer, from RECORDINGS.ID. - - - - -
-
diff --git a/lib/rdcatchevent.cpp b/lib/rdcatchevent.cpp index b58aa138..11042783 100644 --- a/lib/rdcatchevent.cpp +++ b/lib/rdcatchevent.cpp @@ -216,19 +216,6 @@ bool RDCatchEvent::read(const QString &str) } } - if(ok&&(op==RDCatchEvent::PurgeEventOp)) { - if(f0.size()!=4) { - return false; - } - unsigned id=f0.at(3).toUInt(&ok); - if(ok) { - d_operation=op; - d_host_name=f0.at(1); - d_event_id=id; - return true; - } - } - return false; } @@ -261,10 +248,6 @@ QString RDCatchEvent::write() const ret+=QString::asprintf(" %d",d_cut_number); break; - case RDCatchEvent::PurgeEventOp: - ret+=QString::asprintf(" %u",d_event_id); - break; - case RDCatchEvent::DeckStatusQueryOp: case RDCatchEvent::NullOp: case RDCatchEvent::LastOp: @@ -307,11 +290,6 @@ QString RDCatchEvent::dump() const ret+=QString::asprintf("cut number: %d\n",d_cut_number); break; - case RDCatchEvent::PurgeEventOp: - ret+="operation: RDCatchEvent::PurgeEventOpOp\n"; - ret+=QString::asprintf("event id: %u\n",d_event_id); - break; - case RDCatchEvent::NullOp: case RDCatchEvent::LastOp: break; diff --git a/lib/rdcatchevent.h b/lib/rdcatchevent.h index 5dd66cde..8147faa2 100644 --- a/lib/rdcatchevent.h +++ b/lib/rdcatchevent.h @@ -31,7 +31,7 @@ class RDCatchEvent public: enum Operation {NullOp=0,DeckEventProcessedOp=1, DeckStatusQueryOp=2,DeckStatusResponseOp=3, - PurgeEventOp=4,LastOp=5}; + LastOp=5}; RDCatchEvent(RDDeck::Status status); RDCatchEvent(); Operation operation() const; diff --git a/rdcatch/rdcatch.cpp b/rdcatch/rdcatch.cpp index 3c36810c..2d9e0ed0 100644 --- a/rdcatch/rdcatch.cpp +++ b/rdcatch/rdcatch.cpp @@ -805,10 +805,6 @@ void MainWidget::catchEventReceivedData(RDCatchEvent *evt) // printf("%s\n",evt->dump().toUtf8().constData()); switch(evt->operation()) { - case RDCatchEvent::PurgeEventOp: - catch_recordings_model->removeRecord(evt->eventId()); - break; - case RDCatchEvent::DeckStatusResponseOp: if(evt->eventId()>0) { if(!catch_recordings_model->refresh(evt->eventId())) { diff --git a/rdcatchd/rdcatchd.cpp b/rdcatchd/rdcatchd.cpp index 939c8d1b..75b6afe8 100644 --- a/rdcatchd/rdcatchd.cpp +++ b/rdcatchd/rdcatchd.cpp @@ -477,7 +477,6 @@ void MainObject::catchEventReceivedData(RDCatchEvent *evt) case RDCatchEvent::DeckEventProcessedOp: case RDCatchEvent::DeckStatusResponseOp: - case RDCatchEvent::PurgeEventOp: case RDCatchEvent::NullOp: case RDCatchEvent::LastOp: break; @@ -2447,11 +2446,11 @@ void MainObject::PurgeEvent(int event) catch_events[event].id()); RDSqlQuery::apply(sql); - RDCatchEvent *evt=new RDCatchEvent(); - evt->setOperation(RDCatchEvent::PurgeEventOp); - evt->setEventId(catch_events[event].id()); - rda->ripc()->sendCatchEvent(evt); - delete evt; + RDNotification *notify=new RDNotification(RDNotification::CatchEventType, + RDNotification::DeleteAction, + catch_events[event].id()); + rda->ripc()->sendNotification(*notify); + delete notify; switch(catch_events[event].type()) { case RDRecording::Recording: