created resource which contains parsed schedule,
authorpavelpa <pavelpa@localhost>
Mon, 1 Feb 2010 09:54:29 +0000 (09:54 +0000)
committerpavelpa <pavelpa@localhost>
Mon, 1 Feb 2010 09:54:29 +0000 (09:54 +0000)
so the user doesn't have to parse it by himself

src/app/app.pro
src/app/main.cpp
src/db.qrc [new file with mode: 0644]
src/fosdem.sqlite [new file with mode: 0644]
src/sql/sqlengine.cpp

index 10ef88b23283639c486ca70979b1b4d5dd648c57..675cfd6b476d76140c85f67615673470d8b1510f 100644 (file)
@@ -22,7 +22,8 @@ SOURCES += main.cpp \
            appsettings.cpp
 
 RESOURCES += ../icons.qrc \
-             ../maps.qrc
+             ../maps.qrc \
+             ../db.qrc
 
 # instalation related
 
index 22445b2ef4ff0ed80140fc0367a3faefe7415f2c..fb8042e3256320e06d3fd84a194a074d937d90d9 100644 (file)
@@ -11,6 +11,7 @@ int main(int argc, char *argv[])
 {
     Q_INIT_RESOURCE(icons);
     Q_INIT_RESOURCE(maps);
+    Q_INIT_RESOURCE(db);
 
     QApplication a(argc, argv);
     QApplication::setWindowIcon(QIcon(":/icons/fosdem.png"));
diff --git a/src/db.qrc b/src/db.qrc
new file mode 100644 (file)
index 0000000..37282e0
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+    <file>fosdem.sqlite</file>
+</qresource>
+</RCC>
+
diff --git a/src/fosdem.sqlite b/src/fosdem.sqlite
new file mode 100644 (file)
index 0000000..97d6ada
Binary files /dev/null and b/src/fosdem.sqlite differ
index 07f60241363cbb040ace5a97861ac912a0bca44b..cb07f81b774c4e1ca2bb2090adb72744dcbc19ea 100644 (file)
@@ -32,12 +32,19 @@ QString SqlEngine::login(const QString &aDatabaseType, const QString &aDatabaseN
     bool result = false;
     if(!QFile::exists(aDatabaseName)) // the DB (tables) doesn't exists, and so we have to create one
     {
+        /*
         // creating empty DB + tables
         // ??? what is the best way of creating new empty DB ???
         // we can either:
         //  - create new DB + tables by issuing corresponding queries (used solution)
         //  - create new DB from resource, which contains empty DB with tables
         result = createTables(database);
+        */
+
+        // copy conference Db from resource, instead of creating
+        // empty tables and then parsing the schedule
+        QFile(":/fosdem.sqlite").copy(aDatabaseName);
+        database.open();
     }
     else
     {