Changed: Moved qBytesToHumanReadable to utils.h/cpp

--HG--
branch : develop
feature/pipeline-tools
kervala 9 years ago
parent 130b2c3c1a
commit d76058a130

@ -17,6 +17,23 @@
#include "stdpch.h"
#include "utils.h"
QString qBytesToHumanReadable(qint64 bytes)
{
static std::vector<std::string> units;
if (units.empty())
{
units.push_back(QObject::tr("B").toUtf8().constData());
units.push_back(QObject::tr("KiB").toUtf8().constData());
units.push_back(QObject::tr("MiB").toUtf8().constData());
units.push_back(QObject::tr("GiB").toUtf8().constData());
units.push_back(QObject::tr("TiB").toUtf8().constData());
units.push_back(QObject::tr("PiB").toUtf8().constData());
}
return QString::fromUtf8(NLMISC::bytesToHumanReadable(bytes).c_str());
}
QString qFromUtf8(const std::string &str)
{
return QString::fromUtf8(str.c_str());

@ -28,6 +28,8 @@
* \date 2016
*/
QString qBytesToHumanReadable(qint64 bytes);
// Convert a UTF-8 string to QString
QString qFromUtf8(const std::string &str);

Loading…
Cancel
Save