mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-05 10:24:59 +02:00
Remove all links of an "apps" dir when it is removed or renamed
This commit is contained in:
parent
f308ed983b
commit
5e7bcf3a1f
@ -546,6 +546,9 @@ void Menu::readPackages(std::string parentDir)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_INOTIFY
|
||||
/* Remove all links that correspond to the given path.
|
||||
* If "path" is a directory, it will remove all links that
|
||||
* correspond to an OPK present in the directory. */
|
||||
void Menu::removePackageLink(std::string path)
|
||||
{
|
||||
for (vector< vector<Link*> >::iterator section = links.begin();
|
||||
@ -556,7 +559,7 @@ void Menu::removePackageLink(std::string path)
|
||||
if (!app || !app->isOpk() || app->getOpkFile().empty())
|
||||
continue;
|
||||
|
||||
if (app->getOpkFile().compare(path) == 0) {
|
||||
if (app->getOpkFile().compare(0, path.size(), path) == 0) {
|
||||
DEBUG("Removing link corresponding to package %s\n",
|
||||
app->getOpkFile().c_str());
|
||||
section->erase(link);
|
||||
|
@ -58,6 +58,12 @@ int Monitor::run(void)
|
||||
char buf[256];
|
||||
|
||||
read(fd, &event, len);
|
||||
|
||||
if (event.mask & (IN_DELETE_SELF | IN_MOVE_SELF)) {
|
||||
inject_event(false, path.c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
sprintf(buf, "%s/%s", path.c_str(), event.name);
|
||||
|
||||
if (!event_accepted(event))
|
||||
|
Loading…
Reference in New Issue
Block a user