From ba9e95e5ae3e1236ddb42d6475afa1c39d7da933 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 11 Oct 2016 17:41:49 +0200 Subject: [PATCH] Changed: Remove nameToId --- .../client/ryzom_installer/src/utils.cpp | 30 ------------------- .../tools/client/ryzom_installer/src/utils.h | 1 - 2 files changed, 31 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp index 40e4695f1..9225285fc 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp @@ -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; diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.h b/code/ryzom/tools/client/ryzom_installer/src/utils.h index 1065a0872..e3de8155b 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.h +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.h @@ -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);