Ignore:
Timestamp:
01/18/10 16:13:01 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
f6300c7
Parents:
d23aa6a
Message:

added 'alarm' columnt to the 'EVENT' table to signalize
that the event has/hasn't alarm set

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sql/sqlengine.cpp

    rd23aa6a rb6cd05c  
    9191        // VIRTUAL_EVENT is for Full-Text-Serach Support
    9292        QDateTime startDateTime = QDateTime(QDate::fromString(aEvent["date"],DATE_FORMAT),QTime::fromString(aEvent["start"],TIME_FORMAT));
    93         QString values = QString("'%1', '%2', '%3', '%4', '%5', '%6', '%7', '%8'") \
     93        QString values = QString("'%1', '%2', '%3', '%4', '%5', '%6', '%7', '%8', '%9'") \
    9494                         .arg(aEvent["conference_id"]) \
    9595                         .arg(aEvent["id"]) \
     
    9999                         .arg(aEvent["type"]) \
    100100                         .arg(aEvent["language"]) \
    101                          .arg("0"); // not favourite when added
    102 
    103         QString query = QString("INSERT INTO EVENT (xid_conference, id, start, duration, xid_activity, type, language, favourite) VALUES (%1)").arg(values);
     101                         .arg("0") \
     102                         .arg("0");
     103
     104        QString query = QString("INSERT INTO EVENT (xid_conference, id, start, duration, xid_activity, type, language, favourite, alarm) VALUES (%1)").arg(values);
    104105        QSqlQuery result (query, db);
    105106        //LOG_AUTOTEST(query);
     
    120121        result2.bindValue(3,aEvent["description"]);
    121122        result2.exec();
    122 
    123          //LOG_AUTOTEST(query2);
    124         qDebug() << query2;
     123        //LOG_AUTOTEST(query2);
    125124    }
    126125}
     
    235234            language VARCHAR, \
    236235            favourite INTEGER DEFAULT 0, \
     236            alarm INTEGER DEFAULT 0, \
    237237            PRIMARY KEY (xid_conference,id), \
    238238            FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id) \
    239239            FOREIGN KEY(xid_activity) REFERENCES ACTIVITY(id))");
    240240
    241         // TBD Virtual tables compatibility (waiting for Marek). Temporary non virtual VIRTUAL_TABLE below: To be deleted
    242 /*        query.exec("CREATE VIRTUAL TABLE VIRTUAL_EVENT using fts3 ( \
    243             xid_conference INTEGER  NOT NULL, \
    244             id INTEGER NOT NULL , \
    245             tag VARCHAR,title VARCHAR NOT NULL , \
    246             subtitle VARCHAR, \
    247             abstract VARCHAR, \
    248             description VARCHAR, \
    249             PRIMARY KEY (xid_conference,id))");
    250 */
     241#ifdef MAEMO
     242        // TBD: MAEMO Virtual tables compatibility (waiting for Marek).
     243        // MAEMO sqlite Qt driver doesn't provide FTS support by default - use the following HACK
    251244        query.exec("CREATE TABLE VIRTUAL_EVENT ( \
    252245            xid_conference INTEGER  NOT NULL, \
     
    257250            description VARCHAR, \
    258251            PRIMARY KEY (xid_conference,id))");
     252#else
     253        query.exec("CREATE VIRTUAL TABLE VIRTUAL_EVENT using fts3 ( \
     254            xid_conference INTEGER  NOT NULL, \
     255            id INTEGER NOT NULL , \
     256            tag VARCHAR,title VARCHAR NOT NULL , \
     257            subtitle VARCHAR, \
     258            abstract VARCHAR, \
     259            description VARCHAR, \
     260            PRIMARY KEY (xid_conference,id))");
     261#endif
    259262
    260263        query.exec("CREATE TABLE EVENT_PERSON ( \
Note: See TracChangeset for help on using the changeset viewer.