[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kconfig_new
From:       Bernhard Loos <nhuh.put () web ! de>
Date:       2007-08-24 22:23:00
Message-ID: 1187994180.676254.11898.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 704448 by bloos:

use QExplicitlySharedDataPointer for the d pointer of KConfigBase in the kconfig_new branch

 M  +24 -0     kconfigbase.cpp  
 M  +8 -9      kconfigbase.h  


--- branches/work/kconfig_new/kconfigbase.cpp #704447:704448
@@ -20,6 +20,28 @@
 */
 
 #include "kconfigbase.h"
+#include "kconfigbase_p.h"
+
+KConfigBase::KConfigBase()
+{
+}
+
+KConfigBase::KConfigBase(KConfigBasePrivate &d_)
+    : d(&d_)
+{
+}
+
+KConfigBase::~KConfigBase()
+{
+}
+
+bool KConfigBase::isValid() const
+{
+    return d != 0;
+}
+
+#if 0
+
 #include "kconfigbackend.h"
 #include "kconfigdata.h"
 #include "kdebug.h"
@@ -641,3 +663,5 @@
 { return d->group.readEntry( pKey, bDefault ); }
 bool KConfigBase::readBoolEntry( const char *pKey, bool bDefault ) const
 { return d->group.readEntry( pKey, bDefault ); }
+
+#endif
\ No newline at end of file
--- branches/work/kconfig_new/kconfigbase.h #704447:704448
@@ -27,6 +27,7 @@
 
 #include <QtCore/QString>
 #include <QtCore/QMap>
+#include <QtCore/QSharedData>
 
 class KConfigBasePrivate;
 
@@ -60,15 +61,12 @@
     };
     Q_DECLARE_FLAGS(WriteConfigFlags, WriteConfigFlag)
 
-  /**
-   * Construct a KConfigBase object.
-   */
-    KConfigBase() {}
+    KConfigBase();
 
   /**
    * Destructs the KConfigBase object.
    */
-    virtual ~KConfigBase() {}
+    virtual ~KConfigBase();
 
   /**
    * Returns true if the specified group is known about.
@@ -170,11 +168,12 @@
 
     bool isValid() const;
 protected:
-    KConfigBasePrivate d_ptr;
+  /**
+   * Construct a KConfigBase object.
+   */
+    KConfigBase(KConfigBasePrivate &d_);
 
-    KConfigBase(KConfigBasePrivate &d);
-private:
-    Q_DECLARE_PRIVATE(KConfigBase);
+    QExplicitlySharedDataPointer<KConfigBasePrivate> d;
 };
 
 Q_DECLARE_OPERATORS_FOR_FLAGS(KConfigBase::WriteConfigFlags)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic