1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-29 15:52:48 +02:00

When loading multiple OPKs, don't order links each time one is added

This commit is contained in:
Paul Cercueil 2013-07-19 12:50:20 -04:00
parent 41e4cff7ac
commit 84a987e9d5
2 changed files with 9 additions and 5 deletions

View File

@ -458,7 +458,7 @@ void Menu::openPackagesFromDir(std::string path)
#endif
}
void Menu::openPackage(std::string path)
void Menu::openPackage(std::string path, bool order)
{
/* First try to remove existing links of the same OPK
* (needed for instance when an OPK is modified) */
@ -516,6 +516,8 @@ void Menu::openPackage(std::string path)
}
opk_close(opk);
if (order)
orderLinks();
}
@ -548,10 +550,11 @@ void Menu::readPackages(std::string parentDir)
continue;
}
openPackage(parentDir + '/' + dptr->d_name);
openPackage(parentDir + '/' + dptr->d_name, false);
}
closedir(dirp);
orderLinks();
}
#ifdef ENABLE_INOTIFY
@ -608,6 +611,7 @@ void Menu::orderLinks()
{
for (std::vector< std::vector<Link *> >::iterator section = links.begin();
section < links.end(); section++)
if (section->size() > 1)
std::sort(section->begin(), section->end(), compare_links);
}

View File

@ -67,7 +67,7 @@ public:
~Menu();
#ifdef HAVE_LIBOPK
void openPackage(std::string path);
void openPackage(std::string path, bool order = true);
void openPackagesFromDir(std::string path);
#ifdef ENABLE_INOTIFY
void removePackageLink(std::string path);