From 47c8a359c5276062c4bc17f0e82410f29081b502 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:48:06 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/plugins/statistics/statisticsdb.cpp | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'kopete/plugins/statistics/statisticsdb.cpp') diff --git a/kopete/plugins/statistics/statisticsdb.cpp b/kopete/plugins/statistics/statisticsdb.cpp index 450c4371..c0a41232 100644 --- a/kopete/plugins/statistics/statisticsdb.cpp +++ b/kopete/plugins/statistics/statisticsdb.cpp @@ -14,7 +14,7 @@ ************************************************************************* */ -#include +#include #include "sqlite/sqlite3.h" @@ -33,15 +33,15 @@ StatisticsDB::StatisticsDB() { - QCString path = (::locateLocal("appdata", "kopete_statistics-0.1.db")).latin1(); + TQCString path = (::locateLocal("appdata", "kopete_statistics-0.1.db")).latin1(); kdDebug() << "statistics: DB path:" << path << endl; // Open database file and check for correctness bool failOpen = true; - QFile file( path ); + TQFile file( path ); if ( file.open( IO_ReadOnly ) ) { - QString format; + TQString format; file.readLine( format, 50 ); if ( !format.startsWith( "SQLite format 3" ) ) { @@ -59,18 +59,18 @@ StatisticsDB::StatisticsDB() if ( failOpen ) { // Remove old db file; create new - QFile::remove( path ); + TQFile::remove( path ); sqlite3_open( path, &m_db ); } kdDebug() << "[Statistics] Contructor"<< endl; // Creates the tables if they do not exist. - QStringList result = query("SELECT name FROM sqlite_master WHERE type='table'"); + TQStringList result = query("SELECT name FROM sqlite_master WHERE type='table'"); if (!result.contains("contacts")) { - query(QString("CREATE TABLE contacts " + query(TQString("CREATE TABLE contacts " "(id INTEGER PRIMARY KEY," "statisticid TEXT," "contactid TEXT" @@ -80,7 +80,7 @@ StatisticsDB::StatisticsDB() if (!result.contains("contactstatus")) { kdDebug() << "[Statistics] Database empty"<< endl; - query(QString("CREATE TABLE contactstatus " + query(TQString("CREATE TABLE contactstatus " "(id INTEGER PRIMARY KEY," "metacontactid TEXT," "status TEXT," @@ -92,7 +92,7 @@ StatisticsDB::StatisticsDB() if (!result.contains("commonstats")) { // To store things like the contact answer time etc. - query(QString("CREATE TABLE commonstats" + query(TQString("CREATE TABLE commonstats" " (id INTEGER PRIMARY KEY," "metacontactid TEXT," "statname TEXT," // for instance, answertime, lastmessage, messagelength ... @@ -104,7 +104,7 @@ StatisticsDB::StatisticsDB() /// @fixme This is not used anywhere if (!result.contains("statsgroup")) { - query(QString("CREATE TABLE statsgroup" + query(TQString("CREATE TABLE statsgroup" "(id INTEGER PRIMARY KEY," "datetimebegin INTEGER," "datetimeend INTEGER," @@ -123,9 +123,9 @@ StatisticsDB::~StatisticsDB() * @param statement SQL program to execute. Only one SQL statement is allowed. * @param debug Set to true for verbose debug output. * @retval names Will contain all column names, set to NULL if not used. - * @return The queried data, or QStringList() on error. + * @return The queried data, or TQStringList() on error. */ - QStringList StatisticsDB::query( const QString& statement, QStringList* const names, bool debug ) + TQStringList StatisticsDB::query( const TQString& statement, TQStringList* const names, bool debug ) { if ( debug ) @@ -136,11 +136,11 @@ StatisticsDB::~StatisticsDB() if ( !m_db ) { kdError() << k_funcinfo << "[CollectionDB] SQLite pointer == NULL.\n"; - return QStringList(); + return TQStringList(); } int error; - QStringList values; + TQStringList values; const char* tail; sqlite3_stmt* stmt; @@ -153,7 +153,7 @@ StatisticsDB::~StatisticsDB() kdError() << sqlite3_errmsg( m_db ) << endl; kdError() << "on query: " << statement << endl; - return QStringList(); + return TQStringList(); } int busyCnt = 0; @@ -180,8 +180,8 @@ StatisticsDB::~StatisticsDB() //iterate over columns for ( int i = 0; i < number; i++ ) { - values << QString::fromUtf8( (const char*) sqlite3_column_text( stmt, i ) ); - if ( names ) *names << QString( sqlite3_column_name( stmt, i ) ); + values << TQString::fromUtf8( (const char*) sqlite3_column_text( stmt, i ) ); + if ( names ) *names << TQString( sqlite3_column_name( stmt, i ) ); } } //deallocate vm ressources @@ -193,7 +193,7 @@ StatisticsDB::~StatisticsDB() kdError() << sqlite3_errmsg( m_db ) << endl; kdError() << "on query: " << statement << endl; - return QStringList(); + return TQStringList(); } if ( debug ) -- cgit v1.2.1