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

* Fixed a regression in rdcatch(1) that caused changes in events
	to fail to be propagated to other rdcatch(1) instances.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2022-04-30 15:04:09 -04:00
parent e66cf868e8
commit 7b4c3f1b48
5 changed files with 43 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
//
// Data model for Rivendell RDCatch events.
//
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2021-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
@@ -439,6 +439,8 @@ bool RecordListModel::refresh(unsigned id)
for(int i=0;i<d_texts.size();i++) {
if(d_ids.at(i)==id) {
updateRowLine(i);
emit dataChanged(createIndex(i,0),
createIndex(i,columnCount()));
return true;
}
}
@@ -455,6 +457,30 @@ void RecordListModel::setFilterSql(const QString &sql)
}
void RecordListModel::notificationReceivedData(RDNotification *notify)
{
if(notify->type()==RDNotification::CatchEventType) {
switch(notify->action()) {
case RDNotification::AddAction:
addRecord(notify->id().toUInt());
break;
case RDNotification::ModifyAction:
refresh(notify->id().toUInt());
break;
case RDNotification::DeleteAction:
removeRecord(notify->id().toUInt());
break;
case RDNotification::NoAction:
case RDNotification::LastAction:
break;
}
}
}
void RecordListModel::updateModel()
{
QList<QVariant> texts;