31 #include "miscellaneous/storefactory.h"
33 #include "definitions/definitions.h"
35 #include <QDomDocument>
36 #include <QDomElement>
39 StoreFactory::StoreFactory(QObject *parent) : QObject(parent) {
42 StoreFactory::~StoreFactory() {
48 return tr(
"Application uploaded successfully.");
51 return tr(
"Network error occurred.");
53 case MissingParameters:
54 return tr(
"Error - some parameters are missing.");
57 return tr(
"Application file is too big.");
60 return tr(
"Unknown status.");
65 const QByteArray &response) {
67 switch (error_status) {
68 case QNetworkReply::NoError: {
69 QDomDocument xml_response;
70 xml_response.setContent(QString(response));
72 QString status = xml_response.documentElement().namedItem(
"status").toElement().text();
74 if (status == STORE_ANSWER_SUCCESS) {
77 else if (status == STORE_ANSWER_INVALID_KEY) {
80 else if (status == STORE_ANSWER_NO_PARAMETERS) {
81 return MissingParameters;
UploadStatus
Possible states of application upload process.
static UploadStatus parseResponseXml(QNetworkReply::NetworkError error_status, const QByteArray &response)
Parses received XML from BuildmLearn Store server.
static QString uploadStatusToString(UploadStatus status)
Converts UploadStatus enumeration to textual representation.