diff options
author | abcd <qt-info@nokia.com> | 2011-06-07 18:48:58 +1000 |
---|---|---|
committer | abcd <qt-info@nokia.com> | 2011-06-07 18:48:58 +1000 |
commit | f55b614ed12ddd4ac35b1e45729989f9dcff4aa8 (patch) | |
tree | f0ee115325052979de549bdbfeac4bfc6437f91d /src/location/places/qplacereply.cpp | |
parent | ecd593f856859d750f0a0e4085d48238bad5a6d7 (diff) | |
download | qtlocation-f55b614ed12ddd4ac35b1e45729989f9dcff4aa8.tar.gz |
Refactor private classes to mirror inheritance of public classes
Essentially this is to have something like the bridge design
pattern.
Diffstat (limited to 'src/location/places/qplacereply.cpp')
-rw-r--r-- | src/location/places/qplacereply.cpp | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/src/location/places/qplacereply.cpp b/src/location/places/qplacereply.cpp index b1c4b284..f623bd23 100644 --- a/src/location/places/qplacereply.cpp +++ b/src/location/places/qplacereply.cpp @@ -1,23 +1,11 @@ #include "qplacereply.h" +#include "qplacereply_p.h" #include "qplace.h" #include "qplacesearchresult.h" QTM_USE_NAMESPACE -class QPlaceReplyPrivate -{ -public: - QPlaceReplyPrivate() : isFinished(false) {} - QPlaceReply::Error error; - QString errorString; - bool isFinished; -}; - -QTM_END_NAMESPACE - -QTM_USE_NAMESPACE - /*! \class QPlaceReply @@ -76,8 +64,8 @@ QTM_USE_NAMESPACE /*! Constructs a reply object with a given \a parent. */ -QPlaceReply::QPlaceReply(QObject *parent) - : QObject(parent) +QPlaceReply::QPlaceReply(QPlaceReplyPrivate *dd, QObject *parent) + : QObject(parent),d_ptr(dd) { } @@ -89,6 +77,7 @@ QPlaceReply::~QPlaceReply() if (!isFinished()) { abort(); } + delete d_ptr; } /*! @@ -96,7 +85,7 @@ QPlaceReply::~QPlaceReply() */ bool QPlaceReply::isFinished() const { - return d->isFinished; + return d_ptr->isFinished; } /*! @@ -114,7 +103,7 @@ QPlaceReply::Type QPlaceReply::type() const */ void QPlaceReply::setFinished(bool finished) { - d->isFinished = finished; + d_ptr->isFinished = finished; } /*! @@ -124,8 +113,8 @@ void QPlaceReply::setFinished(bool finished) */ void QPlaceReply::setError(QPlaceReply::Error error, const QString &errorString) { - d->error = error; - d->errorString = errorString; + d_ptr->error = error; + d_ptr->errorString = errorString; } /*! @@ -133,7 +122,7 @@ void QPlaceReply::setError(QPlaceReply::Error error, const QString &errorString) */ QString QPlaceReply::errorString() const { - return d->errorString; + return d_ptr->errorString; } /*! @@ -141,7 +130,7 @@ QString QPlaceReply::errorString() const */ QPlaceReply::Error QPlaceReply::error() const { - return d->error; + return d_ptr->error; } /*! |