mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-26 05:12:49 +02:00
If the "sections/" directory is missing, we create it as well as some default sections (settings, applications...).
This commit is contained in:
parent
d8204706d7
commit
8336c83129
11
src/menu.cpp
11
src/menu.cpp
@ -44,7 +44,16 @@ Menu::Menu(GMenu2X *gmenu2x) {
|
||||
struct dirent *dptr;
|
||||
string filepath;
|
||||
|
||||
if ((dirp = opendir("sections")) == NULL) return;
|
||||
dirp = opendir((GMenu2X::getHome()+"/sections").c_str());
|
||||
if (dirp == NULL) {
|
||||
mkdir((GMenu2X::getHome()+"/sections").c_str(), 0770);
|
||||
mkdir((GMenu2X::getHome()+"/sections/settings").c_str(), 0770);
|
||||
mkdir((GMenu2X::getHome()+"/sections/applications").c_str(), 0770);
|
||||
mkdir((GMenu2X::getHome()+"/sections/emulators").c_str(), 0770);
|
||||
mkdir((GMenu2X::getHome()+"/sections/games").c_str(), 0770);
|
||||
|
||||
dirp = opendir((GMenu2X::getHome()+"/sections").c_str());
|
||||
}
|
||||
|
||||
while ((dptr = readdir(dirp))) {
|
||||
if (dptr->d_name[0]=='.') continue;
|
||||
|
Loading…
Reference in New Issue
Block a user