Packages: notify delegate of uninstalls.
This commit is contained in:
parent
2dcff4bb8e
commit
5cd250e452
@ -29,9 +29,11 @@ namespace pkg
|
||||
|
||||
class Install;
|
||||
class Catalog;
|
||||
class Package;
|
||||
|
||||
typedef SGSharedPtr<Catalog> CatalogRef;
|
||||
typedef SGSharedPtr<Install> InstallRef;
|
||||
typedef SGSharedPtr<Package> 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
|
||||
*/
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user