From 28ad9befdcac246eb69a434be970abc29a80bc80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 2 Mar 2014 19:12:04 +0100 Subject: Remove a lot of error code and error handling madness. --- logic/VersionFile.h | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'logic/VersionFile.h') diff --git a/logic/VersionFile.h b/logic/VersionFile.h index 04694999..37c8c415 100644 --- a/logic/VersionFile.h +++ b/logic/VersionFile.h @@ -5,8 +5,21 @@ #include #include "logic/OpSys.h" #include "logic/OneSixRule.h" +#include "MMCError.h" + class VersionFinal; +class VersionBuildError : public MMCError +{ +public: + VersionBuildError(QString cause) : MMCError(cause) {}; + virtual QString errorName() + { + return "VersionBuildError"; + }; + virtual ~VersionBuildError() {}; +}; + struct VersionFile { int order; @@ -65,26 +78,17 @@ struct VersionFile }; DependType dependType = Soft; - static Library fromJson(const QJsonObject &libObj, const QString &filename, - bool &isError); + static Library fromJson(const QJsonObject &libObj, const QString &filename); }; bool shouldOverwriteLibs = false; QList overwriteLibs; QList addLibs; QList removeLibs; - enum ApplyError - { - LauncherVersionError, - OtherError, - NoApplyError - }; - static VersionFile fromJson(const QJsonDocument &doc, const QString &filename, - const bool requireOrder, bool &isError, - const bool isFTB = false); + const bool requireOrder, const bool isFTB = false); static std::shared_ptr createLibrary(const Library &lib); int findLibrary(QList> haystack, const QString &needle); - ApplyError applyTo(VersionFinal *version); + void applyTo(VersionFinal *version); }; \ No newline at end of file -- cgit v1.2.3