summaryrefslogtreecommitdiffstats
path: root/tests/auto/printsupport
diff options
context:
space:
mode:
authorJohn Layt <jlayt@kde.org>2012-05-14 21:02:13 +0100
committerQt by Nokia <qt-info@nokia.com>2012-05-29 23:48:15 +0200
commit44f7df439f729aff50f9d1b9dbba06391f151604 (patch)
treefbe08fcf66c619b0677d6be33b8b6fbc10d4002b /tests/auto/printsupport
parentb7104d6645e25892d85e6e0aad6ddebbd2babdc0 (diff)
QtPrintSupport - Add QPrinterInfo api for more printer details
A previous commit changed the Mac behaviour for printerName() from returning the CUPS Description to returning the CUPS Name. In case anyone was relying on this for a human-readable name add new api to return the CUPS Description. Also add the Location and Make and Model which will be used in the Unix print dialog instead of directly calling CUPS. Change-Id: I9901bf8d6368466adf111580f5db5a3f01ca9170 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
Diffstat (limited to 'tests/auto/printsupport')
-rw-r--r--tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
index 826cc73fc3..3427a122ee 100644
--- a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
+++ b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
@@ -296,6 +296,9 @@ void tst_QPrinterInfo::testAssignment()
QCOMPARE(copy.printerName(), printers.at(i).printerName());
QCOMPARE(copy.isNull(), printers.at(i).isNull());
QCOMPARE(copy.isDefault(), printers.at(i).isDefault());
+ QCOMPARE(copy.description(), printers.at(i).description());
+ QCOMPARE(copy.location(), printers.at(i).location());
+ QCOMPARE(copy.makeAndModel(), printers.at(i).makeAndModel());
QCOMPARE(copy.supportedPaperSizes(), printers.at(i).supportedPaperSizes());
}
}
@@ -308,9 +311,13 @@ void tst_QPrinterInfo::namedPrinter()
foreach (const QPrinterInfo &pi, printers) {
QPrinterInfo pi2 = QPrinterInfo::printerInfo(pi.printerName());
- qDebug() << "Printer: " << pi2.printerName() << " : "
+ qDebug() << "Printer: " << pi2.printerName() << " : " << pi2.description() << " : "
+ << pi2.location() << " : " << pi2.makeAndModel() << " : "
<< pi2.isNull() << " : " << pi2.isDefault();
QCOMPARE(pi2.printerName(), pi.printerName());
+ QCOMPARE(pi2.description(), pi.description());
+ QCOMPARE(pi2.location(), pi.location());
+ QCOMPARE(pi2.makeAndModel(), pi.makeAndModel());
QCOMPARE(pi2.supportedPaperSizes(), pi.supportedPaperSizes());
QCOMPARE(pi2.isNull(), pi.isNull());
QCOMPARE(pi2.isDefault(), pi.isDefault());