From: pavelpa Date: Mon, 1 Feb 2010 09:54:29 +0000 (+0000) Subject: created resource which contains parsed schedule, X-Git-Tag: 0.5.0~136 X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/commitdiff_plain/979e5be8d3926257e0cfb0c8e62402d20151679e created resource which contains parsed schedule, so the user doesn't have to parse it by himself --- diff --git a/src/app/app.pro b/src/app/app.pro index 10ef88b..675cfd6 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -22,7 +22,8 @@ SOURCES += main.cpp \ appsettings.cpp RESOURCES += ../icons.qrc \ - ../maps.qrc + ../maps.qrc \ + ../db.qrc # instalation related diff --git a/src/app/main.cpp b/src/app/main.cpp index 22445b2..fb8042e 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -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 index 0000000..37282e0 --- /dev/null +++ b/src/db.qrc @@ -0,0 +1,6 @@ + + + fosdem.sqlite + + + diff --git a/src/fosdem.sqlite b/src/fosdem.sqlite new file mode 100644 index 0000000..97d6ada Binary files /dev/null and b/src/fosdem.sqlite differ diff --git a/src/sql/sqlengine.cpp b/src/sql/sqlengine.cpp index 07f6024..cb07f81 100644 --- a/src/sql/sqlengine.cpp +++ b/src/sql/sqlengine.cpp @@ -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 {