1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2025-04-21 12:27:27 +03:00

Dingux port: The SD card root is now hardcoded to /boot for the getDiskFree() function only.

That function was not working as CARD_ROOT does not necessarily point to the mount point of a filesystem.
This commit is contained in:
Ayla
2011-09-18 12:42:08 +02:00
parent 6586ea3319
commit cca367745b
2 changed files with 9 additions and 4 deletions

View File

@@ -456,7 +456,12 @@ void GMenu2X::initBG() {
Surface *sd = Surface::loadImage("imgs/sd.png", confStr["skin"]);
if (sd) sd->blit(bgmain, 3, bottomBarIconY);
string df = getDiskFree();
#ifdef PLATFORM_DINGUX
string df = getDiskFree("/boot");
#else
string df = getDiskFree(CARD_ROOT);
#endif
bgmain->write(font, df, 22, bottomBarTextY, ASFont::HAlignLeft, ASFont::VAlignMiddle);
delete sd;
@@ -2137,12 +2142,12 @@ const string &GMenu2X::getExePath() {
return path;
}
string GMenu2X::getDiskFree() {
string GMenu2X::getDiskFree(const char *path) {
stringstream ss;
string df = "";
struct statvfs b;
int ret = statvfs(CARD_ROOT, &b);
int ret = statvfs(path, &b);
if (ret==0) {
// Make sure that the multiplication happens in 64 bits.
unsigned long long free =