Mercurial > hg > orthanc
diff Plugins/Engine/OrthancPlugins.cpp @ 1198:1169528a9a5f db-changes
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 23 Oct 2014 13:52:01 +0200 |
parents | 6b9b02a16e99 |
children | a843ee8bb903 |
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPlugins.cpp Thu Oct 23 13:19:18 2014 +0200 +++ b/Plugins/Engine/OrthancPlugins.cpp Thu Oct 23 13:52:01 2014 +0200 @@ -153,30 +153,12 @@ { switch (type) { - case ChangeType_AnonymizedPatient: - return OrthancPluginChangeType_AnonymizedPatient; - - case ChangeType_AnonymizedSeries: - return OrthancPluginChangeType_AnonymizedSeries; - - case ChangeType_AnonymizedStudy: - return OrthancPluginChangeType_AnonymizedStudy; - case ChangeType_CompletedSeries: return OrthancPluginChangeType_CompletedSeries; case ChangeType_Deleted: return OrthancPluginChangeType_Deleted; - case ChangeType_ModifiedPatient: - return OrthancPluginChangeType_ModifiedPatient; - - case ChangeType_ModifiedSeries: - return OrthancPluginChangeType_ModifiedSeries; - - case ChangeType_ModifiedStudy: - return OrthancPluginChangeType_ModifiedStudy; - case ChangeType_NewChildInstance: return OrthancPluginChangeType_NewChildInstance; @@ -383,17 +365,15 @@ - void OrthancPlugins::SignalChange(ChangeType changeType, - ResourceType resourceType, - const std::string& publicId) + void OrthancPlugins::SignalChange(const ServerIndexChange& change) { OrthancPluginChangeType c; OrthancPluginResourceType r; try { - c = Convert(changeType); - r = Convert(resourceType); + c = Convert(change.GetChangeType()); + r = Convert(change.GetResourceType()); } catch (OrthancException&) { @@ -407,7 +387,7 @@ callback = pimpl_->onChangeCallbacks_.begin(); callback != pimpl_->onChangeCallbacks_.end(); ++callback) { - (*callback) (c, r, publicId.c_str()); + (*callback) (c, r, change.GetPublicId().c_str()); } }