File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change 7070// for browsing the filesystem
7171#include < sys/stat.h>
7272#include < sys/types.h>
73+ #include < dirent.h>
7374
7475#define DEFAULT_FONT_PATH " /usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf"
7576#define DEFAULT_FONT_SIZE 12
@@ -656,9 +657,27 @@ void GMenu2X::mainLoop() {
656657 if (button == InputManager::HOME) {
657658 printf (" Launch FunKey menu\n " );
658659 int res = FunkeyMenu::launch ();
659- if (res == MENU_RETURN_EXIT){
660- button = InputManager::QUIT;
661- }
660+ if (res == MENU_RETURN_EXIT) {
661+ button = InputManager::QUIT;
662+ }
663+ #ifdef HAVE_LIBOPK
664+ {
665+ DIR *dirp = opendir (GMENU2X_CARD_ROOT);
666+ if (dirp) {
667+ struct dirent *dptr;
668+ while ((dptr = readdir (dirp))) {
669+ if (dptr->d_type != DT_DIR)
670+ continue ;
671+
672+ if (!strcmp (dptr->d_name , " ." ) || !strcmp (dptr->d_name , " .." ))
673+ continue ;
674+
675+ menu.get ()->openPackagesFromDir ((string) GMENU2X_CARD_ROOT " /" + dptr->d_name );
676+ }
677+ closedir (dirp);
678+ }
679+ }
680+ #endif
662681 }
663682
664683 /* * Global button mapping: QUIT */
You can’t perform that action at this time.
0 commit comments