1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-02 18:47:19 +03:00

If the "sections/" directory is missing, we create it as well as some default sections (settings, applications...).

This commit is contained in:
Ayla 2011-04-03 11:34:40 +02:00
parent d8204706d7
commit 8336c83129

View File

@ -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;