From 47bbc349eb897ac20e4043e9acfa738633a43ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 11 Feb 2015 01:17:31 +0100 Subject: SCRATCH remove more obsolete asset logic --- logic/minecraft/AssetsUtils.cpp | 32 -------------------------------- logic/minecraft/AssetsUtils.h | 1 - 2 files changed, 33 deletions(-) (limited to 'logic') diff --git a/logic/minecraft/AssetsUtils.cpp b/logic/minecraft/AssetsUtils.cpp index 9f33b1bd..63179228 100644 --- a/logic/minecraft/AssetsUtils.cpp +++ b/logic/minecraft/AssetsUtils.cpp @@ -27,38 +27,6 @@ namespace AssetsUtils { -int findLegacyAssets() -{ - QDir assets_dir("assets"); - if (!assets_dir.exists()) - return 0; - assets_dir.setFilter(QDir::AllEntries | QDir::NoDotAndDotDot); - int base_length = assets_dir.path().length(); - - QList blacklist = {"indexes", "objects", "virtual"}; - - QDirIterator iterator(assets_dir, QDirIterator::Subdirectories); - int found = 0; - while (iterator.hasNext()) - { - QString currentDir = iterator.next(); - currentDir = currentDir.remove(0, base_length + 1); - - bool ignore = false; - for (QString blacklisted : blacklist) - { - if (currentDir.startsWith(blacklisted)) - ignore = true; - } - - if (!iterator.fileInfo().isDir() && !ignore) - { - found++; - } - } - - return found; -} /* * Returns true on success, with index populated diff --git a/logic/minecraft/AssetsUtils.h b/logic/minecraft/AssetsUtils.h index ea12136d..2aecd4c5 100644 --- a/logic/minecraft/AssetsUtils.h +++ b/logic/minecraft/AssetsUtils.h @@ -33,7 +33,6 @@ struct AssetsIndex namespace AssetsUtils { bool loadAssetsIndexJson(QString file, AssetsIndex* index); -int findLegacyAssets(); /// Reconstruct a virtual assets folder for the given assets ID and return the folder QDir reconstructAssets(QString assetsId); } -- cgit v1.2.3