~abreu-alexandre/oxide/add-ua-to-downloadrequested

« back to all changes in this revision

Viewing changes to qt/core/api/oxideqdownloadrequest.cc

Expose user agent as part of downloadRequest

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    const bool shouldPrompt,
32
32
    const QString& suggestedFilename,
33
33
    const QStringList& cookies,
34
 
    const QString& referrer)
 
34
    const QString& referrer,
 
35
    const QString& userAgent)
35
36
  : url_(url),
36
37
    mime_type_(mimeType),
37
38
    should_prompt_(shouldPrompt),
38
39
    suggested_filename_(suggestedFilename),
39
40
    cookies_(cookies),
40
 
    referrer_(referrer) {}
 
41
    referrer_(referrer),
 
42
    user_agent_(userAgent) {}
41
43
 
42
44
OxideQDownloadRequestPrivate::~OxideQDownloadRequestPrivate() {}
43
45
 
48
50
    const QString& suggestedFilename,
49
51
    const QString& cookies,
50
52
    const QString& referrer,
 
53
    const QString& userAgent,
51
54
    QObject* parent) :
52
55
      QObject(parent),
53
56
      d_ptr(new OxideQDownloadRequestPrivate(url,
54
 
                                             mimeType,
55
 
                                             shouldPrompt,
56
 
                                             suggestedFilename,
57
 
                                             cookies.split(kCookieListDelimiter, QString::SkipEmptyParts),
58
 
                                             referrer)) {
 
57
          mimeType,
 
58
          shouldPrompt,
 
59
          suggestedFilename,
 
60
          cookies.split(kCookieListDelimiter, QString::SkipEmptyParts),
 
61
          referrer,
 
62
          userAgent)) {
59
63
}
60
64
 
61
65
OxideQDownloadRequest::~OxideQDownloadRequest() {}
96
100
  return d->referrer_;
97
101
}
98
102
 
 
103
QString OxideQDownloadRequest::userAgent() const {
 
104
  Q_D(const OxideQDownloadRequest);
 
105
 
 
106
  return d->user_agent_;
 
107
}
 
108