2 * Copyright (C) 2008 David Greaves
4 * This software is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
9 * This software is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this software; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 //#define DEBUG_SHOPPER 1
32 #include "shopperList.h"
38 int Item::id_master
= 0;
40 Item::Item(sparseItem dummy
) : // SPARSE constructor for ListParser
41 id (Item::id_master
++),
47 id (Item::id_master
++),
52 Item::Item(Category
&c
, QString d
, QString n
, bool w
, bool b
) :
53 id (Item::id_master
++),
63 DEBUG("Created an item from parts\n");
73 "\nItem desc : " << desc
<<
75 "\n note : " << note
<<
76 "\n bought : " << (bought
? "true":"false") <<
77 "\n wanted : " << (wanted
? "true":"false") <<
78 "\n category : " << category
->get_name() <<
82 int Item::get_id() const { return id
; }
83 void Item::set_id(int i
){ id
= i
; }
84 void Item::set_desc(QString d
){
90 QString
Item::get_desc() const { return desc
; }
92 void Item::set_note(QString n
) {
98 QString
Item::get_note() const { return note
; }
99 void Item::set_wanted(bool w
) {
103 category
->setWanted(wanted
);
107 bool Item::get_wanted() const { return wanted
; }
108 void Item::set_bought(bool b
)
113 category
->setBought(bought
);
117 bool Item::get_bought() const { return bought
; }
118 void Item::set_category(Category
*c
){
124 Category
* Item::get_category() { return category
; }