diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2010-12-01 07:48:55 +0300 |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-12-20 16:14:09 +0100 |
commit | f725c90032b83df62432018af362830e899e71c1 (patch) | |
tree | 904b26eb40c935bd45a9dc1d876bff895ea62304 /src/gui/painting/qprinterinfo_mac.cpp | |
parent | 6d6c738879bb2ef5b5c1e42908bdd1ed16980f95 (diff) |
minor refactoring of QPrinterInfoPrivate
use member initialization lists;
remove unused Q_DECLARE_PUBLIC stuff and q_ptr member; make members public instead
Merge-request: 2516
Signed-off-by: axis
Diffstat (limited to 'src/gui/painting/qprinterinfo_mac.cpp')
-rw-r--r-- | src/gui/painting/qprinterinfo_mac.cpp | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/src/gui/painting/qprinterinfo_mac.cpp b/src/gui/painting/qprinterinfo_mac.cpp index 9b199f4515..6a48c91d9e 100644 --- a/src/gui/painting/qprinterinfo_mac.cpp +++ b/src/gui/painting/qprinterinfo_mac.cpp @@ -49,18 +49,20 @@ QT_BEGIN_NAMESPACE class QPrinterInfoPrivate { -Q_DECLARE_PUBLIC(QPrinterInfo) public: - ~QPrinterInfoPrivate(); - QPrinterInfoPrivate(); - QPrinterInfoPrivate(const QString& name); - -private: - QPrinterInfo* q_ptr; + QPrinterInfoPrivate() : + m_isNull(true), m_default(false) + {} + QPrinterInfoPrivate(const QString& name) : + m_name(name), + m_isNull(false), m_default(false) + {} + ~QPrinterInfoPrivate() + {} QString m_name; - bool m_default; bool m_isNull; + bool m_default; }; static QPrinterInfoPrivate nullQPrinterInfoPrivate; @@ -139,7 +141,6 @@ QPrinterInfo::QPrinterInfo() QPrinterInfo::QPrinterInfo(const QString& name) : d_ptr(new QPrinterInfoPrivate(name)) { - d_ptr->q_ptr = this; } QPrinterInfo::QPrinterInfo(const QPrinterInfo& src) @@ -152,7 +153,6 @@ QPrinterInfo& QPrinterInfo::operator=(const QPrinterInfo& src) { Q_ASSERT(d_ptr); d_ptr.reset(new QPrinterInfoPrivate(*src.d_ptr)); - d_ptr->q_ptr = this; return *this; } @@ -210,28 +210,6 @@ QList<QPrinter::PaperSize> QPrinterInfo::supportedPaperSizes() const return paperList; } -///////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////// - -QPrinterInfoPrivate::QPrinterInfoPrivate() : - q_ptr(NULL), - m_default(false), - m_isNull(true) -{ -} - -QPrinterInfoPrivate::QPrinterInfoPrivate(const QString& name) : - q_ptr(NULL), - m_name(name), - m_default(false), - m_isNull(false) -{ -} - -QPrinterInfoPrivate::~QPrinterInfoPrivate() -{ -} - #endif // QT_NO_PRINTER QT_END_NAMESPACE |