mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 18:01:13 +02:00
gui/dboxinfo: minor clean-up
This commit is contained in:
@@ -490,19 +490,16 @@ void CDBoxInfoWidget::paint()
|
|||||||
int ypos_mnt_head = ypos;
|
int ypos_mnt_head = ypos;
|
||||||
ypos += mheight;
|
ypos += mheight;
|
||||||
|
|
||||||
|
int width_i = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("i", true);
|
||||||
|
|
||||||
for (std::map<std::string, bool>::iterator it = mounts.begin(); it != mounts.end(); ++it) {
|
for (std::map<std::string, bool>::iterator it = mounts.begin(); it != mounts.end(); ++it) {
|
||||||
struct statfs s;
|
struct statfs s;
|
||||||
if (::statfs((*it).first.c_str(), &s) == 0) {
|
if (::statfs((*it).first.c_str(), &s) == 0) {
|
||||||
if (s.f_blocks > 0) {
|
if (s.f_blocks > 0) {
|
||||||
int percent_used;
|
uint64_t bytes_total = s.f_blocks * s.f_bsize;
|
||||||
uint64_t bytes_total;
|
uint64_t bytes_free = s.f_bfree * s.f_bsize;
|
||||||
uint64_t bytes_used;
|
uint64_t bytes_used = bytes_total - bytes_free;
|
||||||
uint64_t bytes_free;
|
int percent_used = (bytes_used * 200 + bytes_total) / 2 / bytes_total;
|
||||||
bytes_total = s.f_blocks * s.f_bsize;
|
|
||||||
bytes_free = s.f_bfree * s.f_bsize;
|
|
||||||
bytes_used = bytes_total - bytes_free;
|
|
||||||
percent_used = (bytes_used * 200 + bytes_total) / 2 / bytes_total;
|
|
||||||
int width_i = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("i", true);
|
|
||||||
//paint mountpoints
|
//paint mountpoints
|
||||||
for (int column = 0; column < headSize; column++) {
|
for (int column = 0; column < headSize; column++) {
|
||||||
std::string tmp;
|
std::string tmp;
|
||||||
|
Reference in New Issue
Block a user