| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef KSNIP_UPLOADRESULT_H |
| 21 |
#define KSNIP_UPLOADRESULT_H |
| 22 |
|
| 23 |
#include <QString> |
| 24 |
|
| 25 |
#include "src/common/enum/UploadStatus.h" |
| 26 |
#include "src/common/enum/UploaderType.h" |
| 27 |
|
| 28 |
struct UploadResult |
| 29 |
{ |
| 30 |
UploadStatus status; |
| 31 |
UploaderType type; |
| 32 |
QString content; |
| 33 |
|
| 34 |
explicit UploadResult(UploadStatus status, UploaderType type) { |
| 35 |
this->status = status; |
| 36 |
this->type = type; |
| 37 |
} |
| 38 |
|
| 39 |
explicit UploadResult(UploadStatus status, UploaderType type, const QString &content) { |
| 40 |
this->status = status; |
| 41 |
this->type = type; |
| 42 |
this->content = content; |
| 43 |
} |
| 44 |
|
| 45 |
bool isError() const { |
| 46 |
return this->status != UploadStatus::NoError; |
| 47 |
} |
| 48 |
|
| 49 |
bool hasContent() const { |
| 50 |
return !this->content.isEmpty() && !this->content.isNull(); |
| 51 |
} |
| 52 |
}; |
| 53 |
|
| 54 |
#endif |