1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-04 21:28:54 +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 =

View File

@ -102,7 +102,7 @@ private:
Retrieves the free disk space on the sd
@return String containing a human readable representation of the free disk space
*/
string getDiskFree();
string getDiskFree(const char *path);
unsigned short cpuX; //!< Offset for displaying cpu clock information
unsigned short volumeX; //!< Offset for displaying volume level
unsigned short manualX; //!< Offset for displaying the manual indicator in the taskbar