From ed9f2ce38e11c907c8b801736bebc6923e9dbb2b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 8 Feb 2016 19:28:53 +0100 Subject: Emit a notification for revision changes. The notification should replace the revision update command completely. --- common/commands/notification.fbs | 2 +- common/resourceaccess.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/commands/notification.fbs b/common/commands/notification.fbs index ff01fc5..8750ff5 100644 --- a/common/commands/notification.fbs +++ b/common/commands/notification.fbs @@ -1,6 +1,6 @@ namespace Sink.Commands; -enum NotificationType : byte { Shutdown = 1, Status, Warning, Progress, Inspection } +enum NotificationType : byte { Shutdown = 1, Status, Warning, Progress, Inspection, RevisionUpdate } enum NotificationCode : byte { Success = 0, Failure = 1, UserCode } table Notification { diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index dd862c8..daa2e82 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp @@ -528,6 +528,9 @@ bool ResourceAccess::processMessageBuffer() case Commands::RevisionUpdateCommand: { auto buffer = Commands::GetRevisionUpdate(d->partialMessageBuffer.constData() + headerSize); Log() << QString("Revision updated to: %1").arg(buffer->revision()); + Notification n; + n.type = Sink::Commands::NotificationType::NotificationType_RevisionUpdate; + emit notification(n); emit revisionChanged(buffer->revision()); break; @@ -572,6 +575,7 @@ bool ResourceAccess::processMessageBuffer() case Sink::Commands::NotificationType::NotificationType_Status: case Sink::Commands::NotificationType::NotificationType_Warning: case Sink::Commands::NotificationType::NotificationType_Progress: + case Sink::Commands::NotificationType::NotificationType_RevisionUpdate: default: Warning() << "Received unknown notification: " << buffer->type(); break; -- cgit v1.2.3