From b84ba427f87c5f08f5f01430a032cc657314149d Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 8 Oct 2018 14:39:28 +0200 Subject: [PATCH] UserFileAccessor: Remove unused helper functions Amends b6c9879f41. Change-Id: Iae5034a5afa47c671c5f9de5167b0566784bab37 Reviewed-by: Tobias Hunger --- .../projectexplorer/userfileaccessor.cpp | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index a20000ea792..e47e9a2dc7c 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -152,47 +152,6 @@ Q_DECLARE_TYPEINFO(HandlerNode, Q_MOVABLE_TYPE); QT_END_NAMESPACE -static HandlerNode buildHandlerNodes(const char * const **keys) -{ - HandlerNode ret; - while (const char *rname = *(*keys)++) { - QString name = QLatin1String(rname); - if (name.endsWith('.')) { - HandlerNode sub = buildHandlerNodes(keys); - foreach (const QString &key, name.split('|')) - ret.children.insert(key, sub); - } else { - ret.strings.insert(name); - } - } - return ret; -} - -static QVariantMap processHandlerNodes(const HandlerNode &node, const QVariantMap &map, - QVariant (*handler)(const QVariant &var)) -{ - QVariantMap result; - QMapIterator it(map); - while (it.hasNext()) { - it.next(); - const QString &key = it.key(); - if (node.strings.contains(key)) { - result.insert(key, handler(it.value())); - goto handled; - } - if (it.value().type() == QVariant::Map) - for (QHash::ConstIterator subit = node.children.constBegin(); - subit != node.children.constEnd(); ++subit) - if (key.startsWith(subit.key())) { - result.insert(key, processHandlerNodes(subit.value(), it.value().toMap(), handler)); - goto handled; - } - result.insert(key, it.value()); - handled: ; - } - return result; -} - // -------------------------------------------------------------------- // Helpers: // --------------------------------------------------------------------