From 8bb58f627062a93f51341d075d93378933235f1e Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Sun, 19 Jan 2014 23:07:54 +0100 Subject: [PATCH] Sort links once they have all been added to the menu --- src/gmenu2x.cpp | 1 + src/menu.cpp | 2 -- src/menu.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gmenu2x.cpp b/src/gmenu2x.cpp index 4649d65..4b1b964 100644 --- a/src/gmenu2x.cpp +++ b/src/gmenu2x.cpp @@ -394,6 +394,7 @@ void GMenu2X::initMenu() { } menu->skinUpdated(); + menu->orderLinks(); menu->setSectionIndex(confInt["section"]); menu->setLinkIndex(confInt["link"]); diff --git a/src/menu.cpp b/src/menu.cpp index ebeca59..5beec72 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -98,8 +98,6 @@ Menu::Menu(GMenu2X *gmenu2x, Touchscreen &ts) } #endif - orderLinks(); - btnContextMenu->setPosition(gmenu2x->resX - 38, gmenu2x->bottomBarIconY); btnContextMenu->setAction(std::bind(&GMenu2X::showContextMenu, gmenu2x)); } diff --git a/src/menu.h b/src/menu.h index c4e5c09..6fd9516 100644 --- a/src/menu.h +++ b/src/menu.h @@ -75,7 +75,6 @@ private: void readLinks(); void freeLinks(); - void orderLinks(); // Load all the sections of the given "sections" directory. void readSections(std::string parentDir); @@ -123,6 +122,7 @@ public: void deleteSelectedSection(); void skinUpdated(); + void orderLinks(); // Layer implementation: virtual bool runAnimations();