2 Copyright (C) 2011 by Cuong Le <metacuong@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>
18 #include <QtSql/QSqlDatabase>
19 #include <QtSql/QSqlQuery>
20 #include <QtSql/QSqlRecord>
29 db = QSqlDatabase::addDatabase("QSQLITE");
30 #if defined(Q_WS_MAEMO_5)
31 db.setDatabaseName("/opt/vietkaralist/db/vietkaralist.sqlite");
33 db.setDatabaseName("/home/cuonglb/vietkaralist.sqlite");
38 DBThread::~DBThread(){
44 QSqlQuery query(this->mm_query);
45 QSqlRecord record = query.record();
47 if (record.count() > 0) {
48 emit removeOldSongs();
49 while (query.next()) {
50 emit addSong(query.value(0).toString(),query.value(1).toString(), query.value(4).toString(), query.value(5).toString());
58 void DBThread::slotExecQuery(const QString& m_query){
59 this->mm_query = m_query;