mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-23 04:54:04 +02: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:
parent
6586ea3319
commit
cca367745b
@ -456,7 +456,12 @@ void GMenu2X::initBG() {
|
|||||||
|
|
||||||
Surface *sd = Surface::loadImage("imgs/sd.png", confStr["skin"]);
|
Surface *sd = Surface::loadImage("imgs/sd.png", confStr["skin"]);
|
||||||
if (sd) sd->blit(bgmain, 3, bottomBarIconY);
|
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);
|
bgmain->write(font, df, 22, bottomBarTextY, ASFont::HAlignLeft, ASFont::VAlignMiddle);
|
||||||
delete sd;
|
delete sd;
|
||||||
|
|
||||||
@ -2137,12 +2142,12 @@ const string &GMenu2X::getExePath() {
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
string GMenu2X::getDiskFree() {
|
string GMenu2X::getDiskFree(const char *path) {
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
string df = "";
|
string df = "";
|
||||||
struct statvfs b;
|
struct statvfs b;
|
||||||
|
|
||||||
int ret = statvfs(CARD_ROOT, &b);
|
int ret = statvfs(path, &b);
|
||||||
if (ret==0) {
|
if (ret==0) {
|
||||||
// Make sure that the multiplication happens in 64 bits.
|
// Make sure that the multiplication happens in 64 bits.
|
||||||
unsigned long long free =
|
unsigned long long free =
|
||||||
|
@ -102,7 +102,7 @@ private:
|
|||||||
Retrieves the free disk space on the sd
|
Retrieves the free disk space on the sd
|
||||||
@return String containing a human readable representation of the free disk space
|
@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 cpuX; //!< Offset for displaying cpu clock information
|
||||||
unsigned short volumeX; //!< Offset for displaying volume level
|
unsigned short volumeX; //!< Offset for displaying volume level
|
||||||
unsigned short manualX; //!< Offset for displaying the manual indicator in the taskbar
|
unsigned short manualX; //!< Offset for displaying the manual indicator in the taskbar
|
||||||
|
Loading…
Reference in New Issue
Block a user