mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-18 02:40:39 +02:00
Change sort order so that OPKs are listed after normal links
This commit is contained in:
parent
8bb58f6270
commit
1792e6329b
@ -812,6 +812,15 @@ void Menu::readLinksOfSection(std::string path, std::vector<std::string> &linkfi
|
|||||||
|
|
||||||
static bool compare_links(Link *a, Link *b)
|
static bool compare_links(Link *a, Link *b)
|
||||||
{
|
{
|
||||||
|
LinkApp *app1 = dynamic_cast<LinkApp *>(a);
|
||||||
|
LinkApp *app2 = dynamic_cast<LinkApp *>(b);
|
||||||
|
bool app1_is_opk = app1 && app1->isOpk(),
|
||||||
|
app2_is_opk = app2 && app2->isOpk();
|
||||||
|
|
||||||
|
if (app1_is_opk && !app2_is_opk)
|
||||||
|
return false;
|
||||||
|
if (app2_is_opk && !app1_is_opk)
|
||||||
|
return true;
|
||||||
return a->getTitle().compare(b->getTitle()) <= 0;
|
return a->getTitle().compare(b->getTitle()) <= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user