Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/printsupport/kernel/qcups.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | QStringList QCUPSSupport::cupsOptionsList(QPrinter *printer) | - | ||||||
8 | { | - | ||||||
9 | return never executed: printer->printEngine()->property(QPrintEngine::PrintEnginePropertyKey(0xfe00)).toStringList();return printer->printEngine()->property(QPrintEngine::PrintEnginePropertyKey(0xfe00)).toStringList(); never executed: return printer->printEngine()->property(QPrintEngine::PrintEnginePropertyKey(0xfe00)).toStringList(); | 0 | ||||||
10 | } | - | ||||||
11 | - | |||||||
12 | void QCUPSSupport::setCupsOptions(QPrinter *printer, const QStringList &cupsOptions) | - | ||||||
13 | { | - | ||||||
14 | printer->printEngine()->setProperty(QPrintEngine::PrintEnginePropertyKey(0xfe00), QVariant(cupsOptions)); | - | ||||||
15 | } never executed: end of block | 0 | ||||||
16 | - | |||||||
17 | void QCUPSSupport::setCupsOption(QStringList &cupsOptions, const QString &option, const QString &value) | - | ||||||
18 | { | - | ||||||
19 | if (cupsOptions.contains(option)
| 0 | ||||||
20 | cupsOptions.replace(cupsOptions.indexOf(option) + 1, value); | - | ||||||
21 | } never executed: else {end of block | 0 | ||||||
22 | cupsOptions.append(option); | - | ||||||
23 | cupsOptions.append(value); | - | ||||||
24 | } never executed: end of block | 0 | ||||||
25 | } | - | ||||||
26 | - | |||||||
27 | void QCUPSSupport::clearCupsOption(QStringList &cupsOptions, const QString &option) | - | ||||||
28 | { | - | ||||||
29 | - | |||||||
30 | const QStringList::iterator it = std::find(cupsOptions.begin(), cupsOptions.end(), option); | - | ||||||
31 | if (it != cupsOptions.end()
| 0 | ||||||
32 | ((!(it + 1 < cupsOptions.end())) ? qt_assert("it + 1 < cupsOptions.end()",__FILE__,73) : qt_noop()); | - | ||||||
33 | cupsOptions.erase(it, it+1); | - | ||||||
34 | } never executed: end of block | 0 | ||||||
35 | } never executed: end of block | 0 | ||||||
36 | - | |||||||
37 | static inline QString jobHoldToString(const QCUPSSupport::JobHoldUntil jobHold, const QTime holdUntilTime) | - | ||||||
38 | { | - | ||||||
39 | switch (jobHold) { | - | ||||||
40 | case never executed: QCUPSSupport::Indefinite:case QCUPSSupport::Indefinite: never executed: case QCUPSSupport::Indefinite: | 0 | ||||||
41 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "indefinite")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "indefinite" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "indefinite")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "indefinite" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "indefinite")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "indefinite" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
42 | case never executed: QCUPSSupport::DayTime:case QCUPSSupport::DayTime: never executed: case QCUPSSupport::DayTime: | 0 | ||||||
43 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "day-time")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "day-time" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "day-time")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "day-time" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "day-time")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "day-time" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
44 | case never executed: QCUPSSupport::Night:case QCUPSSupport::Night: never executed: case QCUPSSupport::Night: | 0 | ||||||
45 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "night")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "night" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "night")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "night" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "night")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "night" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
46 | case never executed: QCUPSSupport::SecondShift:case QCUPSSupport::SecondShift: never executed: case QCUPSSupport::SecondShift: | 0 | ||||||
47 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "second-shift")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "second-shift" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "second-shift")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "second-shift" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "second-shift")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "second-shift" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
48 | case never executed: QCUPSSupport::ThirdShift:case QCUPSSupport::ThirdShift: never executed: case QCUPSSupport::ThirdShift: | 0 | ||||||
49 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "third-shift")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "third-shift" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "third-shift")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "third-shift" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "third-shift")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "third-shift" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
50 | case never executed: QCUPSSupport::Weekend:case QCUPSSupport::Weekend: never executed: case QCUPSSupport::Weekend: | 0 | ||||||
51 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "weekend")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "weekend" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "weekend")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "weekend" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "weekend")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "weekend" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
52 | case never executed: QCUPSSupport::SpecificTime:case QCUPSSupport::SpecificTime: never executed: case QCUPSSupport::SpecificTime: | 0 | ||||||
53 | if (!holdUntilTime.isNull()
| 0 | ||||||
54 | - | |||||||
55 | QDateTime localDateTime = QDateTime::currentDateTime(); | - | ||||||
56 | - | |||||||
57 | if (holdUntilTime < localDateTime.time()
| 0 | ||||||
58 | localDateTime = localDateTime.addDays(1); never executed: localDateTime = localDateTime.addDays(1); | 0 | ||||||
59 | localDateTime.setTime(holdUntilTime); | - | ||||||
60 | return never executed: localDateTime.toUTC().time().toString(([]() -> QString { enum { Size = sizeof(u"" "HH:mm")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "HH:mm" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn localDateTime.toUTC().time().toString(([]() -> QString { enum { Size = sizeof(u"" "HH:mm")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "HH:mm" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()));return qstring_literal_temp; never executed: return localDateTime.toUTC().time().toString(([]() -> QString { enum { Size = sizeof(u"" "HH:mm")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "HH:mm" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())); | 0 | ||||||
61 | } | - | ||||||
62 | - | |||||||
63 | case never executed: QCUPSSupport::NoHold:case QCUPSSupport::NoHold: never executed: case QCUPSSupport::NoHold: code before this statement never executed: case QCUPSSupport::NoHold: | 0 | ||||||
64 | return never executed: QString();return QString(); never executed: return QString(); | 0 | ||||||
65 | } | - | ||||||
66 | do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,107) : qt_noop()); __builtin_unreachable(); } while (0); | - | ||||||
67 | return never executed: QString();return QString(); never executed: return QString(); | 0 | ||||||
68 | } | - | ||||||
69 | - | |||||||
70 | void QCUPSSupport::setJobHold(QPrinter *printer, const JobHoldUntil jobHold, const QTime &holdUntilTime) | - | ||||||
71 | { | - | ||||||
72 | QStringList cupsOptions = cupsOptionsList(printer); | - | ||||||
73 | const QString jobHoldUntilArgument = jobHoldToString(jobHold, holdUntilTime); | - | ||||||
74 | if (!jobHoldUntilArgument.isEmpty()
| 0 | ||||||
75 | setCupsOption(cupsOptions, | - | ||||||
76 | ([]() -> QString { enum { Size = sizeof(u"" "job-hold-until")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "job-hold-until" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()),return qstring_literal_temp; | 0 | ||||||
77 | jobHoldUntilArgument); | - | ||||||
78 | } never executed: else {end of block | 0 | ||||||
79 | clearCupsOption(cupsOptions, ([]() -> QString { enum { Size = sizeof(u"" "job-hold-until")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "job-hold-until" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()));return qstring_literal_temp; | 0 | ||||||
80 | } never executed: end of block | 0 | ||||||
81 | setCupsOptions(printer, cupsOptions); | - | ||||||
82 | } never executed: end of block | 0 | ||||||
83 | - | |||||||
84 | void QCUPSSupport::setJobBilling(QPrinter *printer, const QString &jobBilling) | - | ||||||
85 | { | - | ||||||
86 | QStringList cupsOptions = cupsOptionsList(printer); | - | ||||||
87 | setCupsOption(cupsOptions, ([]() -> QString { enum { Size = sizeof(u"" "job-billing")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "job-billing" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()), jobBilling);return qstring_literal_temp; | 0 | ||||||
88 | setCupsOptions(printer, cupsOptions); | - | ||||||
89 | } never executed: end of block | 0 | ||||||
90 | - | |||||||
91 | void QCUPSSupport::setJobPriority(QPrinter *printer, int priority) | - | ||||||
92 | { | - | ||||||
93 | QStringList cupsOptions = cupsOptionsList(printer); | - | ||||||
94 | setCupsOption(cupsOptions, ([]() -> QString { enum { Size = sizeof(u"" "job-priority")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "job-priority" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()), QString::number(priority));return qstring_literal_temp; | 0 | ||||||
95 | setCupsOptions(printer, cupsOptions); | - | ||||||
96 | } never executed: end of block | 0 | ||||||
97 | - | |||||||
98 | static inline QString bannerPageToString(const QCUPSSupport::BannerPage bannerPage) | - | ||||||
99 | { | - | ||||||
100 | switch (bannerPage) { | - | ||||||
101 | case never executed: QCUPSSupport::NoBanner:case QCUPSSupport::NoBanner: never executed: returncase QCUPSSupport::NoBanner: never executed: ([]() -> QString { enum { Size = sizeof(u"" "none")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "none" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "none")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "none" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "none")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "none" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
102 | case never executed: QCUPSSupport::Standard:case QCUPSSupport::Standard: never executed: returncase QCUPSSupport::Standard: never executed: ([]() -> QString { enum { Size = sizeof(u"" "standard")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "standard" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "standard")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "standard" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "standard")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "standard" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
103 | case never executed: QCUPSSupport::Unclassified:case QCUPSSupport::Unclassified: never executed: returncase QCUPSSupport::Unclassified: never executed: ([]() -> QString { enum { Size = sizeof(u"" "unclassified")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "unclassified" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "unclassified")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "unclassified" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "unclassified")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "unclassified" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
104 | case never executed: QCUPSSupport::Confidential:case QCUPSSupport::Confidential: never executed: returncase QCUPSSupport::Confidential: never executed: ([]() -> QString { enum { Size = sizeof(u"" "confidential")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "confidential" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "confidential")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "confidential" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "confidential")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "confidential" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
105 | case never executed: QCUPSSupport::Classified:case QCUPSSupport::Classified: never executed: returncase QCUPSSupport::Classified: never executed: ([]() -> QString { enum { Size = sizeof(u"" "classified")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "classified" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "classified")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "classified" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "classified")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "classified" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
106 | case never executed: QCUPSSupport::Secret:case QCUPSSupport::Secret: never executed: returncase QCUPSSupport::Secret: never executed: ([]() -> QString { enum { Size = sizeof(u"" "secret")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "secret" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "secret")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "secret" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "secret")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "secret" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
107 | case never executed: QCUPSSupport::TopSecret:case QCUPSSupport::TopSecret: never executed: returncase QCUPSSupport::TopSecret: never executed: ([]() -> QString { enum { Size = sizeof(u"" "topsecret")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "topsecret" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "topsecret")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "topsecret" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; never executed: return ([]() -> QString { enum { Size = sizeof(u"" "topsecret")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "topsecret" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||
108 | } | - | ||||||
109 | do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,150) : qt_noop()); __builtin_unreachable(); } while (0); | - | ||||||
110 | return never executed: QString();return QString(); never executed: return QString(); | 0 | ||||||
111 | }; | - | ||||||
112 | - | |||||||
113 | void QCUPSSupport::setBannerPages(QPrinter *printer, const BannerPage startBannerPage, const BannerPage endBannerPage) | - | ||||||
114 | { | - | ||||||
115 | QStringList cupsOptions = cupsOptionsList(printer); | - | ||||||
116 | const QString startBanner = bannerPageToString(startBannerPage); | - | ||||||
117 | const QString endBanner = bannerPageToString(endBannerPage); | - | ||||||
118 | - | |||||||
119 | setCupsOption(cupsOptions, ([]() -> QString { enum { Size = sizeof(u"" "job-sheets")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "job-sheets" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()), startBanner + QLatin1Char(',') + endBanner);return qstring_literal_temp; | 0 | ||||||
120 | setCupsOptions(printer, cupsOptions); | - | ||||||
121 | } never executed: end of block | 0 | ||||||
122 | - | |||||||
123 | void QCUPSSupport::setPageSet(QPrinter *printer, const PageSet pageSet) | - | ||||||
124 | { | - | ||||||
125 | QStringList cupsOptions = cupsOptionsList(printer); | - | ||||||
126 | QString pageSetString; | - | ||||||
127 | - | |||||||
128 | switch (pageSet) { | - | ||||||
129 | case never executed: OddPages:case OddPages: never executed: case OddPages: | 0 | ||||||
130 | pageSetString = ([]() -> QString { enum { Size = sizeof(u"" "odd")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "odd" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; | 0 | ||||||
131 | break; never executed: break; | 0 | ||||||
132 | case never executed: EvenPages:case EvenPages: never executed: case EvenPages: | 0 | ||||||
133 | pageSetString = ([]() -> QString { enum { Size = sizeof(u"" "even")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "even" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; | 0 | ||||||
134 | break; never executed: break; | 0 | ||||||
135 | case never executed: AllPages:case AllPages: never executed: case AllPages: | 0 | ||||||
136 | pageSetString = ([]() -> QString { enum { Size = sizeof(u"" "all")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "all" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }());return qstring_literal_temp; | 0 | ||||||
137 | break; never executed: break; | 0 | ||||||
138 | } | - | ||||||
139 | - | |||||||
140 | setCupsOption(cupsOptions, ([]() -> QString { enum { Size = sizeof(u"" "page-set")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "page-set" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()), pageSetString);return qstring_literal_temp; | 0 | ||||||
141 | setCupsOptions(printer, cupsOptions); | - | ||||||
142 | } never executed: end of block | 0 | ||||||
143 | - | |||||||
144 | void QCUPSSupport::setPagesPerSheetLayout(QPrinter *printer, const PagesPerSheet pagesPerSheet, | - | ||||||
145 | const PagesPerSheetLayout pagesPerSheetLayout) | - | ||||||
146 | { | - | ||||||
147 | QStringList cupsOptions = cupsOptionsList(printer); | - | ||||||
148 | - | |||||||
149 | - | |||||||
150 | - | |||||||
151 | static const char pagesPerSheetData[][2] = { "1", "2", "4", "6", "9", {'1', '6'}, "\0" }; | - | ||||||
152 | static const char pageLayoutData[][5] = {"lrtb", "lrbt", "rlbt", "rltb", "btlr", "btrl", "tblr", "tbrl"}; | - | ||||||
153 | setCupsOption(cupsOptions, ([]() -> QString { enum { Size = sizeof(u"" "number-up")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "number-up" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()), QLatin1String(pagesPerSheetData[pagesPerSheet]));return qstring_literal_temp; | 0 | ||||||
154 | setCupsOption(cupsOptions, ([]() -> QString { enum { Size = sizeof(u"" "number-up-layout")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "number-up-layout" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()), QLatin1String(pageLayoutData[pagesPerSheetLayout]));return qstring_literal_temp; | 0 | ||||||
155 | setCupsOptions(printer, cupsOptions); | - | ||||||
156 | } never executed: end of block | 0 | ||||||
157 | - | |||||||
158 | void QCUPSSupport::setPageRange(QPrinter *printer, int pageFrom, int pageTo) | - | ||||||
159 | { | - | ||||||
160 | QStringList cupsOptions = cupsOptionsList(printer); | - | ||||||
161 | setCupsOption(cupsOptions, ([]() -> QString { enum { Size = sizeof(u"" "page-ranges")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "page-ranges" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()), ([]() -> QString { enum { Size = sizeof(u"" "%1-%2")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "%1-%2" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp; never executed: qstring_literal_temp;return qstring_literal_temp; never executed: }()).arg(pageFrom).arg(pageTo));return qstring_literal_temp; | 0 | ||||||
162 | setCupsOptions(printer, cupsOptions); | - | ||||||
163 | } never executed: end of block | 0 | ||||||
164 | - | |||||||
165 | - | |||||||
Switch to Source code | Preprocessed file |