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

List:       kde-commits
Subject:    kdenonbeta/krecipes/src
From:       Unai Garro <ugarro () telefonica ! net>
Date:       2004-03-25 23:09:12
Message-ID: 20040325230912.C410399C6 () office ! kde ! org
[Download RAW message or body]

CVS commit by uga: 

Add a couple important methods


  M +23 -1     ingredient.cpp   1.11
  M +3 -1      ingredient.h   1.11


--- kdenonbeta/krecipes/src/ingredient.cpp  #1.10:1.11
@@ -16,4 +16,14 @@ Ingredient::Ingredient()
 {
 }
+Ingredient::Ingredient(const Ingredient &i)
+        {
+        amount=i.amount;
+        ingredientID=i.ingredientID;
+        name=i.name;
+        prepMethodID=i.prepMethodID;
+        prepMethod=i.prepMethod;
+        unitID=i.unitID;
+        units=i.units;
+        }
 
 Ingredient::Ingredient( const QString &_name, double _amount, const QString &_units, \
int _unitID, int _ingredientID, const QString &_prepMethod, int _prepMethodID ) : @@ \
-36,2 +46,14 @@ bool Ingredient::operator==(const Ingred  return (ing.ingredientID == \
this->ingredientID);  }
+
+Ingredient & Ingredient::operator=(const Ingredient &i)
+        {
+        amount=i.amount;
+        ingredientID=i.ingredientID;
+        name=i.name;
+        prepMethodID=i.prepMethodID;
+        prepMethod=i.prepMethod;
+        unitID=i.unitID;
+        units=i.units;
+        return *this;
+        }
\ No newline at end of file

--- kdenonbeta/krecipes/src/ingredient.h  #1.10:1.11
@@ -19,4 +19,5 @@ class Ingredient{
 public:
     Ingredient();
+    Ingredient(const Ingredient& i);
     Ingredient( const QString &name, double amount, const QString &units, int unitID \
= -1, int ingredientID = -1, const QString &prepMethod = QString::null, int \
prepMethodID = -1 );  ~Ingredient();
@@ -28,4 +29,5 @@ public:
     QString prepMethod;
     int prepMethodID;
+    Ingredient & operator=(const Ingredient &i);
 
     /** Compare two elements by their id */


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

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