Changed: Remove nameToId
--HG-- branch : develop
This commit is contained in:
parent
a1fab80cad
commit
f0d591bca7
2 changed files with 0 additions and 31 deletions
|
@ -41,36 +41,6 @@ QString qBytesToHumanReadable(qint64 bytes)
|
||||||
return QString::fromUtf8(NLMISC::bytesToHumanReadableUnits(bytes, units).c_str());
|
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 isDirectoryEmpty(const QString &directory, bool recursize)
|
||||||
{
|
{
|
||||||
bool res = true;
|
bool res = true;
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
// convert a size in bytes to a QString with larger unit (KiB, MiB, etc...)
|
// convert a size in bytes to a QString with larger unit (KiB, MiB, etc...)
|
||||||
QString qBytesToHumanReadable(qint64 bytes);
|
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)
|
// 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);
|
bool isDirectoryEmpty(const QString &directory, bool recursize);
|
||||||
|
|
Loading…
Reference in a new issue