25
24
const QString kCookieListDelimiter = ";";
28
OxideQDownloadRequestPrivate::OxideQDownloadRequestPrivate(
27
class OxideQDownloadRequestData : public QSharedData {
29
OxideQDownloadRequestData(const QUrl& url,
30
const QString& mime_type,
32
const QString& suggested_filename,
33
const QStringList& cookies,
34
const QString& referrer,
35
const QString& user_agent)
38
should_prompt(should_prompt),
39
suggested_filename(suggested_filename),
42
user_agent(user_agent) {}
44
OxideQDownloadRequestData()
45
: should_prompt(false) {}
50
QString suggested_filename;
56
OxideQDownloadRequest::OxideQDownloadRequest(
30
58
const QString& mimeType,
31
59
const bool shouldPrompt,
32
60
const QString& suggestedFilename,
33
const QStringList& cookies,
61
const QString& cookies,
34
62
const QString& referrer,
35
63
const QString& userAgent)
38
should_prompt_(shouldPrompt),
39
suggested_filename_(suggestedFilename),
42
user_agent_(userAgent) {}
44
OxideQDownloadRequestPrivate::~OxideQDownloadRequestPrivate() {}
46
OxideQDownloadRequest::OxideQDownloadRequest(
48
const QString& mimeType,
49
const bool shouldPrompt,
50
const QString& suggestedFilename,
51
const QString& cookies,
52
const QString& referrer,
53
const QString& userAgent,
56
d_ptr(new OxideQDownloadRequestPrivate(url,
64
: d(new OxideQDownloadRequestData(
60
69
cookies.split(kCookieListDelimiter, QString::SkipEmptyParts),
73
OxideQDownloadRequest::OxideQDownloadRequest()
74
: d(new OxideQDownloadRequestData()) {}
65
76
OxideQDownloadRequest::~OxideQDownloadRequest() {}
78
OxideQDownloadRequest::OxideQDownloadRequest(
79
const OxideQDownloadRequest& other)
82
OxideQDownloadRequest OxideQDownloadRequest::operator=(
83
const OxideQDownloadRequest& other) {
88
bool OxideQDownloadRequest::operator==(
89
const OxideQDownloadRequest& other) const {
93
bool OxideQDownloadRequest::operator!=(
94
const OxideQDownloadRequest& other) const {
95
return !(*this == other);
67
98
QUrl OxideQDownloadRequest::url() const {
68
Q_D(const OxideQDownloadRequest);
73
102
QString OxideQDownloadRequest::mimeType() const {
74
Q_D(const OxideQDownloadRequest);
79
106
bool OxideQDownloadRequest::shouldPrompt() const {
80
Q_D(const OxideQDownloadRequest);
82
return d->should_prompt_;
107
return d->should_prompt;
85
110
QString OxideQDownloadRequest::suggestedFilename() const {
86
Q_D(const OxideQDownloadRequest);
88
return d->suggested_filename_;
111
return d->suggested_filename;
91
114
QStringList OxideQDownloadRequest::cookies() const {
92
Q_D(const OxideQDownloadRequest);
97
118
QString OxideQDownloadRequest::referrer() const {
98
Q_D(const OxideQDownloadRequest);
103
122
QString OxideQDownloadRequest::userAgent() const {
104
Q_D(const OxideQDownloadRequest);
106
return d->user_agent_;
123
return d->user_agent;