summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/memory.cpp
Unidiff
Diffstat (limited to 'noncore/apps/qashmoney/memory.cpp') (more/less context) (show whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/memory.cpp62
1 files changed, 0 insertions, 62 deletions
diff --git a/noncore/apps/qashmoney/memory.cpp b/noncore/apps/qashmoney/memory.cpp
deleted file mode 100755
index b5155b3..0000000
--- a/noncore/apps/qashmoney/memory.cpp
+++ b/dev/null
@@ -1,62 +0,0 @@
1#include "memory.h"
2
3#include <stdlib.h>
4
5Memory::Memory ()
6 {
7 db = sqlite_open ( "qmmemory.db", 0, NULL );
8 }
9
10Memory::~Memory ()
11 {
12 sqlite_close ( db );
13 }
14
15void Memory::addMemoryItem ( QString item )
16 {
17 sqlite_exec_printf ( db, "insert into memory values ( '%q', 0, 0 );", 0, 0, 0, ( const char * ) item );
18 }
19
20void Memory::deleteMemoryItem ( QString item )
21 {
22 sqlite_exec_printf ( db, "delete from memory where item = '%q';", 0, 0, 0, ( const char * ) item );
23 }
24
25int Memory::getNumberOfMemoryItems ()
26 {
27 char **results;
28 sqlite_get_table ( db, "select count() from memory;", &results, NULL, NULL, NULL );
29 return atoi ( results [ 1 ] );
30 }
31
32void Memory::changeMemoryName ( QString item )
33 {
34 sqlite_exec_printf ( db, "update memory set item = '%q' where item = '%q';", 0, 0, 0, ( const char * ) item );
35 }
36
37void Memory::displayMemoryItems ( QListBox *listbox )
38 {
39 char **results;
40 int rows;
41 sqlite_get_table ( db, "select item from memory order by item asc;", &results, &rows, NULL, NULL );
42 int counter = 1;
43 while ( counter < ( rows + 1 ) )
44 {
45 listbox->insertItem ( results [ counter ] );
46 counter ++;
47 }
48 }
49
50void Memory::displayMemoryItems ( QComboBox *box )
51 {
52 char **results;
53 int rows;
54 sqlite_get_table ( db, "select item from memory order by item asc;", &results, &rows, NULL, NULL );
55 int counter = 1;
56 while ( counter < ( rows + 1 ) )
57 {
58 box->insertItem ( results [ counter ] );
59 counter ++;
60 }
61 }
62