author | chicken <chicken> | 2004-11-02 18:23:35 (UTC) |
---|---|---|
committer | chicken <chicken> | 2004-11-02 18:23:35 (UTC) |
commit | 029fc220470de74b7c1a148c9ea934c17686149f (patch) (unidiff) | |
tree | 115de8edc9142615b31d906770cb7978190e7af8 | |
parent | ebdc2d346272bae27c867b855207993985df4450 (diff) | |
download | opie-029fc220470de74b7c1a148c9ea934c17686149f.zip opie-029fc220470de74b7c1a148c9ea934c17686149f.tar.gz opie-029fc220470de74b7c1a148c9ea934c17686149f.tar.bz2 |
switching to sqlite3
-rwxr-xr-x | noncore/apps/qashmoney/account.h | 4 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/budget.h | 4 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/memory.h | 4 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/preferences.h | 4 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/qashmoney.pro | 2 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/transaction.h | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/noncore/apps/qashmoney/account.h b/noncore/apps/qashmoney/account.h index f77f400..5bad4a1 100755 --- a/noncore/apps/qashmoney/account.h +++ b/noncore/apps/qashmoney/account.h | |||
@@ -1,23 +1,23 @@ | |||
1 | #ifndef ACCOUNT_H | 1 | #ifndef ACCOUNT_H |
2 | #define ACCOUNT_H | 2 | #define ACCOUNT_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | #include <qcombobox.h> | 6 | #include <qcombobox.h> |
7 | #include <sqlite.h> | 7 | #include <sqlite3.h> |
8 | 8 | ||
9 | class Account | 9 | class Account |
10 | { | 10 | { |
11 | public: | 11 | public: |
12 | 12 | ||
13 | Account (); | 13 | Account (); |
14 | ~Account (); | 14 | ~Account (); |
15 | 15 | ||
16 | // This function adds a new account to the database. It takes the account name, parent, | 16 | // This function adds a new account to the database. It takes the account name, parent, |
17 | // initial balance and the account type, description, credit limit, statementbalancedate | 17 | // initial balance and the account type, description, credit limit, statementbalancedate |
18 | // as three integers, and the statementbalance amount | 18 | // as three integers, and the statementbalance amount |
19 | // The parent is an integer account id. Its -1 if there is no parent | 19 | // The parent is an integer account id. Its -1 if there is no parent |
20 | // The account types (so far) are 0=not defined 1=parent checking 2=child checking | 20 | // The account types (so far) are 0=not defined 1=parent checking 2=child checking |
21 | void addAccount ( QString, int, float, int, QString, float, int, int, int, float, const char * ); | 21 | void addAccount ( QString, int, float, int, QString, float, int, int, int, float, const char * ); |
22 | 22 | ||
23 | // updates certain parts of an account | 23 | // updates certain parts of an account |
@@ -67,33 +67,33 @@ class Account | |||
67 | int getStatementMonth ( int ); | 67 | int getStatementMonth ( int ); |
68 | int getStatementYear ( int ); | 68 | int getStatementYear ( int ); |
69 | float getStatementBalance ( int ); | 69 | float getStatementBalance ( int ); |
70 | 70 | ||
71 | // Returns account description and name | 71 | // Returns account description and name |
72 | QString getAccountDescription ( int accountid ); | 72 | QString getAccountDescription ( int accountid ); |
73 | QString getCurrencyCode ( int accountid ); | 73 | QString getCurrencyCode ( int accountid ); |
74 | QString getAccountName ( int accountid ); | 74 | QString getAccountName ( int accountid ); |
75 | QStringList getAccountNames (); | 75 | QStringList getAccountNames (); |
76 | QStringList getAccountIDs (); | 76 | QStringList getAccountIDs (); |
77 | QString getAccountBalance ( int accountid ); | 77 | QString getAccountBalance ( int accountid ); |
78 | 78 | ||
79 | // returns account credit limit | 79 | // returns account credit limit |
80 | float getAccountCreditLimit ( int ); | 80 | float getAccountCreditLimit ( int ); |
81 | 81 | ||
82 | // The primary database that stores all our data | 82 | // The primary database that stores all our data |
83 | sqlite *adb; | 83 | sqlite3 *adb; |
84 | }; | 84 | }; |
85 | 85 | ||
86 | class GreyBackgroundItem : public QListViewItem | 86 | class GreyBackgroundItem : public QListViewItem |
87 | { | 87 | { |
88 | public: | 88 | public: |
89 | 89 | ||
90 | GreyBackgroundItem ( QListView *parent ); | 90 | GreyBackgroundItem ( QListView *parent ); |
91 | GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3 ); | 91 | GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3 ); |
92 | GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3, QString label4 ); | 92 | GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3, QString label4 ); |
93 | GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3, QString label4, QString label5 ); | 93 | GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3, QString label4, QString label5 ); |
94 | 94 | ||
95 | virtual void paintCell ( QPainter *p, const QColorGroup &cg, int column, int width, int alignment ); | 95 | virtual void paintCell ( QPainter *p, const QColorGroup &cg, int column, int width, int alignment ); |
96 | 96 | ||
97 | }; | 97 | }; |
98 | 98 | ||
99 | #endif | 99 | #endif |
diff --git a/noncore/apps/qashmoney/budget.h b/noncore/apps/qashmoney/budget.h index 16af26a..f82e048 100755 --- a/noncore/apps/qashmoney/budget.h +++ b/noncore/apps/qashmoney/budget.h | |||
@@ -1,23 +1,23 @@ | |||
1 | #ifndef BUDGET_H | 1 | #ifndef BUDGET_H |
2 | #define BUDGET_H | 2 | #define BUDGET_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qstringlist.h> | 5 | #include <qstringlist.h> |
6 | #include <qlistview.h> | 6 | #include <qlistview.h> |
7 | #include <sqlite.h> | 7 | #include <sqlite3.h> |
8 | 8 | ||
9 | class Budget | 9 | class Budget |
10 | { | 10 | { |
11 | public: | 11 | public: |
12 | 12 | ||
13 | Budget (); | 13 | Budget (); |
14 | ~Budget (); | 14 | ~Budget (); |
15 | 15 | ||
16 | int addBudget ( QString name, int type, QString description, QString currency, int startday, int startmonth, int startyear, int endday, int endmonth, int endyear, int defaultview ); | 16 | int addBudget ( QString name, int type, QString description, QString currency, int startday, int startmonth, int startyear, int endday, int endmonth, int endyear, int defaultview ); |
17 | void updateBudget ( QString name, QString description, QString currency, int budgetid ); | 17 | void updateBudget ( QString name, QString description, QString currency, int budgetid ); |
18 | void deleteBudget ( int budgetid ); | 18 | void deleteBudget ( int budgetid ); |
19 | int getNumberOfBudgets (); | 19 | int getNumberOfBudgets (); |
20 | int getNumberOfLineItems ( int budgetid ); | 20 | int getNumberOfLineItems ( int budgetid ); |
21 | 21 | ||
22 | QStringList* getBudgetNames (); | 22 | QStringList* getBudgetNames (); |
23 | QStringList* getBudgetIDs (); | 23 | QStringList* getBudgetIDs (); |
@@ -25,21 +25,21 @@ class Budget | |||
25 | QStringList getLineItemIDs ( int budgetid ); | 25 | QStringList getLineItemIDs ( int budgetid ); |
26 | QString getBudgetName ( int budgetid ); | 26 | QString getBudgetName ( int budgetid ); |
27 | QString getBudgetDescription ( int budgetid ); | 27 | QString getBudgetDescription ( int budgetid ); |
28 | QString getCurrency ( int budgetid ); | 28 | QString getCurrency ( int budgetid ); |
29 | QString getBudgetTotal ( int budgetid, int viewtype ); | 29 | QString getBudgetTotal ( int budgetid, int viewtype ); |
30 | 30 | ||
31 | int getLastAdded (); | 31 | int getLastAdded (); |
32 | 32 | ||
33 | int addLineItem ( int budgetid, QString lineitemname, float lineitemamount, int lineitemtype ); | 33 | int addLineItem ( int budgetid, QString lineitemname, float lineitemamount, int lineitemtype ); |
34 | void updateLineItem ( QString lineitemname, float lineitemamount, int lineitemtype, int budgetid, int lineitemid ); | 34 | void updateLineItem ( QString lineitemname, float lineitemamount, int lineitemtype, int budgetid, int lineitemid ); |
35 | void displayLineItems ( int budgetid, QListView *listview, int month, int year, int viewtype ); | 35 | void displayLineItems ( int budgetid, QListView *listview, int month, int year, int viewtype ); |
36 | void deleteLineItem ( int budgetid, int lineitemid ); | 36 | void deleteLineItem ( int budgetid, int lineitemid ); |
37 | int getLineItemTime ( int budgetid, int lineitemid ); | 37 | int getLineItemTime ( int budgetid, int lineitemid ); |
38 | float getLineItemAmount ( int budgetid, int lineitemid ); | 38 | float getLineItemAmount ( int budgetid, int lineitemid ); |
39 | 39 | ||
40 | private: | 40 | private: |
41 | sqlite *bdb; | 41 | sqlite3 *bdb; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | #endif | 44 | #endif |
45 | 45 | ||
diff --git a/noncore/apps/qashmoney/memory.h b/noncore/apps/qashmoney/memory.h index 6f3f100..6e8ae46 100755 --- a/noncore/apps/qashmoney/memory.h +++ b/noncore/apps/qashmoney/memory.h | |||
@@ -1,45 +1,45 @@ | |||
1 | #ifndef MEMORY_H | 1 | #ifndef MEMORY_H |
2 | #define MEMORY_H | 2 | #define MEMORY_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qlistbox.h> | 5 | #include <qlistbox.h> |
6 | #include <qcombobox.h> | 6 | #include <qcombobox.h> |
7 | #include <sqlite.h> | 7 | #include <sqlite3.h> |
8 | 8 | ||
9 | class Memory : public QObject | 9 | class Memory : public QObject |
10 | { | 10 | { |
11 | 11 | ||
12 | Q_OBJECT | 12 | Q_OBJECT |
13 | 13 | ||
14 | public: | 14 | public: |
15 | 15 | ||
16 | Memory (); | 16 | Memory (); |
17 | ~Memory (); | 17 | ~Memory (); |
18 | 18 | ||
19 | // This function adds a new memory to the database. It takes the memory name, parent, | 19 | // This function adds a new memory to the database. It takes the memory name, parent, |
20 | // initial balance, a displayed variable, and the memory type | 20 | // initial balance, a displayed variable, and the memory type |
21 | // The parent is an integer memory id. Its -1 if there is not parent | 21 | // The parent is an integer memory id. Its -1 if there is not parent |
22 | // The memory types are 0=not defined 1=parent 2=child | 22 | // The memory types are 0=not defined 1=parent 2=child |
23 | void addMemoryItem ( QString ); | 23 | void addMemoryItem ( QString ); |
24 | 24 | ||
25 | // Returns the number of checking memorys | 25 | // Returns the number of checking memorys |
26 | int getNumberOfMemoryItems (); | 26 | int getNumberOfMemoryItems (); |
27 | 27 | ||
28 | void changeMemoryName ( QString ); | 28 | void changeMemoryName ( QString ); |
29 | 29 | ||
30 | // This takes a QListView and puts parents and children memorys | 30 | // This takes a QListView and puts parents and children memorys |
31 | // into the list view | 31 | // into the list view |
32 | void displayMemoryItems ( QListBox * ); | 32 | void displayMemoryItems ( QListBox * ); |
33 | void displayMemoryItems ( QComboBox * ); | 33 | void displayMemoryItems ( QComboBox * ); |
34 | 34 | ||
35 | // The primary database that stores all our data | 35 | // The primary database that stores all our data |
36 | sqlite *db; | 36 | sqlite3 *db; |
37 | 37 | ||
38 | public slots: | 38 | public slots: |
39 | 39 | ||
40 | // Deletes a memory item. Takes the memoryid as its parameter | 40 | // Deletes a memory item. Takes the memoryid as its parameter |
41 | void deleteMemoryItem ( QString ); | 41 | void deleteMemoryItem ( QString ); |
42 | }; | 42 | }; |
43 | 43 | ||
44 | #endif | 44 | #endif |
45 | 45 | ||
diff --git a/noncore/apps/qashmoney/preferences.h b/noncore/apps/qashmoney/preferences.h index 10ec6e9..38579ad 100755 --- a/noncore/apps/qashmoney/preferences.h +++ b/noncore/apps/qashmoney/preferences.h | |||
@@ -1,48 +1,48 @@ | |||
1 | #include <sqlite.h> | 1 | #include <sqlite3.h> |
2 | #include <qstring.h> | 2 | #include <qstring.h> |
3 | 3 | ||
4 | #ifndef PREFERENCES_H | 4 | #ifndef PREFERENCES_H |
5 | #define PREFERENCES_H | 5 | #define PREFERENCES_H |
6 | 6 | ||
7 | class Preferences | 7 | class Preferences |
8 | { | 8 | { |
9 | public: | 9 | public: |
10 | Preferences (); | 10 | Preferences (); |
11 | ~Preferences (); | 11 | ~Preferences (); |
12 | 12 | ||
13 | void addPreferences (); | 13 | void addPreferences (); |
14 | void initializeColumnPreferences (); | 14 | void initializeColumnPreferences (); |
15 | void initializeSortingPreferences (); | 15 | void initializeSortingPreferences (); |
16 | 16 | ||
17 | // Returns a preference value for the given preferences ID | 17 | // Returns a preference value for the given preferences ID |
18 | int getPreference ( int ); | 18 | int getPreference ( int ); |
19 | int getColumnPreference ( int id ); | 19 | int getColumnPreference ( int id ); |
20 | void getSortingPreference ( int id, int *column, int *direction ); | 20 | void getSortingPreference ( int id, int *column, int *direction ); |
21 | 21 | ||
22 | // Convenience for getting date separator with one function | 22 | // Convenience for getting date separator with one function |
23 | // call. Takes the preference id as its argument | 23 | // call. Takes the preference id as its argument |
24 | QString getSeparator ( ); | 24 | QString getSeparator ( ); |
25 | 25 | ||
26 | // Changes a preference for the given ID | 26 | // Changes a preference for the given ID |
27 | void changePreference ( int , int ); | 27 | void changePreference ( int , int ); |
28 | void changeColumnPreference ( int id, int width ); | 28 | void changeColumnPreference ( int id, int width ); |
29 | void changeSortingPreference ( int id, int column ); | 29 | void changeSortingPreference ( int id, int column ); |
30 | 30 | ||
31 | // The primary database that stores all our data | 31 | // The primary database that stores all our data |
32 | sqlite *db; | 32 | sqlite3 *db; |
33 | 33 | ||
34 | // This function returns a Qstring for the year first date formats | 34 | // This function returns a Qstring for the year first date formats |
35 | // for displaying. It takes the date numbers | 35 | // for displaying. It takes the date numbers |
36 | QString getDate ( int, int, int ); | 36 | QString getDate ( int, int, int ); |
37 | QString getDate ( int y, int m ); | 37 | QString getDate ( int y, int m ); |
38 | 38 | ||
39 | void setDefaultDatePreferences (); | 39 | void setDefaultDatePreferences (); |
40 | }; | 40 | }; |
41 | 41 | ||
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | 47 | ||
48 | 48 | ||
diff --git a/noncore/apps/qashmoney/qashmoney.pro b/noncore/apps/qashmoney/qashmoney.pro index 4222a25..faa898b 100755 --- a/noncore/apps/qashmoney/qashmoney.pro +++ b/noncore/apps/qashmoney/qashmoney.pro | |||
@@ -30,26 +30,26 @@ SOURCES = qashmoney.cpp \ | |||
30 | preferencedialogs.cpp \ | 30 | preferencedialogs.cpp \ |
31 | memory.cpp \ | 31 | memory.cpp \ |
32 | memorydialog.cpp \ | 32 | memorydialog.cpp \ |
33 | newaccount.cpp \ | 33 | newaccount.cpp \ |
34 | calculator.cpp \ | 34 | calculator.cpp \ |
35 | datepicker.cpp \ | 35 | datepicker.cpp \ |
36 | main.cpp \ | 36 | main.cpp \ |
37 | budget.cpp \ | 37 | budget.cpp \ |
38 | budgetdisplay.cpp \ | 38 | budgetdisplay.cpp \ |
39 | currency.cpp | 39 | currency.cpp |
40 | INCLUDEPATH = $(OPIEDIR)/include | 40 | INCLUDEPATH = $(OPIEDIR)/include |
41 | DEPENDPATH = $(OPIEDIR)/include | 41 | DEPENDPATH = $(OPIEDIR)/include |
42 | TARGET = qashmoney | 42 | TARGET = qashmoney |
43 | DESTDIR = $(OPIEDIR)/bin | 43 | DESTDIR = $(OPIEDIR)/bin |
44 | 44 | ||
45 | unix:LIBS += -lm | 45 | unix:LIBS += -lm |
46 | LIBS += -lqpe -lopiecore2 -lsqlite | 46 | LIBS += -lqpe -lopiecore2 -lsqlite3 |
47 | 47 | ||
48 | include ( $(OPIEDIR)/include.pro ) | 48 | include ( $(OPIEDIR)/include.pro ) |
49 | 49 | ||
50 | !isEmpty( LIBSQLITE_INC_DIR ) { | 50 | !isEmpty( LIBSQLITE_INC_DIR ) { |
51 | INCLUDEPATH = $$LIBSQLITE_INC_DIR $$INCLUDEPATH | 51 | INCLUDEPATH = $$LIBSQLITE_INC_DIR $$INCLUDEPATH |
52 | } | 52 | } |
53 | !isEmpty( LIBSQLITE_LIB_DIR ) { | 53 | !isEmpty( LIBSQLITE_LIB_DIR ) { |
54 | LIBS = -L$$LIBSQLITE_LIB_DIR $$LIBS | 54 | LIBS = -L$$LIBSQLITE_LIB_DIR $$LIBS |
55 | } | 55 | } |
diff --git a/noncore/apps/qashmoney/transaction.h b/noncore/apps/qashmoney/transaction.h index 5871555..3df43a8 100755 --- a/noncore/apps/qashmoney/transaction.h +++ b/noncore/apps/qashmoney/transaction.h | |||
@@ -1,23 +1,23 @@ | |||
1 | #ifndef TRANSACTION_H | 1 | #ifndef TRANSACTION_H |
2 | #define TRANSACTION_H | 2 | #define TRANSACTION_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | #include <qdatetime.h> | 6 | #include <qdatetime.h> |
7 | #include <sqlite.h> | 7 | #include <sqlite3.h> |
8 | 8 | ||
9 | #include "preferences.h" | 9 | #include "preferences.h" |
10 | 10 | ||
11 | class Transaction | 11 | class Transaction |
12 | { | 12 | { |
13 | public: | 13 | public: |
14 | 14 | ||
15 | Transaction (); | 15 | Transaction (); |
16 | ~Transaction (); | 16 | ~Transaction (); |
17 | 17 | ||
18 | // This function adds a new transaction to the database. It takes the payee, accountid, | 18 | // This function adds a new transaction to the database. It takes the payee, accountid, |
19 | // budgetid, number, day, month, year, amount, cleared | 19 | // budgetid, number, day, month, year, amount, cleared |
20 | void addTransaction ( QString description, QString payee, int accountid, int parentid, int number, int day, int month, int year, float amount, int cleared, int budgetid, int lineitemid ); | 20 | void addTransaction ( QString description, QString payee, int accountid, int parentid, int number, int day, int month, int year, float amount, int cleared, int budgetid, int lineitemid ); |
21 | 21 | ||
22 | // This updates an already existing transaction | 22 | // This updates an already existing transaction |
23 | void updateTransaction ( QString, QString, int, int, int, int, float, int, int, int, int ); | 23 | void updateTransaction ( QString, QString, int, int, int, int, float, int, int, int, int ); |
@@ -50,24 +50,24 @@ class Transaction | |||
50 | QString getPayee ( int ); | 50 | QString getPayee ( int ); |
51 | QString getTransactionDescription ( int ); | 51 | QString getTransactionDescription ( int ); |
52 | QString getNumber ( int ); | 52 | QString getNumber ( int ); |
53 | QString getAmount ( int ); | 53 | QString getAmount ( int ); |
54 | QString getAbsoluteAmount ( int ); | 54 | QString getAbsoluteAmount ( int ); |
55 | int getCleared ( int ); | 55 | int getCleared ( int ); |
56 | void setCleared ( int id, int cleared ); | 56 | void setCleared ( int id, int cleared ); |
57 | int getBudgetID ( int id ); | 57 | int getBudgetID ( int id ); |
58 | int getLineItemID ( int id ); | 58 | int getLineItemID ( int id ); |
59 | int getDay ( int ); | 59 | int getDay ( int ); |
60 | int getMonth ( int ); | 60 | int getMonth ( int ); |
61 | int getYear ( int ); | 61 | int getYear ( int ); |
62 | int getAccountID ( int id ); | 62 | int getAccountID ( int id ); |
63 | 63 | ||
64 | private: | 64 | private: |
65 | 65 | ||
66 | sqlite *tdb; | 66 | sqlite3 *tdb; |
67 | int rows, columns; | 67 | int rows, columns; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | 72 | ||
73 | 73 | ||