summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/account.cpp
authorallenforsythe <allenforsythe>2003-05-28 11:49:47 (UTC)
committer allenforsythe <allenforsythe>2003-05-28 11:49:47 (UTC)
commit52047fd3d3f30509d65834747c3a0c5c6760dc01 (patch) (unidiff)
tree136945c2ffff2434ba1e3c8959b5335f5016e8f8 /noncore/apps/qashmoney/account.cpp
parent7c85b3e98921afa74c7c6a90da4dfd54631c89c5 (diff)
downloadopie-52047fd3d3f30509d65834747c3a0c5c6760dc01.zip
opie-52047fd3d3f30509d65834747c3a0c5c6760dc01.tar.gz
opie-52047fd3d3f30509d65834747c3a0c5c6760dc01.tar.bz2
*** empty log message ***
Diffstat (limited to 'noncore/apps/qashmoney/account.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/account.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/noncore/apps/qashmoney/account.cpp b/noncore/apps/qashmoney/account.cpp
index fc2f8c1..28f9ba2 100755
--- a/noncore/apps/qashmoney/account.cpp
+++ b/noncore/apps/qashmoney/account.cpp
@@ -19,15 +19,14 @@ Account::~Account ()
19 sqlite_close ( adb ); 19 sqlite_close ( adb );
20 } 20 }
21 21
22void Account::addAccount ( QString name, int parentid, float balance, int type, QString description, float creditlimit, 22void Account::addAccount ( QString name, int parentid, float balance, int type, QString description, float creditlimit,
23 int statementyear, int statementmonth, int statementday, float statementbalance, const char *currency ) 23 int statementyear, int statementmonth, int statementday, float statementbalance, const char *currency )
24 { 24 {
25 int r = sqlite_exec_printf ( adb, "insert into accounts2 values ( '%q', %i, %.2f, %i, '%q', %.2f, %i, %i, %i, %.2f, '%q', 0, 0, 0, 0, 0, NULL );", 0, 0, 0, 25 sqlite_exec_printf ( adb, "insert into accounts2 values ( '%q', %i, %.2f, %i, '%q', %.2f, %i, %i, %i, %.2f, '%q', 0, 0, 0, 0, 0, NULL );", 0, 0, 0,
26 (const char *) name, parentid, balance, type, (const char *) description, creditlimit, statementyear, statementmonth, statementday, statementbalance, currency ); 26 (const char *) name, parentid, balance, type, (const char *) description, creditlimit, statementyear, statementmonth, statementday, statementbalance, currency );
27 cout << "Results = " << r << endl;
28 } 27 }
29 28
30void Account::updateAccount ( QString name, QString description, QString currencycode, int accountid ) 29void Account::updateAccount ( QString name, QString description, QString currencycode, int accountid )
31 { 30 {
32 sqlite_exec_printf ( adb, "update accounts2 set name = '%q', description = '%q', currency = '%q' where accountid = %i;", 0, 0, 0, ( const char * ) name, ( const char * ) description, ( const char * ) currencycode, accountid ); 31 sqlite_exec_printf ( adb, "update accounts2 set name = '%q', description = '%q', currency = '%q' where accountid = %i;", 0, 0, 0, ( const char * ) name, ( const char * ) description, ( const char * ) currencycode, accountid );
33 } 32 }
@@ -222,12 +221,18 @@ void Account::displayAccounts ( QListView *listview )
222 listview->setColumnWidth ( 1, preferences->getColumnPreference ( 11 ) ); 221 listview->setColumnWidth ( 1, preferences->getColumnPreference ( 11 ) );
223 listview->setColumnWidthMode ( 1, QListView::Manual ); 222 listview->setColumnWidthMode ( 1, QListView::Manual );
224 listview->setColumnWidth ( 2, preferences->getColumnPreference ( 12 ) ); 223 listview->setColumnWidth ( 2, preferences->getColumnPreference ( 12 ) );
225 listview->setColumnWidthMode ( 2, QListView::Manual ); 224 listview->setColumnWidthMode ( 2, QListView::Manual );
226 listview->setColumnWidthMode ( 3, QListView::Manual ); 225 listview->setColumnWidthMode ( 3, QListView::Manual );
227 } 226 }
227
228 // Now reset the column sorting to user preference
229 int column = 0;
230 int direction = 0;
231 preferences->getSortingPreference ( 1, &column, &direction );
232 listview->setSorting ( column, direction );
228 } 233 }
229 234
230int Account::displayParentAccountNames ( QComboBox *combobox, QString indexstring ) 235int Account::displayParentAccountNames ( QComboBox *combobox, QString indexstring )
231 { 236 {
232 char **results; 237 char **results;
233 int rows, columns, index; 238 int rows, columns, index;