so the user doesn't have to parse it by himself
appsettings.cpp
RESOURCES += ../icons.qrc \
appsettings.cpp
RESOURCES += ../icons.qrc \
+ ../maps.qrc \
+ ../db.qrc
{
Q_INIT_RESOURCE(icons);
Q_INIT_RESOURCE(maps);
{
Q_INIT_RESOURCE(icons);
Q_INIT_RESOURCE(maps);
QApplication a(argc, argv);
QApplication::setWindowIcon(QIcon(":/icons/fosdem.png"));
QApplication a(argc, argv);
QApplication::setWindowIcon(QIcon(":/icons/fosdem.png"));
--- /dev/null
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>fosdem.sqlite</file>
+</qresource>
+</RCC>
+
bool result = false;
if(!QFile::exists(aDatabaseName)) // the DB (tables) doesn't exists, and so we have to create one
{
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);
// 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();