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

List:       kde-commits
Subject:    kdenonbeta/klink/lib
From:       Scott Wheeler <wheeler () kde ! org>
Date:       2004-11-06 23:38:07
Message-ID: 20041106233807.6738E16DEC () office ! kde ! org
[Download RAW message or body]

CVS commit by wheeler: 

Fill in the gaps for the various constructors and assignment operators.


  M +48 -5     klinktarget.cpp   1.2
  M +12 -0     klinktarget.h   1.6


--- kdenonbeta/klink/lib/klinktarget.cpp  #1.1:1.2
@@ -43,4 +43,9 @@ Node::Node()
 }
 
+Node::Node(const Node &node)
+{
+    d = Shared::ref(node.d);
+}
+
 Node::Node(const KURL &location)
 {
@@ -70,4 +75,10 @@ bool Node::isNull() const
 }
 
+Node &Node::operator=(const Node &node)
+{
+    Shared::copy(node.d, d);
+    return *this;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // KLink::Keyword
@@ -80,4 +91,14 @@ public:
 };
 
+Keyword::Keyword() : Node()
+{
+    d = new Private;
+}
+
+Keyword::Keyword(const Keyword &keyword) : Node(keyword)
+{
+    d = Shared::ref(keyword.d);
+}
+
 Keyword::Keyword(const QString &phrase) : Node()
 {
@@ -96,7 +117,8 @@ QString Keyword::phrase() const
 }
 
-Keyword::Keyword()
+Keyword &Keyword::operator=(const Keyword &keyword)
 {
-    d = new Private;
+    Shared::copy(keyword.d, d);
+    return *this;
 }
 
@@ -112,9 +133,14 @@ public:
 };
 
-Target::Target()
+Target::Target() : Node()
 {
     d = new Private;
 }
 
+Target::Target(const Target &target) : Node(target)
+{
+    d = Shared::ref(target.d);
+}
+
 Target::Target(const KURL &location) : Node()
 {
@@ -133,4 +159,10 @@ KURL Target::location() const
 }
 
+Target &Target::operator=(const Target &target)
+{
+    Shared::copy(target.d, d);
+    return *this;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // KLink::FileTarget
@@ -148,9 +180,14 @@ public:
 };
 
-FileTarget::FileTarget()
+FileTarget::FileTarget() : Target()
 {
     d = new Private;
 }
 
+FileTarget::FileTarget(const FileTarget &target) : Target(target)
+{
+    d = Shared::ref(target.d);
+}
+
 FileTarget::FileTarget(const QString &file) : Target()
 {
@@ -178,2 +215,8 @@ long long FileTarget::size() const
     return d->size;
 }
+
+FileTarget &FileTarget::operator=(const FileTarget &target)
+{
+    Shared::copy(target.d, d);
+    return *this;
+}

--- kdenonbeta/klink/lib/klinktarget.h  #1.5:1.6
@@ -31,4 +31,5 @@ class Node
 public:
     Node();
+    Node(const Node &node);
     Node(const KURL &location);
     virtual ~Node();
@@ -39,4 +40,6 @@ public:
     bool isNull() const;
 
+    Node &operator=(const Node &node);
+
 private:
     class Private;
@@ -48,4 +51,5 @@ class Keyword : Node
 public:
     Keyword();
+    Keyword(const Keyword &keyword);
     Keyword(const QString &phrase);
     virtual ~Keyword();
@@ -53,4 +57,6 @@ public:
     QString phrase() const;
 
+    Keyword &operator=(const Keyword &keyword);
+
 private:
     class Private;
@@ -62,4 +68,5 @@ class Target : Node
 public:
     Target();
+    Target(const Target &target);
     Target(const KURL &location);
     virtual ~Target();
@@ -67,4 +74,6 @@ public:
     KURL location() const;
 
+    Target &operator=(const Target &target);
+
 private:
     class Private;
@@ -76,4 +85,5 @@ class FileTarget : public Target
 public:
     FileTarget();
+    FileTarget(const FileTarget &target);
     FileTarget(const QString &file);
     virtual ~FileTarget();
@@ -83,4 +93,6 @@ public:
     long long size() const;
 
+    FileTarget &operator=(const FileTarget &target);
+
 private:
     class Private;


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

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