return result;
}
+bool DatabaseUtility::getDefaultProfile(org::maemo::vicar::Profile *profile){
+ bool result = false;
+ if (profilesDB.isOpen()){
+ QString strQuery = QString("select * from profiles where numberpattern = '%' order by id");
+ qDebug() << "SQL>"<<strQuery;
+ QSqlQuery query(strQuery);
+ if (query.next()){
+ profile->profileID = query.value(0).toInt();
+ profile->phoneNumberPattern = query.value(1).toString();
+ profile->gatewayNumber = query.value(2).toString();
+ profile->dtmfFormat = query.value(3).toString();
+ profile->dtmfPrefix = query.value(4).toString();
+ profile->dtmfSuffix = query.value(5).toString();
+ result = true;
+ }
+ }
+ return result;
+}
+
int DatabaseUtility::insertProfile(org::maemo::vicar::Profile profile){
int newId = -1;
bool result = false;
bool result = false;
if (profilesDB.isOpen()){
QSqlQuery query;
- result = query.exec(QString("delete from profiles where id=%1").arg(id));
+ QString strQuery = QString("delete from profiles where id=%1").arg(id);
+ qDebug() << "SQL>"<<strQuery;
+ result = query.exec(strQuery);
}
return result;
}