ui: changed the display format of the parse duration to "hh:mm:ss"
This commit is contained in:
@@ -29,7 +29,7 @@ void StatusBarController::handleMessage(MessageFinishedParsing* message)
|
||||
getView()->setErrorCount(errorCount);
|
||||
|
||||
std::string status = message->getStatusStr();
|
||||
status += " " + std::to_string(errorCount.total) + " error" + (errorCount.total > 1 ? "s" : "");
|
||||
status += " " + std::to_string(errorCount.total) + " error" + (errorCount.total != 1 ? "s" : "");
|
||||
if (errorCount.fatal > 0)
|
||||
{
|
||||
status += " (" + std::to_string(errorCount.fatal) + " fatal)";
|
||||
|
||||
@@ -33,8 +33,26 @@ public:
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Finished analysis: ";
|
||||
ss << fileCount << "/" << totalFileCount << " files, ";
|
||||
ss << std::setprecision(2) << std::fixed << parseTime << " seconds.";
|
||||
ss << fileCount << "/" << totalFileCount << " files; ";
|
||||
|
||||
float secondsLeft = parseTime;
|
||||
int hours = int(secondsLeft / 3600);
|
||||
secondsLeft -= hours * 3600;
|
||||
int minutes = int(secondsLeft / 60);
|
||||
secondsLeft -= minutes * 60;
|
||||
int seconds = int(secondsLeft);
|
||||
|
||||
if (hours > 9)
|
||||
{
|
||||
ss << hours;
|
||||
}
|
||||
else
|
||||
{
|
||||
ss << std::setw(2) << std::setfill('0') << hours;
|
||||
}
|
||||
ss << ":" << std::setw(2) << std::setfill('0') << minutes;
|
||||
ss << ":" << std::setw(2) << std::setfill('0') << seconds << ". ";
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user