infoviewer_bb: don't start HDD percent thread once per second

Only start the HDD percent determination once per infobar display
This commit is contained in:
Stefan Seyfried
2013-02-17 18:06:29 +01:00
parent 8b6683660a
commit 19c754b5b9

View File

@@ -114,6 +114,13 @@ void CInfoViewerBB::Init()
tmp_bbButtonInfoText[i] = "";
}
// get HDD info in a separate thread
if (g_settings.infobar_show_sysfs_hdd && !hddperTflag) {
hddperTflag=true;
pthread_create(&hddperT, NULL, hddperThread, (void*) this);
pthread_detach(hddperT);
}
InfoHeightY_Info = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 5;
setBBOffset();
@@ -602,13 +609,6 @@ void CInfoViewerBB::showSysfsHdd()
percent = (u * 100ULL) / t;
showBarSys(percent);
//HDD info in a seperate thread
if(!hddperTflag) {
hddperTflag=true;
pthread_create(&hddperT, NULL, hddperThread, (void*) this);
pthread_detach(hddperT);
}
if (check_dir(g_settings.network_nfs_recordingdir) == 0)
showBarHdd(hddpercent);
else