diff --git a/simgear/package/Delegate.hxx b/simgear/package/Delegate.hxx index df82f58e..1dba811a 100644 --- a/simgear/package/Delegate.hxx +++ b/simgear/package/Delegate.hxx @@ -29,9 +29,11 @@ namespace pkg class Install; class Catalog; +class Package; typedef SGSharedPtr CatalogRef; typedef SGSharedPtr InstallRef; +typedef SGSharedPtr PackageRef; /** * package delegate is the mechanism to discover progress / completion / @@ -68,6 +70,8 @@ public: virtual void installProgress(InstallRef aInstall, unsigned int aBytes, unsigned int aTotal) = 0; virtual void finishInstall(InstallRef aInstall, StatusCode aReason) = 0; + virtual void finishUninstall(PackageRef aPackage) {} + /** * Notification when catalogs/packages are added or removed */ diff --git a/simgear/package/Root.cxx b/simgear/package/Root.cxx index 1aaf773c..5ca36ccd 100644 --- a/simgear/package/Root.cxx +++ b/simgear/package/Root.cxx @@ -153,6 +153,12 @@ public: } } + void fireFinishUninstall(PackageRef pkg) + { + std::for_each(delegates.begin(), delegates.end(), + [pkg](Delegate* d) {d->finishUninstall(pkg);}); + } + DelegateVec delegates; SGPath path; @@ -652,6 +658,7 @@ void Root::unregisterInstall(InstallRef ins) } d->m_installs.erase(ins->package()); + d->fireFinishUninstall(ins->package()); } } // of namespace pkg