diff options
Diffstat (limited to 'src/printsupport/kernel/qplatformprintdevice.cpp')
-rw-r--r-- | src/printsupport/kernel/qplatformprintdevice.cpp | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/printsupport/kernel/qplatformprintdevice.cpp b/src/printsupport/kernel/qplatformprintdevice.cpp index 69d984cb0c..3d76cad688 100644 --- a/src/printsupport/kernel/qplatformprintdevice.cpp +++ b/src/printsupport/kernel/qplatformprintdevice.cpp @@ -40,10 +40,8 @@ #include "qplatformprintdevice.h" #include "qprintdevice_p.h" -#if QT_CONFIG(printdialog) -#include "qprintdialog.h" -#endif +#include <QtCore/qcoreapplication.h> #include <QtGui/qpagelayout.h> QT_BEGIN_NAMESPACE @@ -165,7 +163,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QPageSize &pageSize) con // e.g. Windows defines DMPAPER_11X17 and DMPAPER_TABLOID with names "11x17" and "Tabloid", but both // map to QPageSize::Tabloid / PPD Key "Tabloid" / ANSI B Tabloid if (pageSize.id() != QPageSize::Custom) { - for (const QPageSize &ps : m_pageSizes) { + for (const QPageSize &ps : qAsConst(m_pageSizes)) { if (ps.id() == pageSize.id() && ps.name() == pageSize.name()) return ps; } @@ -173,7 +171,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QPageSize &pageSize) con // Next try match on id only if not custom if (pageSize.id() != QPageSize::Custom) { - for (const QPageSize &ps : m_pageSizes) { + for (const QPageSize &ps : qAsConst(m_pageSizes)) { if (ps.id() == pageSize.id()) return ps; } @@ -188,7 +186,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(QPageSize::PageSizeId pageSize if (!m_havePageSizes) loadPageSizes(); - for (const QPageSize &ps : m_pageSizes) { + for (const QPageSize &ps : qAsConst(m_pageSizes)) { if (ps.id() == pageSizeId) return ps; } @@ -202,7 +200,7 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QString &pageName) const if (!m_havePageSizes) loadPageSizes(); - for (const QPageSize &ps : m_pageSizes) { + for (const QPageSize &ps : qAsConst(m_pageSizes)) { if (ps.name() == pageName) return ps; } @@ -235,7 +233,7 @@ QPageSize QPlatformPrintDevice::supportedPageSizeMatch(const QPageSize &pageSize return pageSize; // Try to find a supported page size based on point size - for (const QPageSize &ps : m_pageSizes) { + for (const QPageSize &ps : qAsConst(m_pageSizes)) { if (ps.sizePoints() == pageSize.sizePoints()) return ps; } @@ -291,11 +289,7 @@ QPrint::InputSlot QPlatformPrintDevice::defaultInputSlot() const { QPrint::InputSlot input; input.key = QByteArrayLiteral("Auto"); -#if QT_CONFIG(printdialog) - input.name = QPrintDialog::tr("Automatic"); -#else - input.name = QString::fromLatin1("Automatic"); -#endif + input.name = QCoreApplication::translate("Print Device Input Slot", "Automatic"); input.id = QPrint::Auto; return input; } @@ -315,11 +309,7 @@ QPrint::OutputBin QPlatformPrintDevice::defaultOutputBin() const { QPrint::OutputBin output; output.key = QByteArrayLiteral("Auto"); -#if QT_CONFIG(printdialog) - output.name = QPrintDialog::tr("Automatic"); -#else - output.name = QString::fromLatin1("Automatic"); -#endif + output.name = QCoreApplication::translate("Print Device Output Bin", "Automatic"); output.id = QPrint::AutoOutputBin; return output; } |