QCupsPrintEnginePrivate: Use "true" for "landscape" option

CUPS treats the "landscape" option as a boolean value
(IPP_TAG_BOOLEAN). In this case, all values ​​other than "true", "on" and
"yes" are considered as false. As a result, using an empty string as the
value for the "landscape" option results in the print area still being
portrait.

Currently, the problem with printing landscape images (png, jpeg, etc.)
in Qt programs (e.g. Okular, Gwenview) occurs on Fedora 41 and other
distributions using cups-filters v2.0+.

The patch adds passing the value "true" instead of an empty string for
the "landscape" option, as CUPS expects for changing the orientation.

Pick-to: 6.8
Change-Id: Ib7ad1e2debcfff10e673757c97ef5614fb59a6ca
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit a77173486aaf9d2e4107f6e1120ac2316ae1c96f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Vladislav Tarakanov 2025-02-17 20:46:11 +04:00 committed by Qt Cherry-pick Bot
parent f5de04d9c4
commit 593f69a861

View File

@ -215,7 +215,7 @@ void QCupsPrintEnginePrivate::closePrintDevice()
}
if (m_pageLayout.orientation() == QPageLayout::Landscape)
options.emplace_back("landscape", "");
options.emplace_back("landscape", "true");
QStringList::const_iterator it = cupsOptions.constBegin();
Q_ASSERT(cupsOptions.size() % 2 == 0);