Diffstat (limited to 'noncore/apps/tableviewer/db/datacache.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/tableviewer/db/datacache.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/noncore/apps/tableviewer/db/datacache.cpp b/noncore/apps/tableviewer/db/datacache.cpp index 7c14eef..6380e1b 100644 --- a/noncore/apps/tableviewer/db/datacache.cpp +++ b/noncore/apps/tableviewer/db/datacache.cpp | |||
@@ -17,27 +17,35 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | /* | 20 | /* |
21 | * This file is used to load the xml files that represent the database. | 21 | * This file is used to load the xml files that represent the database. |
22 | * The main requirment for said file is each data entry must contain a key, | 22 | * The main requirment for said file is each data entry must contain a key, |
23 | * otherwise any other data headings are allowed. | 23 | * otherwise any other data headings are allowed. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "datacache.h" | 26 | #include "datacache.h" |
27 | #include "xmlsource.h" | 27 | #include "xmlsource.h" |
28 | #include "csvsource.h" | 28 | #include "csvsource.h" |
29 | #include <stdlib.h> | 29 | |
30 | /* OPIE */ | ||
31 | #include <opie2/odebug.h> | ||
32 | using namespace Opie::Core; | ||
33 | |||
34 | /* QT */ | ||
30 | #include <qheader.h> | 35 | #include <qheader.h> |
31 | 36 | ||
37 | /* STD */ | ||
38 | #include <stdlib.h> | ||
39 | |||
32 | #define INIT_TABLE_SIZE 128 | 40 | #define INIT_TABLE_SIZE 128 |
33 | 41 | ||
34 | /*! | 42 | /*! |
35 | \class DBStore datastore.h | 43 | \class DBStore datastore.h |
36 | 44 | ||
37 | \brief The DBStore class is the class responsible for storing, sorting and | 45 | \brief The DBStore class is the class responsible for storing, sorting and |
38 | searching the data loaded by the application | 46 | searching the data loaded by the application |
39 | 47 | ||
40 | */ | 48 | */ |
41 | 49 | ||
42 | /*! | 50 | /*! |
43 | Constructs a DBStore item | 51 | Constructs a DBStore item |
@@ -141,25 +149,25 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source) | |||
141 | 149 | ||
142 | \param delm An already allocated and initialized data element to be added | 150 | \param delm An already allocated and initialized data element to be added |
143 | */ | 151 | */ |
144 | void DBStore::addItem(DataElem *delem) | 152 | void DBStore::addItem(DataElem *delem) |
145 | { | 153 | { |
146 | addItemInternal(delem); | 154 | addItemInternal(delem); |
147 | } | 155 | } |
148 | 156 | ||
149 | void DBStore::addItemInternal(DataElem *delem) | 157 | void DBStore::addItemInternal(DataElem *delem) |
150 | { | 158 | { |
151 | /* if already full, don't over fill, do a qWarning though */ | 159 | /* if already full, don't over fill, do a qWarning though */ |
152 | if (full) { | 160 | if (full) { |
153 | qWarning("Attempted to add items to already full table"); | 161 | owarn << "Attempted to add items to already full table" << oendl; |
154 | return; | 162 | return; |
155 | } | 163 | } |
156 | 164 | ||
157 | master_table.insert(number_elems, delem); | 165 | master_table.insert(number_elems, delem); |
158 | 166 | ||
159 | current_elem = number_elems; | 167 | current_elem = number_elems; |
160 | number_elems++; | 168 | number_elems++; |
161 | 169 | ||
162 | if(number_elems >= table_size) { | 170 | if(number_elems >= table_size) { |
163 | /* filled current table, double if we can */ | 171 | /* filled current table, double if we can */ |
164 | table_size = table_size << 1; | 172 | table_size = table_size << 1; |
165 | 173 | ||