18#include "pencilerror.h"
23DebugDetails::DebugDetails()
29 for (
const QString& s : d.mDetails)
31 mDetails.append(
" " + s);
38 return mDetails.
join(
"\n");
44 return mDetails.
join(
"<br>");
53void DebugDetails::appendSystemInfo()
55 if (mDetails.empty() || mDetails.last() ==
"end")
58 mDetails <<
"\n[System Info]\n";
60 if (version.startsWith(
"99.0.0")) {
61 mDetails <<
" Pencil2D version: " APP_VERSION
" (nightly)";
62 }
else if (version ==
"0.0.0.0") {
63 mDetails <<
" Pencil2D version: " APP_VERSION
" (dev)";
65 mDetails <<
" Pencil2D version: " APP_VERSION
" (stable)";
68#if defined(GIT_EXISTS)
69 mDetails <<
" Commit: " S__GIT_COMMIT_HASH;
77Status::Status(ErrorCode code)
82Status::Status(
const ErrorCode code,
const QString& description)
84 , mDescription(description)
88Status::Status(Status::ErrorCode eCode,
const DebugDetails& detailsList)
90 , mDetails(detailsList)
97 , mDescription(description)
98 , mDetails(detailsList)
105 static std::map<ErrorCode, QString> msgMap =
108 { OK, tr(
"Everything ok.") },
109 { FAIL, tr(
"Ooops, Something went wrong.") },
110 { FILE_NOT_FOUND, tr(
"File doesn't exist.") },
111 { ERROR_FILE_CANNOT_OPEN, tr(
"Cannot open file.") },
112 { ERROR_INVALID_XML_FILE, tr(
"The file is not a valid xml document.") },
113 { ERROR_INVALID_PENCIL_FILE, tr(
"The file is not valid pencil document.") },
116 auto it = msgMap.find(mCode);
117 if (it == msgMap.end())
121 return msgMap[mCode];
124bool Status::operator==(Status::ErrorCode code)
const
126 return (mCode == code);
129bool Status::operator!=(Status::ErrorCode code)
const
131 return (mCode != code);
QString name() const const
QString join(const QString &separator) const const
QString prettyProductName()