Changed: Remove nameToId

--HG--
branch : develop
feature/pipeline-tools
kervala 8 years ago
parent a1fab80cad
commit f0d591bca7

@ -41,36 +41,6 @@ QString qBytesToHumanReadable(qint64 bytes)
return QString::fromUtf8(NLMISC::bytesToHumanReadableUnits(bytes, units).c_str());
}
QString nameToId(const QString &name)
{
QString res;
// only allows simple characters
QRegExp allowedCharacters("^[0-9a-zA-Z-]$");
for (int i = 0, len = name.length(); i < len; ++i)
{
if (allowedCharacters.indexIn(name.at(i)) > -1)
{
// allowed character
res += name[i];
}
else
{
// not allowed, replace by a space
res += " ";
}
}
// simplify all spaces
res = res.simplified();
// replace spaces by minus
res.replace(" ", "-");
return res;
}
bool isDirectoryEmpty(const QString &directory, bool recursize)
{
bool res = true;

@ -30,7 +30,6 @@
// convert a size in bytes to a QString with larger unit (KiB, MiB, etc...)
QString qBytesToHumanReadable(qint64 bytes);
QString nameToId(const QString &name);
// return true is the specified directory is empty (has no file inside) (and all its subdirectories if recursize is true)
bool isDirectoryEmpty(const QString &directory, bool recursize);

Loading…
Cancel
Save