From a6bcdf151647ab7a97c9fe1d2c8c8dd2b718244e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 22 Apr 2015 13:50:21 +0200 Subject: Clean up API of QPlatformPrintDevice (QPA). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The class inherited QSharedData, had a non-virtual clone() function and a non-virtual operator==() which compared QPlatformPrintDevice::id(). Derived classes implemented clone() and operator==() comparing ids to no effect. The class does not have any setters modifying its values, so detaching, copying and assigning does not make sense. Remove the inheritance, clone(), and operator==() and make the class a non-copyable base class. Use a QSharedPointer instead of a QSharedDataPointer to store it in QPrintDevice. Remove copy constructors and clone() reimplementations that were never called in implementations. Found while investigating QTBUG-44991. Task-number: QTBUG-44991 Change-Id: Ib79354b37048d04d50d936f1d0ae06c36efaac00 Reviewed-by: Morten Johan Sørvig Reviewed-by: Paul Olav Tvete --- .../printsupport/windows/qwindowsprintdevice.cpp | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/plugins/printsupport/windows/qwindowsprintdevice.cpp') diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp index af8e07edd2..505f3138ca 100644 --- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp +++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp @@ -113,28 +113,11 @@ QWindowsPrintDevice::QWindowsPrintDevice(const QString &id) } } -QWindowsPrintDevice::QWindowsPrintDevice(const QWindowsPrintDevice &other) - : QPlatformPrintDevice(other) -{ - OpenPrinter((LPWSTR)other.m_id.utf16(), &m_hPrinter, NULL); -} - QWindowsPrintDevice::~QWindowsPrintDevice() { ClosePrinter(m_hPrinter); } -QWindowsPrintDevice &QWindowsPrintDevice::operator=(const QWindowsPrintDevice &other) -{ - OpenPrinter((LPWSTR)other.m_id.utf16(), &m_hPrinter, NULL); - return *this; -} - -bool QWindowsPrintDevice::operator==(const QWindowsPrintDevice &other) const -{ - return (m_id == other.m_id); -} - bool QWindowsPrintDevice::isValid() const { return m_hPrinter; -- cgit v1.2.3