Fix 'format not a string literal' error

Thanks to Francois Andriot
pull/1/head
Slávek Banko 12 years ago
parent e209c95794
commit 104a85980f

@ -187,7 +187,7 @@ public:
TQDataBase db = TQSqlDatabase::addDatabase(SQLTYPE,_key); TQDataBase db = TQSqlDatabase::addDatabase(SQLTYPE,_key);
db->setDatabaseName(m_BasePath+"/maindb.db"); db->setDatabaseName(m_BasePath+"/maindb.db");
if (!db->open()) { if (!db->open()) {
tqWarning(TQString("Failed to open main database: " + db->lastError().text()).ascii()); tqWarning("%s", TQString("Failed to open main database: " + db->lastError().text()).ascii());
} else { } else {
m_mainDB.setLocalData(new ThreadDBStore); m_mainDB.setLocalData(new ThreadDBStore);
m_mainDB.localData()->key = _key; m_mainDB.localData()->key = _key;
@ -269,12 +269,12 @@ void LogCache::setupMainDb()
#endif #endif
TQDataBase mainDB = m_CacheData->getMainDB(); TQDataBase mainDB = m_CacheData->getMainDB();
if (!mainDB || !mainDB->open()) { if (!mainDB || !mainDB->open()) {
tqWarning(TQString("Failed to open main database: " + (mainDB?mainDB->lastError().text():"No database object.")).ascii()); tqWarning("%s", TQString("Failed to open main database: " + (mainDB?mainDB->lastError().text():"No database object.")).ascii());
} else { } else {
TQSqlQuery q(TQString(), mainDB); TQSqlQuery q(TQString(), mainDB);
mainDB->transaction(); mainDB->transaction();
if (!q.exec("CREATE TABLE IF NOT EXISTS \""+TQString(SQLMAINTABLE)+"\" (\"reposroot\" TEXT,\"id\" INTEGER PRIMARY KEY NOT NULL);")) { if (!q.exec("CREATE TABLE IF NOT EXISTS \""+TQString(SQLMAINTABLE)+"\" (\"reposroot\" TEXT,\"id\" INTEGER PRIMARY KEY NOT NULL);")) {
tqWarning(TQString("Failed create main database: " + mainDB->lastError().text()).ascii()); tqWarning("%s", TQString("Failed create main database: " + mainDB->lastError().text()).ascii());
} }
mainDB->commit(); mainDB->commit();
} }
@ -321,7 +321,7 @@ TQStringList svn::cache::LogCache::cachedRepositories()const
TQSqlQuery cur(TQString(),mainDB); TQSqlQuery cur(TQString(),mainDB);
cur.prepare(s_q); cur.prepare(s_q);
if (!cur.exec()) { if (!cur.exec()) {
tqDebug(cur.lastError().text().TOUTF8().data()); tqDebug("%s", TQString(cur.lastError().text().TOUTF8().data()).ascii());
throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+cur.lastError().text()); throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+cur.lastError().text());
return _res; return _res;
} }

@ -68,7 +68,7 @@ svn::Revision svn::cache::ReposLog::latestCachedRev()
TQString q("select revision from 'logentries' order by revision DESC limit 1"); TQString q("select revision from 'logentries' order by revision DESC limit 1");
TQSqlQuery _q(TQString(), m_Database); TQSqlQuery _q(TQString(), m_Database);
if (!_q.exec(q)) { if (!_q.exec(q)) {
tqDebug(_q.lastError().text().TOUTF8().data()); tqDebug("%s", TQString(_q.lastError().text().TOUTF8().data()).ascii());
return svn::Revision::UNDEFINED; return svn::Revision::UNDEFINED;
} }
int _r; int _r;
@ -76,7 +76,7 @@ svn::Revision svn::cache::ReposLog::latestCachedRev()
//tqDebug("Sel result: %s",_q.value(0).toString().TOUTF8().data()); //tqDebug("Sel result: %s",_q.value(0).toString().TOUTF8().data());
_r = _q.value(0).toInt(); _r = _q.value(0).toInt();
} else { } else {
tqDebug(_q.lastError().text().TOUTF8().data()); tqDebug("%s", TQString(_q.lastError().text().TOUTF8().data()).ascii());
return svn::Revision::UNDEFINED; return svn::Revision::UNDEFINED;
} }
return _r; return _r;
@ -197,7 +197,7 @@ bool svn::cache::ReposLog::simpleLog(LogEntriesMap&target,const svn::Revision&_s
bcount.bindValue(0,TQ_LLONG(end.revnum())); bcount.bindValue(0,TQ_LLONG(end.revnum()));
bcount.bindValue(1,TQ_LLONG(start.revnum())); bcount.bindValue(1,TQ_LLONG(start.revnum()));
if (!bcount.exec()) { if (!bcount.exec()) {
tqDebug(bcount.lastError().text().TOUTF8().data()); tqDebug("%s", TQString(bcount.lastError().text().TOUTF8().data()).ascii());
throw svn::cache::DatabaseException(TQString("Could not retrieve count: ")+bcount.lastError().text()); throw svn::cache::DatabaseException(TQString("Could not retrieve count: ")+bcount.lastError().text());
return false; return false;
} }
@ -211,7 +211,7 @@ bool svn::cache::ReposLog::simpleLog(LogEntriesMap&target,const svn::Revision&_s
bcur.bindValue(1,TQ_LLONG(start.revnum())); bcur.bindValue(1,TQ_LLONG(start.revnum()));
if (!bcur.exec()) { if (!bcur.exec()) {
tqDebug(bcur.lastError().text().TOUTF8().data()); tqDebug("%s", TQString(bcur.lastError().text().TOUTF8().data()).ascii());
throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+bcur.lastError().text()); throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+bcur.lastError().text());
return false; return false;
} }
@ -220,7 +220,7 @@ bool svn::cache::ReposLog::simpleLog(LogEntriesMap&target,const svn::Revision&_s
revision = bcur.value(0).toLongLong(); revision = bcur.value(0).toLongLong();
cur.bindValue(0,revision); cur.bindValue(0,revision);
if (!cur.exec()) { if (!cur.exec()) {
tqDebug(cur.lastError().text().TOUTF8().data()); tqDebug("%s", TQString(cur.lastError().text().TOUTF8().data()).ascii());
throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+cur.lastError().text() throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+cur.lastError().text()
,cur.lastError().number()); ,cur.lastError().number());
return false; return false;
@ -264,7 +264,7 @@ svn::Revision svn::cache::ReposLog::date2numberRev(const svn::Revision&aRev,bool
TQSqlQuery query("select revision,date from logentries order by revision desc limit 1",m_Database); TQSqlQuery query("select revision,date from logentries order by revision desc limit 1",m_Database);
if (query.lastError().type()!=TQSqlError::None) { if (query.lastError().type()!=TQSqlError::None) {
tqDebug(query.lastError().text().TOUTF8().data()); tqDebug("%s", TQString(query.lastError().text().TOUTF8().data()).ascii());
} }
bool must_remote=!noNetwork; bool must_remote=!noNetwork;
if (query.next()) { if (query.next()) {
@ -283,7 +283,7 @@ svn::Revision svn::cache::ReposLog::date2numberRev(const svn::Revision&aRev,bool
query.bindValue(0,TQ_LLONG(aRev.date())); query.bindValue(0,TQ_LLONG(aRev.date()));
query.exec(); query.exec();
if (query.lastError().type()!=TQSqlError::None) { if (query.lastError().type()!=TQSqlError::None) {
tqDebug(query.lastError().text().TOUTF8().data()); tqDebug("%s", TQString(query.lastError().text().TOUTF8().data()).ascii());
} }
if (query.next()) { if (query.next()) {
return query.value(0).toInt(); return query.value(0).toInt();
@ -320,7 +320,7 @@ bool svn::cache::ReposLog::_insertLogEntry(const svn::LogEntry&aEntry)
if (!_q.exec()) { if (!_q.exec()) {
m_Database->rollback(); m_Database->rollback();
tqDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data()); tqDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data());
tqDebug(_q.lastQuery().TOUTF8().data()); tqDebug("%s", TQString(_q.lastQuery().TOUTF8().data()).ascii());
throw svn::cache::DatabaseException(TQString("Could not insert values: ")+_q.lastError().text(),_q.lastError().number()); throw svn::cache::DatabaseException(TQString("Could not insert values: ")+_q.lastError().text(),_q.lastError().number());
} }
_q.prepare(qPathes); _q.prepare(qPathes);
@ -334,7 +334,7 @@ bool svn::cache::ReposLog::_insertLogEntry(const svn::LogEntry&aEntry)
if (!_q.exec()) { if (!_q.exec()) {
m_Database->rollback(); m_Database->rollback();
tqDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data()); tqDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data());
tqDebug(_q.lastQuery().TOUTF8().data()); tqDebug("%s", TQString(_q.lastQuery().TOUTF8().data()).ascii());
throw svn::cache::DatabaseException(TQString("Could not insert values: ")+_q.lastError().text(),_q.lastError().number()); throw svn::cache::DatabaseException(TQString("Could not insert values: ")+_q.lastError().text(),_q.lastError().number());
} }
} }
@ -375,7 +375,7 @@ bool svn::cache::ReposLog::log(const svn::Path&what,const svn::Revision&_start,
_q.prepare(query_string); _q.prepare(query_string);
if (!_q.exec()) { if (!_q.exec()) {
tqDebug("Could not select values: %s",_q.lastError().text().TOUTF8().data()); tqDebug("Could not select values: %s",_q.lastError().text().TOUTF8().data());
tqDebug(_q.lastQuery().TOUTF8().data()); tqDebug("%s", TQString(_q.lastQuery().TOUTF8().data()).ascii());
throw svn::cache::DatabaseException(TQString("Could not select values: ")+_q.lastError().text(),_q.lastError().number()); throw svn::cache::DatabaseException(TQString("Could not select values: ")+_q.lastError().text(),_q.lastError().number());
} }
while(_q.next()) { while(_q.next()) {

Loading…
Cancel
Save