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

List:       kde-commits
Subject:    kdenonbeta/krecipes/src
From:       Jason Kivlighn <confederacy2 () excite ! com>
Date:       2004-02-01 7:55:03
Message-ID: 20040201075503.4A3309911 () office ! kde ! org
[Download RAW message or body]

CVS commit by jkivlighn: 

Added a findByName function which is needed for the USDA data import


  M +12 -0     ingredientpropertylist.cpp   1.12
  M +1 -0      ingredientpropertylist.h   1.12


--- kdenonbeta/krecipes/src/ingredientpropertylist.cpp  #1.11:1.12
@@ -57,4 +57,16 @@ return(list.find(&ip));
 }
 
+int IngredientPropertyList::findByName(const QString &name)
+{
+IngredientProperty *prop;
+for ( prop = list.first(); prop; prop = list.next() )
+{
+        if ( prop->name == name )
+                return prop->id;
+}
+
+return -1;
+}
+
 IngredientProperty* IngredientPropertyList::at(int pos)
 {

--- kdenonbeta/krecipes/src/ingredientpropertylist.h  #1.11:1.12
@@ -43,4 +43,5 @@ public:
     int find(IngredientProperty* it);
     int find(int id);
+    int findByName(const QString &);
     void filter(int ingredientID,IngredientPropertyList *filteredList);
     IngredientProperty* getFirst(void);


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

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