diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-03-02 19:12:04 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-03-02 19:12:04 +0100 |
commit | 28ad9befdcac246eb69a434be970abc29a80bc80 (patch) | |
tree | 330451feee32c4163b02132076491ad4fd311e9b /logic/VersionFile.h | |
parent | 80d146866c8c5f00c6d790b476a774def71010bf (diff) | |
download | PrismLauncher-28ad9befdcac246eb69a434be970abc29a80bc80.tar.gz PrismLauncher-28ad9befdcac246eb69a434be970abc29a80bc80.tar.bz2 PrismLauncher-28ad9befdcac246eb69a434be970abc29a80bc80.zip |
Remove a lot of error code and error handling madness.
Diffstat (limited to 'logic/VersionFile.h')
-rw-r--r-- | logic/VersionFile.h | 28 |
1 files changed, 16 insertions, 12 deletions
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 <memory> #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<Library> overwriteLibs; QList<Library> addLibs; QList<QString> 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<OneSixLibrary> createLibrary(const Library &lib); int findLibrary(QList<std::shared_ptr<OneSixLibrary>> haystack, const QString &needle); - ApplyError applyTo(VersionFinal *version); + void applyTo(VersionFinal *version); };
\ No newline at end of file |