mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-25 21:36:15 +02:00
Revert "When started, load all OPKs in a thread to boost startup time"
Loading dynamically at startup is a very bad idea, as it
confuses the "load state before exiting" feature of GMenu2X:
the file selector will pass the file to a different program,
the cursor will move to select a different app, etc.
This reverts commit 5c631d610e
.
This commit is contained in:
parent
5c631d610e
commit
5eb8fb7fd7
42
src/menu.cpp
42
src/menu.cpp
@ -25,7 +25,6 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <thread>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBOPK
|
#ifdef HAVE_LIBOPK
|
||||||
@ -80,8 +79,23 @@ Menu::Menu(GMenu2X *gmenu2x, Touchscreen &ts)
|
|||||||
readLinks();
|
readLinks();
|
||||||
|
|
||||||
#ifdef HAVE_LIBOPK
|
#ifdef HAVE_LIBOPK
|
||||||
std::thread t(&Menu::openAllPackages, this);
|
{
|
||||||
t.detach();
|
struct dirent *dptr;
|
||||||
|
DIR *dirp = opendir(CARD_ROOT);
|
||||||
|
if (dirp) {
|
||||||
|
while ((dptr = readdir(dirp))) {
|
||||||
|
if (dptr->d_type != DT_DIR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!strcmp(dptr->d_name, ".") || !strcmp(dptr->d_name, ".."))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
openPackagesFromDir((string) CARD_ROOT + "/" +
|
||||||
|
dptr->d_name + "/apps");
|
||||||
|
}
|
||||||
|
closedir(dirp);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
orderLinks();
|
orderLinks();
|
||||||
@ -98,27 +112,6 @@ Menu::~Menu() {
|
|||||||
delete *it;
|
delete *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBOPK
|
|
||||||
void Menu::openAllPackages(void)
|
|
||||||
{
|
|
||||||
struct dirent *dptr;
|
|
||||||
DIR *dirp = opendir(CARD_ROOT);
|
|
||||||
if (dirp) {
|
|
||||||
while ((dptr = readdir(dirp))) {
|
|
||||||
if (dptr->d_type != DT_DIR)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!strcmp(dptr->d_name, ".") || !strcmp(dptr->d_name, ".."))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
openPackagesFromDir((string) CARD_ROOT + "/" +
|
|
||||||
dptr->d_name + "/apps");
|
|
||||||
}
|
|
||||||
closedir(dirp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void Menu::readSections(std::string parentDir)
|
void Menu::readSections(std::string parentDir)
|
||||||
{
|
{
|
||||||
DIR *dirp;
|
DIR *dirp;
|
||||||
@ -758,7 +751,6 @@ void Menu::readPackages(std::string parentDir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
openPackage(parentDir + '/' + dptr->d_name, false);
|
openPackage(parentDir + '/' + dptr->d_name, false);
|
||||||
inject_user_event(); // Notify the InputManager for a repaint
|
|
||||||
}
|
}
|
||||||
|
|
||||||
closedir(dirp);
|
closedir(dirp);
|
||||||
|
@ -105,7 +105,6 @@ public:
|
|||||||
#ifdef HAVE_LIBOPK
|
#ifdef HAVE_LIBOPK
|
||||||
void openPackage(std::string path, bool order = true);
|
void openPackage(std::string path, bool order = true);
|
||||||
void openPackagesFromDir(std::string path);
|
void openPackagesFromDir(std::string path);
|
||||||
void openAllPackages(void);
|
|
||||||
#ifdef ENABLE_INOTIFY
|
#ifdef ENABLE_INOTIFY
|
||||||
void removePackageLink(std::string path);
|
void removePackageLink(std::string path);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user