Merge lp:~ahayzen/ubuntu-ui-extras/get-job-attributes-needs-printer-uri into lp:~phablet-team/ubuntu-ui-extras/printer-staging

Proposed by Andrew Hayzen
Status: Merged
Approved by: Jonas G. Drange
Approved revision: 142
Merged at revision: 143
Proposed branch: lp:~ahayzen/ubuntu-ui-extras/get-job-attributes-needs-printer-uri
Merge into: lp:~phablet-team/ubuntu-ui-extras/printer-staging
Diff against target: 54 lines (+10/-6)
3 files modified
modules/Ubuntu/Components/Extras/Printers/backend/backend_cups.cpp (+1/-1)
modules/Ubuntu/Components/Extras/Printers/cups/ippclient.cpp (+7/-4)
modules/Ubuntu/Components/Extras/Printers/cups/ippclient.h (+2/-1)
To merge this branch: bzr merge lp:~ahayzen/ubuntu-ui-extras/get-job-attributes-needs-printer-uri
Reviewer Review Type Date Requested Status
Jonas G. Drange (community) Approve
Review via email: mp+318932@code.launchpad.net

Commit message

* Change printerGetJobAttributes to use printer-uri and job-id (the same as holdJob and releaseJob
* Give printerGetJobAttributes printerName so we can ensure we get the correct job

Description of the change

* Change printerGetJobAttributes to use printer-uri and job-id (the same as holdJob and releaseJob
* Give printerGetJobAttributes printerName so we can ensure we get the correct job

To post a comment you must log in.
Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

Neat! :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/Extras/Printers/backend/backend_cups.cpp'
2--- modules/Ubuntu/Components/Extras/Printers/backend/backend_cups.cpp 2017-03-03 13:25:39 +0000
3+++ modules/Ubuntu/Components/Extras/Printers/backend/backend_cups.cpp 2017-03-03 16:18:57 +0000
4@@ -431,7 +431,7 @@
5 const QString &name, const int jobId)
6 {
7 Q_UNUSED(name);
8- QMap<QString, QVariant> rawMap = m_client->printerGetJobAttributes(jobId);
9+ QMap<QString, QVariant> rawMap = m_client->printerGetJobAttributes(name, jobId);
10 QMap<QString, QVariant> map;
11
12 // Filter attributes to know values
13
14=== modified file 'modules/Ubuntu/Components/Extras/Printers/cups/ippclient.cpp'
15--- modules/Ubuntu/Components/Extras/Printers/cups/ippclient.cpp 2017-03-03 13:25:39 +0000
16+++ modules/Ubuntu/Components/Extras/Printers/cups/ippclient.cpp 2017-03-03 16:18:57 +0000
17@@ -452,7 +452,8 @@
18 return result;
19 }
20
21-QMap<QString, QVariant> IppClient::printerGetJobAttributes(const int jobId)
22+QMap<QString, QVariant> IppClient::printerGetJobAttributes(const QString &printerName,
23+ const int jobId)
24 {
25 ipp_t *request;
26 QMap<QString, QVariant> map;
27@@ -460,9 +461,11 @@
28 // Construct request
29 request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES);
30
31- QString uri = QStringLiteral("ipp://localhost/jobs/") + QString::number(jobId);
32- ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
33- "job-uri", NULL, uri.toStdString().data());
34+ addPrinterUri(request, printerName);
35+ addRequestingUsername(request, NULL);
36+
37+ ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER,
38+ "job-id", jobId);
39
40 // Send request and construct reply
41 ipp_t *reply;
42
43=== modified file 'modules/Ubuntu/Components/Extras/Printers/cups/ippclient.h'
44--- modules/Ubuntu/Components/Extras/Printers/cups/ippclient.h 2017-03-03 13:25:39 +0000
45+++ modules/Ubuntu/Components/Extras/Printers/cups/ippclient.h 2017-03-03 16:18:57 +0000
46@@ -67,7 +67,8 @@
47 // Fetch more attributes, as normally just a small subset is fetched.
48 QMap<QString, QVariant> printerGetAttributes(const QString &printerName,
49 const QStringList &attributes);
50- QMap<QString, QVariant> printerGetJobAttributes(const int jobId);
51+ QMap<QString, QVariant> printerGetJobAttributes(const QString &printerName,
52+ const int jobId);
53
54 QString getLastError() const;
55

Subscribers

People subscribed via source and target branches