author | mickeyl <mickeyl> | 2003-08-10 15:40:31 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-08-10 15:40:31 (UTC) |
commit | 616e919ff6aea6a30e18edb37128c229e806beae (patch) (unidiff) | |
tree | 31e36f7d631b3dc55460aefd05bc6a455e73ace1 /libopie2/examples | |
parent | dfcbe21d8b263c13283e226bd16596c2d7c2f9a3 (diff) | |
download | opie-616e919ff6aea6a30e18edb37128c229e806beae.zip opie-616e919ff6aea6a30e18edb37128c229e806beae.tar.gz opie-616e919ff6aea6a30e18edb37128c229e806beae.tar.bz2 |
merge zeckes libsql into libopie2
-rw-r--r-- | libopie2/examples/config.in | 4 | ||||
-rw-r--r-- | libopie2/examples/examples.pro | 2 | ||||
-rw-r--r-- | libopie2/examples/opiecore/odebugdemo/odebugdemo.pro | 5 | ||||
-rw-r--r-- | libopie2/examples/opiedb/.cvsignore | 6 | ||||
-rw-r--r-- | libopie2/examples/opiedb/opiedb.pro | 3 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/.cvsignore | 6 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/main.cpp | 29 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/spaltenweise.cpp | 41 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/spaltenweise.pro | 13 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/sqltest.pro | 13 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/test.osql | 4 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/test2.osql | 5 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/zeilenweise.cpp | 84 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/zeilenweise.pro | 13 |
14 files changed, 222 insertions, 6 deletions
diff --git a/libopie2/examples/config.in b/libopie2/examples/config.in index 478a822..2460ae4 100644 --- a/libopie2/examples/config.in +++ b/libopie2/examples/config.in | |||
@@ -1,6 +1,6 @@ | |||
1 | config LIBOPIE2EXAMPLES | 1 | config LIBOPIE2EXAMPLES |
2 | boolean "libopie2 examples" | 2 | boolean "libopie2 examples" |
3 | default "n" | 3 | default "n" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2NET && LIBOPIE2UI && LIBOPIE2PIM && LIBOPIE2UI && LIBOPIE2MM | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2DB && LIBOPIE2NET && LIBOPIE2UI && LIBOPIE2PIM && LIBOPIE2UI && LIBOPIE2MM |
5 | comment "the examples need a libqpe, libopie2core, libopie2db, libopie2net, libopie2pim, libopie2ui and libopie2mm" | 5 | comment "the examples need a libqpe, libopie2core, libopie2db, libopie2net, libopie2pim, libopie2ui and libopie2mm" |
6 | depends !(( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2NET && LIBOPIE2UI && LIBOPIE2PIM && LIBOPIE2UI && LIBOPIE2MM) | 6 | depends !(( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2DB && LIBOPIE2NET && LIBOPIE2UI && LIBOPIE2PIM && LIBOPIE2UI && LIBOPIE2MM) |
diff --git a/libopie2/examples/examples.pro b/libopie2/examples/examples.pro index 8add40d..c1ed98e 100644 --- a/libopie2/examples/examples.pro +++ b/libopie2/examples/examples.pro | |||
@@ -1,4 +1,4 @@ | |||
1 | TEMPLATE = subdirs | 1 | TEMPLATE = subdirs |
2 | unix:SUBDIRS = opieui opienet opiecore opiemm | 2 | unix:SUBDIRS = opieui opienet opiecore opiemm opiedb |
3 | 3 | ||
4 | #include ( ../../../include.pro ) | 4 | #include ( ../../../include.pro ) |
diff --git a/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro b/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro index a725105..4cd815f 100644 --- a/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro +++ b/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro | |||
@@ -6,9 +6,8 @@ INCLUDEPATH += $(OPIEDIR)/include | |||
6 | DEPENDPATH += $(OPIEDIR)/include | 6 | DEPENDPATH += $(OPIEDIR)/include |
7 | LIBS += -lopiecore2 | 7 | LIBS += -lopiecore2 |
8 | TARGET = odebugdemo | 8 | TARGET = odebugdemo |
9 | MOC_DIR = moc | ||
10 | OBJECTS_DIR = obj | ||
11 | 9 | ||
12 | include ( $(OPIEDIR)/include.pro ) | 10 | include ( $(OPIEDIR)/include.pro ) |
13 | 11 | ||
14 | 12 | MOC_DIR = moc | |
13 | OBJECTS_DIR = obj | ||
diff --git a/libopie2/examples/opiedb/.cvsignore b/libopie2/examples/opiedb/.cvsignore new file mode 100644 index 0000000..972e959 --- a/dev/null +++ b/libopie2/examples/opiedb/.cvsignore | |||
@@ -0,0 +1,6 @@ | |||
1 | Makefile* | ||
2 | moc* | ||
3 | *moc | ||
4 | *.o | ||
5 | ~* | ||
6 | obj | ||
diff --git a/libopie2/examples/opiedb/opiedb.pro b/libopie2/examples/opiedb/opiedb.pro new file mode 100644 index 0000000..85fa6db --- a/dev/null +++ b/libopie2/examples/opiedb/opiedb.pro | |||
@@ -0,0 +1,3 @@ | |||
1 | TEMPLATE = subdirs | ||
2 | SUBDIRS = sqltest | ||
3 | |||
diff --git a/libopie2/examples/opiedb/sqltest/.cvsignore b/libopie2/examples/opiedb/sqltest/.cvsignore new file mode 100644 index 0000000..972e959 --- a/dev/null +++ b/libopie2/examples/opiedb/sqltest/.cvsignore | |||
@@ -0,0 +1,6 @@ | |||
1 | Makefile* | ||
2 | moc* | ||
3 | *moc | ||
4 | *.o | ||
5 | ~* | ||
6 | obj | ||
diff --git a/libopie2/examples/opiedb/sqltest/main.cpp b/libopie2/examples/opiedb/sqltest/main.cpp new file mode 100644 index 0000000..2ecbf76 --- a/dev/null +++ b/libopie2/examples/opiedb/sqltest/main.cpp | |||
@@ -0,0 +1,29 @@ | |||
1 | #include <qdir.h> | ||
2 | |||
3 | #include <qpe/qpeapplication.h> | ||
4 | #include <opie2/osqlmanager.h> | ||
5 | #include <opie2/osqlquery.h> | ||
6 | #include <opie2/osqldriver.h> | ||
7 | #include <opie2/osqlresult.h> | ||
8 | |||
9 | int main( int argc, char* argv[] ) { | ||
10 | |||
11 | QPEApplication app( argc, argv ); | ||
12 | OSQLManager man; | ||
13 | man.registerPath( QDir::currentDirPath() ); | ||
14 | OSQLBackEnd::ValueList list = man.queryBackEnd(); | ||
15 | |||
16 | OSQLDriver *driver = man.standard(); | ||
17 | qWarning("testmain" + driver->id() ); | ||
18 | driver->setUrl("/home/ich/test2vhgytry"); | ||
19 | if ( driver->open() ) { | ||
20 | qWarning("could open"); | ||
21 | }else | ||
22 | qWarning("wasn't able to open"); | ||
23 | OSQLRawQuery raw("select * from t2" ); | ||
24 | OSQLResult res = driver->query( &raw ); | ||
25 | |||
26 | OSQLRawQuery raw2( "insert into t2 VALUES(ROWID,'Meine Mutter') "); | ||
27 | res = driver->query(&raw2); | ||
28 | |||
29 | }; | ||
diff --git a/libopie2/examples/opiedb/sqltest/spaltenweise.cpp b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp new file mode 100644 index 0000000..8790cdd --- a/dev/null +++ b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp | |||
@@ -0,0 +1,41 @@ | |||
1 | #include <qdir.h> | ||
2 | |||
3 | #include <qpe/qpeapplication.h> | ||
4 | #include "../osqlmanager.h" | ||
5 | #include "../osqlquery.h" | ||
6 | #include "../osqldriver.h" | ||
7 | #include "../osqlresult.h" | ||
8 | |||
9 | int main( int argc, char* argv[] ) { | ||
10 | |||
11 | QPEApplication app( argc, argv ); | ||
12 | OSQLManager man; | ||
13 | man.registerPath( QDir::currentDirPath() ); | ||
14 | OSQLBackEnd::ValueList list = man.queryBackEnd(); | ||
15 | |||
16 | OSQLDriver *driver = man.standard(); | ||
17 | qWarning("testmain" + driver->id() ); | ||
18 | driver->setUrl("/home/ich/spaltenweise"); | ||
19 | if ( driver->open() ) { | ||
20 | qWarning("could open"); | ||
21 | }else | ||
22 | qWarning("wasn't able to open"); | ||
23 | OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(" | ||
24 | "uid,categories,completed," | ||
25 | "progress,summary,HasDate," | ||
26 | "DateDay,DateMonth,DateYear," | ||
27 | "priority,description)" ); | ||
28 | |||
29 | OSQLResult res = driver->query( raw ); | ||
30 | delete raw; | ||
31 | for (int i = 0; i< 10000; i++ ) { | ||
32 | int uid = i; | ||
33 | OSQLRawQuery raw("insert into todolist VALUES("+ | ||
34 | QString::number(uid)+ ",'-122324;-12132',1,100,"+ | ||
35 | "'Summary234-"+QString::number(uid)+"',1,5,8,2002,1,"+ | ||
36 | "'Description\n12344')"); | ||
37 | OSQLResult res = driver->query( &raw ); | ||
38 | |||
39 | } | ||
40 | return 0; | ||
41 | }; | ||
diff --git a/libopie2/examples/opiedb/sqltest/spaltenweise.pro b/libopie2/examples/opiedb/sqltest/spaltenweise.pro new file mode 100644 index 0000000..f54fada --- a/dev/null +++ b/libopie2/examples/opiedb/sqltest/spaltenweise.pro | |||
@@ -0,0 +1,13 @@ | |||
1 | TEMPLATE= app | ||
2 | CONFIG = qt warn_on release | ||
3 | HEADERS = | ||
4 | SOURCES = spaltenweise.cpp | ||
5 | INCLUDEPATH += $(OPIEDIR)/include | ||
6 | DEPENDPATH+= $(OPIEDIR)/include | ||
7 | LIBS += -lqpe -lopiesql | ||
8 | TARGET = spaltenweise | ||
9 | |||
10 | |||
11 | |||
12 | |||
13 | include ( $(OPIEDIR)/include.pro ) | ||
diff --git a/libopie2/examples/opiedb/sqltest/sqltest.pro b/libopie2/examples/opiedb/sqltest/sqltest.pro new file mode 100644 index 0000000..1e40468 --- a/dev/null +++ b/libopie2/examples/opiedb/sqltest/sqltest.pro | |||
@@ -0,0 +1,13 @@ | |||
1 | TEMPLATE= app | ||
2 | CONFIG = qt warn_on release | ||
3 | HEADERS = | ||
4 | SOURCES = main.cpp | ||
5 | INCLUDEPATH += $(OPIEDIR)/include | ||
6 | DEPENDPATH+= $(OPIEDIR)/include | ||
7 | LIBS += -lqpe -lopiedb2 -lsqlite | ||
8 | TARGET = sqltest | ||
9 | |||
10 | |||
11 | |||
12 | |||
13 | include ( $(OPIEDIR)/include.pro ) | ||
diff --git a/libopie2/examples/opiedb/sqltest/test.osql b/libopie2/examples/opiedb/sqltest/test.osql new file mode 100644 index 0000000..340e4f2 --- a/dev/null +++ b/libopie2/examples/opiedb/sqltest/test.osql | |||
@@ -0,0 +1,4 @@ | |||
1 | Name = Test1 | ||
2 | Vendor = Zecke | ||
3 | License = ZPL | ||
4 | Preference = 15 | ||
diff --git a/libopie2/examples/opiedb/sqltest/test2.osql b/libopie2/examples/opiedb/sqltest/test2.osql new file mode 100644 index 0000000..952c99b --- a/dev/null +++ b/libopie2/examples/opiedb/sqltest/test2.osql | |||
@@ -0,0 +1,5 @@ | |||
1 | Name = Test2 | ||
2 | Vendor = Schaf | ||
3 | License = SPL | ||
4 | Preference = 15 | ||
5 | Default = 0 | ||
diff --git a/libopie2/examples/opiedb/sqltest/zeilenweise.cpp b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp new file mode 100644 index 0000000..e538c9f --- a/dev/null +++ b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp | |||
@@ -0,0 +1,84 @@ | |||
1 | #include <qdir.h> | ||
2 | |||
3 | #include <qpe/qpeapplication.h> | ||
4 | #include "../osqlmanager.h" | ||
5 | #include "../osqlquery.h" | ||
6 | #include "../osqldriver.h" | ||
7 | #include "../osqlresult.h" | ||
8 | |||
9 | int main( int argc, char* argv[] ) { | ||
10 | |||
11 | QPEApplication app( argc, argv ); | ||
12 | OSQLManager man; | ||
13 | man.registerPath( QDir::currentDirPath() ); | ||
14 | OSQLBackEnd::ValueList list = man.queryBackEnd(); | ||
15 | |||
16 | OSQLDriver *driver = man.standard(); | ||
17 | qWarning("testmain" + driver->id() ); | ||
18 | driver->setUrl("/home/ich/zeilenweise"); | ||
19 | if ( driver->open() ) { | ||
20 | qWarning("could open"); | ||
21 | }else | ||
22 | qWarning("wasn't able to open"); | ||
23 | OSQLRawQuery raw2("BEGIN TRANSACTION"); | ||
24 | OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(uid,key,value)"); | ||
25 | OSQLResult res = driver->query( &raw2 ); | ||
26 | res = driver->query( raw ); | ||
27 | delete raw; | ||
28 | for (int i = 0; i< 10000; i++ ) { | ||
29 | int uid = i; | ||
30 | OSQLRawQuery *raw; | ||
31 | raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid)+",'Categories',"+"'-122324;-12132')"); | ||
32 | OSQLResult res = driver->query(raw ); | ||
33 | delete raw; | ||
34 | |||
35 | raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid) + | ||
36 | ",'Completed',1)" ); | ||
37 | res = driver->query(raw ); | ||
38 | delete raw; | ||
39 | |||
40 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | ||
41 | QString::number(uid)+",'Progress',100)" ); | ||
42 | res = driver->query( raw ); | ||
43 | delete raw; | ||
44 | |||
45 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | ||
46 | QString::number(uid)+",'Summary',"+ | ||
47 | "'Summary234-"+ QString::number(uid) + "')"); | ||
48 | res = driver->query( raw ); | ||
49 | delete raw; | ||
50 | |||
51 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | ||
52 | QString::number(uid)+",'HasDate',1)"); | ||
53 | res = driver->query( raw ); | ||
54 | delete raw; | ||
55 | |||
56 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | ||
57 | QString::number(uid)+",'DateDay',5)"); | ||
58 | res = driver->query( raw ); | ||
59 | delete raw; | ||
60 | |||
61 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | ||
62 | QString::number(uid)+",'DateMonth',8)"); | ||
63 | res = driver->query( raw ); | ||
64 | delete raw; | ||
65 | |||
66 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | ||
67 | QString::number(uid)+",'DateYear',2002)"); | ||
68 | res = driver->query( raw ); | ||
69 | delete raw; | ||
70 | |||
71 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | ||
72 | QString::number(uid)+",'Priority',1)"); | ||
73 | res = driver->query( raw ); | ||
74 | delete raw; | ||
75 | |||
76 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | ||
77 | QString::number(uid)+",'Description','" + | ||
78 | QString::number(uid) + "Description\n12344')"); | ||
79 | res = driver->query( raw ); | ||
80 | delete raw; | ||
81 | } | ||
82 | OSQLRawQuery raw3("COMMIT"); | ||
83 | res = driver->query(&raw3 ); | ||
84 | }; | ||
diff --git a/libopie2/examples/opiedb/sqltest/zeilenweise.pro b/libopie2/examples/opiedb/sqltest/zeilenweise.pro new file mode 100644 index 0000000..e5cfcc7 --- a/dev/null +++ b/libopie2/examples/opiedb/sqltest/zeilenweise.pro | |||
@@ -0,0 +1,13 @@ | |||
1 | TEMPLATE= app | ||
2 | CONFIG = qt warn_on release | ||
3 | HEADERS = | ||
4 | SOURCES = zeilenweise.cpp | ||
5 | INCLUDEPATH += $(OPIEDIR)/include | ||
6 | DEPENDPATH+= $(OPIEDIR)/include | ||
7 | LIBS += -lqpe -lopiesql | ||
8 | TARGET = zeilenweise | ||
9 | |||
10 | |||
11 | |||
12 | |||
13 | include ( $(OPIEDIR)/include.pro ) | ||