Managers: cleanup includes and add an assert.

This commit is contained in:
Guillaume Jacquemin 2024-04-08 11:17:48 +02:00
parent fbfcce1d86
commit 661f6acd12
Signed by: williamjcm
SSH Key Fingerprint: SHA256:AYLOg+iTV0ElElnlu4vqM4edFazVdRiuQB0Y5LoKc4A
1 changed files with 2 additions and 5 deletions

View File

@ -14,10 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <cstdio>
#include <algorithm>
#include <chrono>
#include <Corrade/Containers/ScopeGuard.h>
#include <Corrade/Containers/StaticArray.h>
@ -25,8 +22,6 @@
#include <Corrade/Utility/Path.h>
#include <Corrade/Utility/String.h>
#include <zip.h>
#include "../Configuration/Configuration.h"
#include "../Logger/Logger.h"
@ -103,6 +98,8 @@ ProfileManager::getProfile(std::size_t index) {
bool
ProfileManager::deleteProfile(std::size_t index, bool delete_builds) {
CORRADE_INTERNAL_ASSERT(index < _profiles.size());
if(!Utility::Path::remove(Utility::Path::join(conf().directories().gameSaves, _profiles[index].filename()))) {
_lastError = Utility::format("Couldn't delete {} (filename: {}).",
_profiles[index].companyName(),