summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-11-09 01:26:34 (UTC)
committer mickeyl <mickeyl>2003-11-09 01:26:34 (UTC)
commit28d03a7d43f449949991a91cab63580ef6220725 (patch) (side-by-side diff)
tree0d48f35e50f3f4ef58c1961ee4ed968dab183abb
parent61d14f9b908f06e3ef34c2ed3e7f1368c9e4533e (diff)
downloadopie-28d03a7d43f449949991a91cab63580ef6220725.zip
opie-28d03a7d43f449949991a91cab63580ef6220725.tar.gz
opie-28d03a7d43f449949991a91cab63580ef6220725.tar.bz2
fix compilage and integrate into buildsystem
directory structure is a mess though...
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/qashmoney/config.in4
-rwxr-xr-xnoncore/apps/qashmoney/qashmoney.pro8
-rwxr-xr-xnoncore/apps/qashmoney/transaction.cpp8
-rwxr-xr-xnoncore/apps/qashmoney/transfer.cpp4
-rw-r--r--packages1
5 files changed, 19 insertions, 6 deletions
diff --git a/noncore/apps/qashmoney/config.in b/noncore/apps/qashmoney/config.in
new file mode 100644
index 0000000..94c39b6
--- a/dev/null
+++ b/noncore/apps/qashmoney/config.in
@@ -0,0 +1,4 @@
+ config QASHMONEY
+ boolean "opie-qashmoney (money manager)"
+ default "n"
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE
diff --git a/noncore/apps/qashmoney/qashmoney.pro b/noncore/apps/qashmoney/qashmoney.pro
index 1070767..8b4646a 100755
--- a/noncore/apps/qashmoney/qashmoney.pro
+++ b/noncore/apps/qashmoney/qashmoney.pro
@@ -1,41 +1,49 @@
TEMPLATE = app
CONFIG = qt warn_on release
HEADERS = qashmoney.h \
accountdisplay.h \
account.h \
transaction.h \
transactiondisplay.h \
newtransaction.h \
transfer.h \
transferdialog.h \
preferences.h \
preferencedialogs.h \
memory.h \
memorydialog.h \
newaccount.h \
calculator.h \
datepicker.h \
budget.h \
budgetdisplay.h \
currency.h
SOURCES = qashmoney.cpp \
accountdisplay.cpp \
account.cpp \
transaction.cpp \
transactiondisplay.cpp \
newtransaction.cpp \
transfer.cpp \
transferdialog.cpp \
preferences.cpp \
preferencedialogs.cpp \
memory.cpp \
memorydialog.cpp \
newaccount.cpp \
calculator.cpp \
datepicker.cpp \
main.cpp \
budget.cpp \
budgetdisplay.cpp \
currency.cpp
+INCLUDEPATH = $(OPIEDIR)/include
+DEPENDPATH = $(OPIEDIR)/include
+
+DESTDIR = $(OPIEDIR)/bin
+
unix:LIBS += -lm
LIBS += -lqpe -lqte -lstdc++ -lsqlite
+
+include ( $(OPIEDIR)/include.pro )
+
diff --git a/noncore/apps/qashmoney/transaction.cpp b/noncore/apps/qashmoney/transaction.cpp
index a3bd9e7..dcf46b1 100755
--- a/noncore/apps/qashmoney/transaction.cpp
+++ b/noncore/apps/qashmoney/transaction.cpp
@@ -1,83 +1,83 @@
// RESERVEDONE COLUMN NAME REPRESENTS THE LINEITEMID AND SHOULD BE CHANGED IN
// FUTURE VERSIONS OF QASHMONEY
// RESERVEDTWO REPRESENTS THE TRANSACTION DESCRIPTION
#include "transaction.h"
#include "account.h"
#include "transactiondisplay.h"
#include <stdlib.h>
#include <iostream.h>
extern Account *account;
extern Preferences *preferences;
Transaction::Transaction ()
{
tdb = sqlite_open ( "qmtransactions.db", 0, NULL );
}
Transaction::~Transaction ()
{
sqlite_close ( tdb );
}
void Transaction::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 )
{
- sqlite_exec_printf ( tdb, "insert into transactions values ( '%q', %i, %i, %i, %i, %i, %i, %.2f, %i, %i, 0, 0, 0, 0, 0, 0, %i, '%q', 0,
- 0, 0, 0, NULL );", 0, 0, 0, ( const char * ) payee, accountid, parentid, number, day, month, year, amount, cleared, budgetid, lineitemid, ( const char * ) description );
+ sqlite_exec_printf ( tdb, "insert into transactions values ( '%q', %i, %i, %i, %i, %i, %i, %.2f, %i, %i, 0, 0, 0, 0, 0, 0, %i, '%q', 0, "
+ "0, 0, 0, NULL );", 0, 0, 0, ( const char * ) payee, accountid, parentid, number, day, month, year, amount, cleared, budgetid, lineitemid, ( const char * ) description );
}
void Transaction::updateTransaction ( QString description, QString payee, int number, int day, int month, int year, float amount, int cleared, int budgetid, int lineitemid, int transactionid )
{
- sqlite_exec_printf ( tdb, "update transactions set reservedtwo = '%q', payee = '%q', number = %i, day = %i, month = %i, year = %i, amount = %.2f,
- cleared = %i, budgetid = %i, reservedone = %i where transid = %i;", 0, 0, 0, ( const char * ) description, ( const char * ) payee, number, day, month, year,
+ sqlite_exec_printf ( tdb, "update transactions set reservedtwo = '%q', payee = '%q', number = %i, day = %i, month = %i, year = %i, amount = %.2f,"
+ "cleared = %i, budgetid = %i, reservedone = %i where transid = %i;", 0, 0, 0, ( const char * ) description, ( const char * ) payee, number, day, month, year,
amount, cleared, budgetid, lineitemid, transactionid );
}
void Transaction::deleteTransaction ( int transid )
{
sqlite_exec_printf ( tdb, "delete from transactions where transid = %i;", 0, 0, 0, transid );
}
void Transaction::deleteAllTransactions ( int accountid )
{
sqlite_exec_printf ( tdb, "delete from transactions where accountid = %i;", 0, 0, 0, accountid );
}
int Transaction::getAccountID ( int id )
{
char **results;
sqlite_get_table_printf ( tdb, "select accountid from transactions where transid= %i;", &results, NULL, NULL, NULL, id );
return atol ( results [ 1 ] );
}
int Transaction::getNumberOfTransactions ()
{
char **results;
sqlite_get_table ( tdb, "select count() from transactions;", &results, NULL, NULL, NULL );
return atoi ( results [ 1 ] );
}
int Transaction::getNumberOfTransactions ( int accountid )
{
char **results;
sqlite_get_table_printf ( tdb, "select count() from transactions where accountid = %i;", &results, NULL, NULL, NULL, accountid );
return atol ( results [ 1 ] );
}
QString Transaction::getPayee ( int id )
{
char **results;
sqlite_get_table_printf ( tdb, "select payee from transactions where transid= %i;", &results, NULL, NULL, NULL, id );
return results [ 1 ];
}
QString Transaction::getTransactionDescription ( int id )
{
char **results;
sqlite_get_table_printf ( tdb, "select reservedtwo from transactions where transid= %i;", &results, NULL, NULL, NULL, id );
return results [ 1 ];
}
diff --git a/noncore/apps/qashmoney/transfer.cpp b/noncore/apps/qashmoney/transfer.cpp
index 568d584..c4bbaf9 100755
--- a/noncore/apps/qashmoney/transfer.cpp
+++ b/noncore/apps/qashmoney/transfer.cpp
@@ -1,85 +1,85 @@
#include "transfer.h"
#include "account.h"
#include "transactiondisplay.h"
#include <stdlib.h>
#include <iostream.h>
extern Account *account;
extern Preferences *preferences;
Transfer::Transfer ()
{
db = sqlite_open ( "qmtransfers.db", 0, 0 );
}
Transfer::~Transfer ()
{
sqlite_close ( db );
}
void Transfer::addTransfer ( int fromaccount, int fromparent, int toaccount, int toparent, int day, int month, int year, float amount, int cleared )
{
int nextrowid = -1;
char **results;
sqlite_get_table ( db, "select count() from transfers;", &results, 0, 0, 0 );
if ( atoi ( results [ 1 ] ) != 0 )
{
char **results;
sqlite_get_table ( db, "select min ( rowid ) from transfers;", &results, 0, 0, 0 );
nextrowid = ( atoi ( results [ 1 ] ) ) - 1;
}
sqlite_exec_printf ( db, "insert into transfers values ( %i, %i, %i, %i, %i, %i, %i, 0, 0, %.2f, %i, 0, 0, 0, 0, 0, %i );", 0, 0, 0, fromaccount, fromparent, toaccount, toparent, day, month, year, amount, cleared, nextrowid );
}
void Transfer::updateTransfer ( int fromaccount, int fromparent, int toaccount, int toparent, int day, int month, int year, float amount, int cleared, int transferid )
{
- sqlite_exec_printf ( db, "update transfers set fromaccount = %i, fromparent = %i, toaccount = %i, toparent = %i, day = %i, month = %i, year = %i,
- amount = %.2f, cleared = %i where transferid = %i;", 0, 0, 0, fromaccount, fromparent, toaccount, toparent, day, month, year, amount, cleared, transferid );
+ sqlite_exec_printf ( db, "update transfers set fromaccount = %i, fromparent = %i, toaccount = %i, toparent = %i, day = %i, month = %i, year = %i,"
+ "amount = %.2f, cleared = %i where transferid = %i;", 0, 0, 0, fromaccount, fromparent, toaccount, toparent, day, month, year, amount, cleared, transferid );
}
void Transfer::deleteTransfer ( int transferid )
{
sqlite_exec_printf ( db, "delete from transfers where transferid = %i;", 0, 0, 0, transferid );
}
void Transfer::deleteAllTransfers ( int accountid )
{
sqlite_exec_printf ( db, "delete from transfers where fromaccount = %i;", 0, 0, 0, accountid );
sqlite_exec_printf ( db, "delete from transfers where toaccount = %i;", 0, 0, 0, accountid );
}
int Transfer::getNumberOfTransfers ()
{
char **results;
sqlite_get_table ( db, "select count() from transfers;", &results, 0, 0, 0 );
return atoi ( results [ 1 ] );
}
int Transfer::getNumberOfTransfers ( int accountid )
{
char **results;
sqlite_get_table_printf ( db, "select count() from transfers where fromaccount = %i;", &results, 0, 0, 0, accountid );
int transfers = atoi ( results [ 1 ] );
sqlite_get_table_printf ( db, "select count() from transfers where toaccount = %i;", &results, 0, 0, 0, accountid );
transfers = transfers + atoi ( results [ 1 ] );
return transfers;
}
void Transfer::displayTransfers ( QListView *listview, int accountid, bool children, QDate displaydate )
{
int showcleared = preferences->getPreference ( 3 );
// select the from transfers to display
char **results;
int rows, columns;
if ( account->getParentAccountID ( accountid ) == -1 && children == TRUE )
{
if ( showcleared == 0 )
sqlite_get_table_printf ( db, "select day, month, year, amount, transferid, fromaccount, toaccount from transfers where cleared = 0 and toparent = %i;", &results, &rows, &columns, 0, accountid );
else
sqlite_get_table_printf ( db, "select day, month, year, amount, transferid, fromaccount, toaccount from transfers where toparent = %i;", &results, &rows, &columns, 0, accountid );
}
else
{
if ( showcleared == 0 )
sqlite_get_table_printf ( db, "select day, month, year, amount, transferid, fromaccount, toaccount from transfers where cleared = 0 and toaccount = %i;", &results, &rows, &columns, 0, accountid );
diff --git a/packages b/packages
index c48eee8..0e6340f 100644
--- a/packages
+++ b/packages
@@ -75,96 +75,97 @@ CONFIG_LIBOPIE2MM libopie2/opiemm opiemm.pro
CONFIG_LIBOPIETOOTH noncore/net/opietooth/lib lib.pro
CONFIG_LIBOPIE_PIM libopie/pim pim.pro
CONFIG_LIBQPE library library.pro
CONFIG_LIBQPE-X11 x11/libqpe-x11 libqpe-x11.pro
CONFIG_LIBSQL libsql libsql.pro
CONFIG_LIBTREMOR core/multimedia/opieplayer/vorbis/tremor tremor.pro
CONFIG_LIBTREMORPLUGIN core/multimedia/opieplayer/vorbis libtremor.pro
CONFIG_LIGHT-AND-POWER core/settings/light-and-power light-and-power.pro
CONFIG_LIQUID noncore/styles/liquid liquid.pro
CONFIG_LOGOUTAPPLET core/applets/logoutapplet logoutapplet.pro
CONFIG_MAILIT noncore/net/mailit mailit.pro
CONFIG_MEDIUMMOUNT noncore/settings/mediummount mediummount.pro
CONFIG_MEMORYAPPLET noncore/applets/memoryapplet memoryapplet.pro
CONFIG_METAL noncore/styles/metal metal.pro
CONFIG_MINDBREAKER noncore/games/mindbreaker mindbreaker.pro
CONFIG_MINESWEEP noncore/games/minesweep minesweep.pro
CONFIG_MOBILEMSG noncore/comm/mobilemsg mobilemsg.pro
CONFIG_MODPLUG core/multimedia/opieplayer/modplug modplug.pro
CONFIG_MULTIKEY inputmethods/multikey multikey.pro
CONFIG_NETSYSTEMTIME noncore/settings/netsystemtime netsystemtime.pro
CONFIG_NETWORKAPPLET noncore/applets/networkapplet networkapplet.pro
CONFIG_NETWORKSETUP noncore/settings/networksettings networksettings.pro
CONFIG_NOTESAPPLET noncore/applets/notesapplet notesapplet.pro
CONFIG_OAPP core/apps/oapp oapp.pro
CONFIG_OBEX core/applets/obex2 obex.pro
CONFIG_ODICT noncore/apps/odict odict.pro
CONFIG_OIPKG core/apps/oipkg oipkg.pro
CONFIG_OPIE-CONSOLE noncore/apps/opie-console opie-console.pro
CONFIG_OPIE-LOGIN core/opie-login opie-login.pro
CONFIG_OPIE-READER noncore/apps/opie-reader opie-reader.pro
CONFIG_OPIE-SH noncore/tools/opie-sh opie-sh.pro
CONFIG_OPIE-SHEET noncore/apps/opie-sheet opie-sheet.pro
CONFIG_OPIE-WRITE noncore/apps/opie-write opie-write.pro
CONFIG_OPIEALARM core/opiealarm
CONFIG_OPIEFTP noncore/net/opieftp opieftp.pro
CONFIG_OPIEIRC noncore/net/opieirc opieirc.pro
CONFIG_OPIEMAIL2 noncore/mail mail.pro
CONFIG_OPIEPLAYER core/multimedia/opieplayer opieplayer.pro
CONFIG_OPIEPLAYER2 noncore/multimedia/opieplayer2 opieplayer2.pro
CONFIG_OPIE-RDESKTOP noncore/net/opierdesktop opierdesktop.pro
CONFIG_OPIEREC noncore/multimedia/opierec opierec.pro
CONFIG_OPIETOOTH-APPLET noncore/net/opietooth/applet applet.pro
CONFIG_OPIETOOTH-MANAGER noncore/net/opietooth/manager manager.pro
CONFIG_OSEARCH core/pim/osearch osearch.pro
CONFIG_OXYGEN noncore/apps/oxygen oxygen.pro
CONFIG_PARASHOOT noncore/games/parashoot parashoot.pro
CONFIG_PICKBOARD inputmethods/pickboard pickboard.pro
CONFIG_QASTEROIDS noncore/games/qasteroids qasteroids.pro
+CONFIG_QASHMONEY noncore/apps/qashmoney qashmoney.pro
CONFIG_QCOP core/apps/qcop qcop.pro
CONFIG_QPDF noncore/graphics/qpdf qpdf.pro
CONFIG_QPDF2 noncore/graphics/qpdf2 qpdf2.pro
CONFIG_QUICKLAUNCHER core/tools/quicklauncher quicklauncher.pro
CONFIG_QWS core/qws qws.pro
CONFIG_REMOTE noncore/tools/remote remote.pro
CONFIG_RESTARTAPPLET core/applets/restartapplet restartapplet.pro
CONFIG_RESTARTAPPLET2 core/applets/restartapplet2 restartapplet2.pro
CONFIG_ROTATEAPPLET core/applets/rotateapplet rotateapplet.pro
CONFIG_ROTATION noncore/settings/rotation rotation.pro
CONFIG_RUNAPPLET core/applets/runapplet runapplet.pro
CONFIG_SCREENSHOTAPPLET core/applets/screenshotapplet screenshotapplet.pro
CONFIG_SECURITY core/settings/security security.pro
CONFIG_SFCAVE noncore/games/sfcave sfcave.pro
CONFIG_SFCAVE-SDL noncore/games/sfcave-sdl sfcave-sdl.pro
CONFIG_SHOWIMG noncore/multimedia/showimg showimg.pro
CONFIG_SIMPLE noncore/tools/calc2/simple simple.pro
CONFIG_SINGLE single single.pro
CONFIG_SNAKE noncore/games/snake snake.pro
CONFIG_SOLITAIRE noncore/games/solitaire solitaire.pro
CONFIG_SOUND noncore/settings/sound sound.pro
CONFIG_SSHKEYS noncore/settings/sshkeys sshkeys.pro
CONFIG_SUSPENDAPPLET core/applets/suspendapplet suspendapplet.pro
CONFIG_SYSINFO noncore/apps/sysinfo sysinfo.pro
CONFIG_TABLEVIEWER noncore/apps/tableviewer tableviewer.pro
CONFIG_TABMANAGER noncore/settings/tabmanager tabmanager.pro
CONFIG_TABOAPP core/apps/taboapp taboapp.pro
CONFIG_TEST libsql/test test.pro
CONFIG_TEST noncore/apps/opie-console/test test.pro
CONFIG_TETRIX noncore/games/tetrix tetrix.pro
CONFIG_TEXTEDIT core/apps/textedit textedit.pro
CONFIG_THEME noncore/styles/theme theme.pro
CONFIG_TICTAC noncore/games/tictac tictac.pro
CONFIG_TINYKATE noncore/apps/tinykate tinykate.pro
CONFIG_TODAY core/pim/today today.pro
CONFIG_TODAY_ADDRESSBOOK core/pim/today/plugins/addressbook addressbook.pro
CONFIG_TODAY_DATEBOOK core/pim/today/plugins/datebook datebook.pro
CONFIG_TODAY_FORTUNE noncore/todayplugins/fortune fortune.pro
CONFIG_TODAY_MAIL core/pim/today/plugins/mail mail.pro
CONFIG_TODAY_STOCKTICKER noncore/todayplugins/stockticker/stockticker stockticker.pro
CONFIG_TODAY_STOCKTICKERLIB noncore/todayplugins/stockticker/stocktickerlib stocktickerlib.pro
CONFIG_TODAY_TODOLIST core/pim/today/plugins/todolist todolist.pro
CONFIG_TODAY_WEATHER noncore/todayplugins/weather weather.pro
CONFIG_TODO core/pim/todo todo.pro
CONFIG_UBROWSER noncore/net/ubrowser ubrowser.pro
CONFIG_UNIKEYBOARD inputmethods/unikeyboard unikeyboard.pro
CONFIG_USERMANAGER noncore/settings/usermanager usermanager.pro
CONFIG_VMEMO core/applets/vmemo vmemo.pro