Changed KKJ class to use private member implementation
[ptas] / src / kkj.cpp
index d60da50..2724ce0 100644 (file)
@@ -1,9 +1,31 @@
 #include "kkj.h"
+#include "kkj_p.h"
+
+KKJPrivate::~KKJPrivate()
+{
+}
+
+void KKJPrivate::init(unsigned int northing, unsigned int easting)
+{
+    this->northing = northing;
+    this->easting = easting;
+}
+
 
 KKJ::KKJ(unsigned int northing, unsigned int easting) :
-        mNorthing(northing),
-        mEasting(easting)
+        d_ptr(new KKJPrivate)
+{
+    Q_D(KKJ);
+    d->q_ptr = this;
+    d->init(northing, easting);
+}
+
+KKJ::KKJ(KKJPrivate &dd, unsigned int northing, unsigned int easting) :
+        d_ptr(&dd)
 {
+    Q_D(KKJ);
+    d->q_ptr = this;
+    d->init(northing, easting);
 }
 
 KKJ::~KKJ()
@@ -12,10 +34,12 @@ KKJ::~KKJ()
 
 unsigned int KKJ::northing() const
 {
-    return mNorthing;
+    Q_D(const KKJ);
+    return d->northing;
 }
 
 unsigned int KKJ::easting() const
 {
-    return mEasting;
+    Q_D(const KKJ);
+    return d->easting;
 }