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/statisticscontact.cpp | 128 +++++++++--------- kopete/plugins/statistics/statisticscontact.h | 40 +++--- kopete/plugins/statistics/statisticsdb.cpp | 36 +++--- kopete/plugins/statistics/statisticsdb.h | 4 +- kopete/plugins/statistics/statisticsdcopiface.h | 20 +-- kopete/plugins/statistics/statisticsdialog.cpp | 164 ++++++++++++------------ kopete/plugins/statistics/statisticsdialog.h | 12 +- kopete/plugins/statistics/statisticsplugin.cpp | 98 +++++++------- kopete/plugins/statistics/statisticsplugin.h | 36 +++--- 9 files changed, 269 insertions(+), 269 deletions(-) (limited to 'kopete/plugins/statistics') diff --git a/kopete/plugins/statistics/statisticscontact.cpp b/kopete/plugins/statistics/statisticscontact.cpp index e9068fe5..821b8f59 100644 --- a/kopete/plugins/statistics/statisticscontact.cpp +++ b/kopete/plugins/statistics/statisticscontact.cpp @@ -16,8 +16,8 @@ #include -#include -#include +#include +#include #include #include @@ -31,7 +31,7 @@ StatisticsContact::StatisticsContact(Kopete::MetaContact *mc, StatisticsDB *db) : m_metaContact(mc),m_db(db), m_oldStatus(Kopete::OnlineStatus::Unknown) { m_isChatWindowOpen = false; - m_oldStatusDateTime = QDateTime::currentDateTime(); + m_oldStatusDateTime = TQDateTime::currentDateTime(); // Last*Changed are always false at start m_timeBetweenTwoMessagesChanged = false; @@ -48,9 +48,9 @@ StatisticsContact::~StatisticsContact() if (m_statisticsContactId.isEmpty()) return; - commonStatsSave("timebetweentwomessages",QString::number(m_timeBetweenTwoMessages), - QString::number(m_timeBetweenTwoMessagesOn), m_timeBetweenTwoMessagesChanged); - commonStatsSave("messagelength",QString::number(m_messageLength), QString::number(m_messageLengthOn), m_messageLengthChanged); + commonStatsSave("timebetweentwomessages",TQString::number(m_timeBetweenTwoMessages), + TQString::number(m_timeBetweenTwoMessagesOn), m_timeBetweenTwoMessagesChanged); + commonStatsSave("messagelength",TQString::number(m_messageLength), TQString::number(m_messageLengthOn), m_messageLengthChanged); commonStatsSave("lasttalk", m_lastTalk.toString(), "", m_lastTalkChanged); commonStatsSave("lastpresent", m_lastPresent.toString(), "", m_lastPresentChanged); } @@ -58,7 +58,7 @@ StatisticsContact::~StatisticsContact() void StatisticsContact::initialize(Kopete::Contact *c) { // Generate statisticsContactId or get it from database - QStringList buffer = m_db->query(QString("SELECT statisticid FROM contacts " + TQStringList buffer = m_db->query(TQString("SELECT statisticid FROM contacts " "WHERE contactid LIKE '%1';" ).arg(c->contactId())); @@ -66,7 +66,7 @@ void StatisticsContact::initialize(Kopete::Contact *c) { // Check if we don't have old data if ( !c->metaContact()->metaContactId().isEmpty() && - !m_db->query(QString("SELECT metacontactid FROM commonstats " + !m_db->query(TQString("SELECT metacontactid FROM commonstats " "WHERE metacontactid LIKE '%1';" ).arg(c->metaContact()->metaContactId())).isEmpty()) { @@ -80,7 +80,7 @@ void StatisticsContact::initialize(Kopete::Contact *c) } // Assign contactId to m_statisticsContactId - m_db->query(QString("INSERT INTO contacts (statisticid, contactid) VALUES('%1', '%2');" + m_db->query(TQString("INSERT INTO contacts (statisticid, contactid) VALUES('%1', '%2');" ).arg(m_statisticsContactId).arg(c->contactId())); } else @@ -94,8 +94,8 @@ void StatisticsContact::initialize(Kopete::Contact *c) commonStatsCheck("messagelength", m_messageLength, m_messageLengthOn, 0, 0); // Check for last talk - QString lastTalk; - QString dummy = ""; + TQString lastTalk; + TQString dummy = ""; commonStatsCheck("lasttalk", lastTalk, dummy); if (lastTalk.isEmpty()) { @@ -103,15 +103,15 @@ void StatisticsContact::initialize(Kopete::Contact *c) m_lastTalkChanged = true; } else - m_lastTalk = QDateTime::fromString(lastTalk); + m_lastTalk = TQDateTime::fromString(lastTalk); // Get last time a message was received - m_lastMessageReceived = QDateTime::currentDateTime(); + m_lastMessageReceived = TQDateTime::currentDateTime(); // Check for lastPresent - QString lastPresent = ""; + TQString lastPresent = ""; commonStatsCheck("lastpresent", lastPresent, dummy); if (lastPresent.isEmpty()) { @@ -119,7 +119,7 @@ void StatisticsContact::initialize(Kopete::Contact *c) m_lastPresentChanged = true; } else - m_lastPresent = QDateTime::fromString(lastPresent); + m_lastPresent = TQDateTime::fromString(lastPresent); } void StatisticsContact::contactAdded( Kopete::Contact *c ) @@ -127,12 +127,12 @@ void StatisticsContact::contactAdded( Kopete::Contact *c ) if ( !m_statisticsContactId.isEmpty() ) { // Check if contact is allready in database if not add it - if (m_db->query(QString("SELECT id FROM contacts " + if (m_db->query(TQString("SELECT id FROM contacts " "WHERE statisticid LIKE '%1' AND contactid LIKE '%2';" ).arg(m_statisticsContactId).arg(c->contactId())).isEmpty()) { // Assign contactId to m_statisticsContactId - m_db->query(QString("INSERT INTO contacts (statisticid, contactid) VALUES('%1', '%2');" + m_db->query(TQString("INSERT INTO contacts (statisticid, contactid) VALUES('%1', '%2');" ).arg(m_statisticsContactId).arg(c->contactId())); } kdDebug() << k_funcinfo << " m_statisticsContactId: " << m_statisticsContactId << endl; @@ -150,7 +150,7 @@ void StatisticsContact::contactRemoved( Kopete::Contact *c ) return; kdDebug() << k_funcinfo << " m_statisticsContactId: " << m_statisticsContactId << endl; - m_db->query(QString("DELETE FROM contacts WHERE statisticid LIKE '%1' AND contactid LIKE '%2';" + m_db->query(TQString("DELETE FROM contacts WHERE statisticid LIKE '%1' AND contactid LIKE '%2';" ).arg(m_statisticsContactId).arg(c->contactId())); } @@ -160,14 +160,14 @@ void StatisticsContact::removeFromDB() return; kdDebug() << k_funcinfo << " m_statisticsContactId: " << m_statisticsContactId << endl; - m_db->query(QString("DELETE FROM contacts WHERE statisticid LIKE '%1';").arg(m_statisticsContactId)); - m_db->query(QString("DELETE FROM contactstatus WHERE metacontactid LIKE '%1';").arg(m_statisticsContactId)); - m_db->query(QString("DELETE FROM commonstats WHERE metacontactid LIKE '%1';").arg(m_statisticsContactId)); + m_db->query(TQString("DELETE FROM contacts WHERE statisticid LIKE '%1';").arg(m_statisticsContactId)); + m_db->query(TQString("DELETE FROM contactstatus WHERE metacontactid LIKE '%1';").arg(m_statisticsContactId)); + m_db->query(TQString("DELETE FROM commonstats WHERE metacontactid LIKE '%1';").arg(m_statisticsContactId)); - m_statisticsContactId = QString::null; + m_statisticsContactId = TQString::null; } -void StatisticsContact::commonStatsSave(const QString name, const QString statVar1, const QString statVar2, const bool statVarChanged) +void StatisticsContact::commonStatsSave(const TQString name, const TQString statVar1, const TQString statVar2, const bool statVarChanged) { // Only update the database if there was a change if (!statVarChanged) return; @@ -175,28 +175,28 @@ void StatisticsContact::commonStatsSave(const QString name, const QString statVa if (m_statisticsContactId.isEmpty()) return; - m_db->query(QString("UPDATE commonstats SET statvalue1 = '%1', statvalue2='%2'" + m_db->query(TQString("UPDATE commonstats SET statvalue1 = '%1', statvalue2='%2'" "WHERE statname LIKE '%3' AND metacontactid LIKE '%4';").arg(statVar1).arg(statVar2).arg(name).arg(m_statisticsContactId)); } -void StatisticsContact::commonStatsCheck(const QString name, int& statVar1, int& statVar2, const int defaultValue1, const int defaultValue2) +void StatisticsContact::commonStatsCheck(const TQString name, int& statVar1, int& statVar2, const int defaultValue1, const int defaultValue2) { - QString a = QString::number(statVar1); - QString b = QString::number(statVar2); + TQString a = TQString::number(statVar1); + TQString b = TQString::number(statVar2); - commonStatsCheck(name, a, b, QString::number(defaultValue1), QString::number(defaultValue2)); + commonStatsCheck(name, a, b, TQString::number(defaultValue1), TQString::number(defaultValue2)); statVar1 = a.toInt(); statVar2 = b.toInt(); } -void StatisticsContact::commonStatsCheck(const QString name, QString& statVar1, QString& statVar2, const QString defaultValue1, const QString defaultValue2) +void StatisticsContact::commonStatsCheck(const TQString name, TQString& statVar1, TQString& statVar2, const TQString defaultValue1, const TQString defaultValue2) { if (m_statisticsContactId.isEmpty()) return; - QStringList buffer = m_db->query(QString("SELECT statvalue1,statvalue2 FROM commonstats WHERE statname LIKE '%1' AND metacontactid LIKE '%2';").arg(name, m_statisticsContactId)); + TQStringList buffer = m_db->query(TQString("SELECT statvalue1,statvalue2 FROM commonstats WHERE statname LIKE '%1' AND metacontactid LIKE '%2';").arg(name, m_statisticsContactId)); if (!buffer.isEmpty()) { statVar1 = buffer[0]; @@ -204,7 +204,7 @@ void StatisticsContact::commonStatsCheck(const QString name, QString& statVar1, } else { - m_db->query(QString("INSERT INTO commonstats (metacontactid, statname, statvalue1, statvalue2) VALUES('%1', '%2', 0, 0);").arg(m_statisticsContactId, name)); + m_db->query(TQString("INSERT INTO commonstats (metacontactid, statname, statvalue1, statvalue2) VALUES('%1', '%2', 0, 0);").arg(m_statisticsContactId, name)); statVar1 = defaultValue1; statVar2 = defaultValue2; } @@ -234,7 +234,7 @@ void StatisticsContact::commonStatsCheck(const QString name, QString& statVar1, void StatisticsContact::newMessageReceived(Kopete::Message& m) { kdDebug() << "statistics: new message received" << endl; - QDateTime currentDateTime = QDateTime::currentDateTime(); + TQDateTime currentDateTime = TQDateTime::currentDateTime(); if (m_timeBetweenTwoMessagesOn != -1 && m_isChatWindowOpen) { @@ -269,17 +269,17 @@ void StatisticsContact::onlineStatusChanged(Kopete::OnlineStatus::StatusType sta if (m_statisticsContactId.isEmpty()) return; - QDateTime currentDateTime = QDateTime::currentDateTime(); + TQDateTime currentDateTime = TQDateTime::currentDateTime(); /// We don't want to log if oldStatus is unknown /// the change could not be a real one; see StatisticsPlugin::slotMySelfOnlineStatusChanged if (m_oldStatus != Kopete::OnlineStatus::Unknown) { - kdDebug() << "statistics - status change for "<< metaContact()->metaContactId() << " : "<< QString::number(m_oldStatus) << endl; - m_db->query(QString("INSERT INTO contactstatus " + kdDebug() << "statistics - status change for "<< metaContact()->metaContactId() << " : "<< TQString::number(m_oldStatus) << endl; + m_db->query(TQString("INSERT INTO contactstatus " "(metacontactid, status, datetimebegin, datetimeend) " - "VALUES('%1', '%2', '%3', '%4'" ");").arg(m_statisticsContactId).arg(Kopete::OnlineStatus::statusTypeToString(m_oldStatus)).arg(QString::number(m_oldStatusDateTime.toTime_t())).arg(QString::number(currentDateTime.toTime_t()))); + "VALUES('%1', '%2', '%3', '%4'" ");").arg(m_statisticsContactId).arg(Kopete::OnlineStatus::statusTypeToString(m_oldStatus)).arg(TQString::number(m_oldStatusDateTime.toTime_t())).arg(TQString::number(currentDateTime.toTime_t()))); } if (m_oldStatus == Kopete::OnlineStatus::Online || m_oldStatus == Kopete::OnlineStatus::Away) @@ -294,12 +294,12 @@ void StatisticsContact::onlineStatusChanged(Kopete::OnlineStatus::StatusType sta } -bool StatisticsContact::wasStatus(QDateTime dt, Kopete::OnlineStatus::StatusType status) +bool StatisticsContact::wasStatus(TQDateTime dt, Kopete::OnlineStatus::StatusType status) { if (m_statisticsContactId.isEmpty()) return false; - QStringList values = m_db->query(QString("SELECT status, datetimebegin, datetimeend " + TQStringList values = m_db->query(TQString("SELECT status, datetimebegin, datetimeend " "FROM contactstatus WHERE metacontactid LIKE '%1' AND datetimebegin <= %2 AND datetimeend >= %3 " "AND status LIKE '%4' " "ORDER BY datetimebegin;" @@ -310,12 +310,12 @@ bool StatisticsContact::wasStatus(QDateTime dt, Kopete::OnlineStatus::StatusType return false; } -QString StatisticsContact::statusAt(QDateTime dt) +TQString StatisticsContact::statusAt(TQDateTime dt) { if (m_statisticsContactId.isEmpty()) return ""; - QStringList values = m_db->query(QString("SELECT status, datetimebegin, datetimeend " + TQStringList values = m_db->query(TQString("SELECT status, datetimebegin, datetimeend " "FROM contactstatus WHERE metacontactid LIKE '%1' AND datetimebegin <= %2 AND datetimeend >= %3 " "ORDER BY datetimebegin;" ).arg(m_statisticsContactId).arg(dt.toTime_t()).arg(dt.toTime_t())); @@ -324,28 +324,28 @@ QString StatisticsContact::statusAt(QDateTime dt) else return ""; } -QString StatisticsContact::mainStatusDate(const QDate& date) +TQString StatisticsContact::mainStatusDate(const TQDate& date) { if (m_statisticsContactId.isEmpty()) return ""; - QDateTime dt1(date, QTime(0,0,0)); - QDateTime dt2(date.addDays(1), QTime(0,0,0)); + TQDateTime dt1(date, TQTime(0,0,0)); + TQDateTime dt2(date.addDays(1), TQTime(0,0,0)); kdDebug() << "dt1:" << dt1.toString() << " dt2:" << dt2.toString() << endl; - QString request = QString("SELECT status, datetimebegin, datetimeend, metacontactid " + TQString request = TQString("SELECT status, datetimebegin, datetimeend, metacontactid " "FROM contactstatus WHERE metacontactid = '%1' AND " "(datetimebegin >= %2 AND datetimebegin <= %3 OR " "datetimeend >= %4 AND datetimeend <= %5) " "ORDER BY datetimebegin;" ).arg(m_statisticsContactId).arg(dt1.toTime_t()).arg(dt2.toTime_t()).arg(dt1.toTime_t()).arg(dt2.toTime_t()); kdDebug() << request << endl; - QStringList values = m_db->query(request); + TQStringList values = m_db->query(request); unsigned int online = 0, offline = 0, away = 0; for(uint i=0; i= dt2.toTime_t()) datetimeend = dt2.toTime_t(); @@ -366,35 +366,35 @@ QString StatisticsContact::mainStatusDate(const QDate& date) return ""; } -// QDateTime StatisticsContact::nextOfflineEvent() +// TQDateTime StatisticsContact::nextOfflineEvent() // { // return nextEvent(Kopete::OnlineStatus::Offline); // } // -// QDateTime StatisticsContact::nextOnlineEvent() +// TQDateTime StatisticsContact::nextOnlineEvent() // { // return nextEvent(Kopete::OnlineStatus::Online); // } -// QDateTime StatisticsContact::nextEvent(const Kopete::OnlineStatus::StatusType& status) +// TQDateTime StatisticsContact::nextEvent(const Kopete::OnlineStatus::StatusType& status) // { // // } -QValueList StatisticsContact::mainEvents(const Kopete::OnlineStatus::StatusType& status) +TQValueList StatisticsContact::mainEvents(const Kopete::OnlineStatus::StatusType& status) { - QStringList buffer; - QValueList mainEvents; + TQStringList buffer; + TQValueList mainEvents; if (m_statisticsContactId.isEmpty()) return mainEvents; - QDateTime currentDateTime = QDateTime::currentDateTime(); - buffer = m_db->query(QString("SELECT datetimebegin, datetimeend, status FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin").arg(m_statisticsContactId)); + TQDateTime currentDateTime = TQDateTime::currentDateTime(); + buffer = m_db->query(TQString("SELECT datetimebegin, datetimeend, status FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin").arg(m_statisticsContactId)); // Only select the events for which the previous is not Unknown AND the status is status. - QStringList values; + TQStringList values; for (uint i=0; i StatisticsContact::mainEvents(const Kopete::OnlineStatus::Stat // First we compute the average number of events/day : avEventsPerDay; int avEventsPerDay = 0; - QDateTime dt1, dt2; + TQDateTime dt1, dt2; dt1.setTime_t(values[0].toInt()); dt2.setTime_t(values[values.count()-1].toInt()); @@ -417,19 +417,19 @@ QValueList StatisticsContact::mainEvents(const Kopete::OnlineStatus::Stat kdDebug() << "statistics: average events per day : " < hoursValues; + TQValueList hoursValues; for (uint i=0; i centroids; + TQValueList centroids; int incr=qRound((double)hoursValues.count()/(double)avEventsPerDay); incr = incr ? incr : 1; for (uint i=0; i StatisticsContact::mainEvents(const Kopete::OnlineStatus::Stat { kdDebug() << "statistics: new centroid : " << centroids[i] << endl; - QTime dt(0, 0, 0); + TQTime dt(0, 0, 0); dt = dt.addSecs(centroids[i]); mainEvents.push_back(dt); } @@ -456,12 +456,12 @@ QValueList StatisticsContact::mainEvents(const Kopete::OnlineStatus::Stat return mainEvents; } -QValueList StatisticsContact::computeCentroids(const QValueList& centroids, const QValueList& values) +TQValueList StatisticsContact::computeCentroids(const TQValueList& centroids, const TQValueList& values) { kdDebug() << "statistics: enter compute centroids"<< endl; - QValueList whichCentroid; // whichCentroid[i] = j <=> values[i] has centroid j for closest one - QValueList newCentroids; + TQValueList whichCentroid; // whichCentroid[i] = j <=> values[i] has centroid j for closest one + TQValueList newCentroids; for (uint i=0; i mainEvents(const Kopete::OnlineStatus::StatusType& status); + TQValueList mainEvents(const Kopete::OnlineStatus::StatusType& status); /// \brief used by mainEvents() - QValueList computeCentroids(const QValueList& centroids, const QValueList& values); + TQValueList computeCentroids(const TQValueList& centroids, const TQValueList& values); /** * \brief adds contact to "contacts" database and generates m_statisticsContactId if needed @@ -179,13 +179,13 @@ private: * \retval statvar1 * \retval statvar2 */ - void commonStatsCheck(const QString name, QString& statVar1, QString& statVar2, const QString defaultValue1 = "", const QString defaultValue2 = ""); + void commonStatsCheck(const TQString name, TQString& statVar1, TQString& statVar2, const TQString defaultValue1 = "", const TQString defaultValue2 = ""); /** * @brief Same as commonStatsCheck for integers. * Provided for convenience */ - void commonStatsCheck(const QString name, int& statVar1, int& statVar2, const int defaultValue1 = 0, const int defaultValue2 = -1); + void commonStatsCheck(const TQString name, int& statVar1, int& statVar2, const int defaultValue1 = 0, const int defaultValue2 = -1); /** * @brief Save a value in the "commonstats" table @@ -194,7 +194,7 @@ private: * \param statVar2 the second stat we can save in this table for this entry * \param statVarChanged if this param is true, we save. Else, we don't. Spare some disk usage. */ - void commonStatsSave(const QString name, const QString statVar1, const QString statVar2, const bool statVarChanged); + void commonStatsSave(const TQString name, const TQString statVar1, const TQString statVar2, const bool statVarChanged); /** * Kopete::MetaContact linked to this StatisticsContact @@ -213,7 +213,7 @@ private: */ Kopete::OnlineStatus::StatusType m_oldStatus; /// We keep the old status datetime here - QDateTime m_oldStatusDateTime; + TQDateTime m_oldStatusDateTime; /** * Average time this user takes between two of his messages @@ -223,7 +223,7 @@ private: bool m_timeBetweenTwoMessagesChanged; /// Date at which the last message was received. /// Used to compute m_timeBetweenTwoMessages - QDateTime m_lastMessageReceived; + TQDateTime m_lastMessageReceived; /// This is the ponderation corresponding to m_timeBetweenTwoMessagesOn int m_timeBetweenTwoMessagesOn; /// We don't count time if a chatwindow isn't open @@ -240,20 +240,20 @@ private: /** * Last time user talked with this contact */ - QDateTime m_lastTalk; + TQDateTime m_lastTalk; bool m_lastTalkChanged; /** * Last time user was present (=online or away) */ - QDateTime m_lastPresent; + TQDateTime m_lastPresent; bool m_lastPresentChanged; /** * Unique id that identifies StatisticsContact * It's also identifier for database records */ - QString m_statisticsContactId; + TQString m_statisticsContactId; }; 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 ) diff --git a/kopete/plugins/statistics/statisticsdb.h b/kopete/plugins/statistics/statisticsdb.h index 130b1d0e..444e80c0 100644 --- a/kopete/plugins/statistics/statisticsdb.h +++ b/kopete/plugins/statistics/statisticsdb.h @@ -26,8 +26,8 @@ public: StatisticsDB(); ~StatisticsDB(); //sql helper methods - QStringList query( const QString& statement, QStringList* const names = 0, bool debug = false ); - QString escapeString( QString string ); + TQStringList query( const TQString& statement, TQStringList* const names = 0, bool debug = false ); + TQString escapeString( TQString string ); private: sqlite3 *m_db; }; diff --git a/kopete/plugins/statistics/statisticsdcopiface.h b/kopete/plugins/statistics/statisticsdcopiface.h index b45a2c95..9a769935 100644 --- a/kopete/plugins/statistics/statisticsdcopiface.h +++ b/kopete/plugins/statistics/statisticsdcopiface.h @@ -29,46 +29,46 @@ k_dcop: /** * Shows the statistics dialog for contact which has KABC id \var contactId */ - virtual void dcopStatisticsDialog(QString contactId) = 0; + virtual void dcopStatisticsDialog(TQString contactId) = 0; /** * \returns true if contact was online at time timeStamp, false else. Returns false if contact does not exist. */ - virtual bool dcopWasOnline(QString id, int timeStamp) = 0; + virtual bool dcopWasOnline(TQString id, int timeStamp) = 0; /** * \returns true if contact was online at dt, false else. Returns false if contact does not exist or if date is invalid. */ - virtual bool dcopWasOnline(QString id, QString datetime) = 0; + virtual bool dcopWasOnline(TQString id, TQString datetime) = 0; /** * \returns true if contact was away at time timeStamp, false else. Returns false if contact does not exist. */ - virtual bool dcopWasAway(QString id, int timeStamp) = 0; + virtual bool dcopWasAway(TQString id, int timeStamp) = 0; /** * \returns true if contact was away at dt, false else. Returns false if contact does not exist or if date is invalid. */ - virtual bool dcopWasAway(QString id, QString datetime) = 0; + virtual bool dcopWasAway(TQString id, TQString datetime) = 0; /** * \returns true if contact was offline at time timeStamp, false else. Returns false if contact does not exist. */ - virtual bool dcopWasOffline(QString id, int timeStamp) = 0; + virtual bool dcopWasOffline(TQString id, int timeStamp) = 0; /** * \returns true if contact was offline at dt, false else. Returns false if contact does not exist or if date is invalid. */ - virtual bool dcopWasOffline(QString id, QString datetime) = 0; + virtual bool dcopWasOffline(TQString id, TQString datetime) = 0; /** * \returns return the status of the contact at datetime. */ - virtual QString dcopStatus(QString id, QString datetime) = 0; + virtual TQString dcopStatus(TQString id, TQString datetime) = 0; /** * \returns return the status of the contact at timeStamp. */ - virtual QString dcopStatus(QString id, int timeStamp) = 0; + virtual TQString dcopStatus(TQString id, int timeStamp) = 0; /** * \returns the main status (most used status) of the contact id at date (not time) timeStamp. Will take the day where timeStamp is. */ - virtual QString dcopMainStatus(QString id, int timeStamp) = 0; + virtual TQString dcopMainStatus(TQString id, int timeStamp) = 0; }; #endif // STATISTICSDCOP_H diff --git a/kopete/plugins/statistics/statisticsdialog.cpp b/kopete/plugins/statistics/statisticsdialog.cpp index 485eb7ad..461dd696 100644 --- a/kopete/plugins/statistics/statisticsdialog.cpp +++ b/kopete/plugins/statistics/statisticsdialog.cpp @@ -14,14 +14,14 @@ */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "kdialogbase.h" #include "klocale.h" @@ -40,7 +40,7 @@ #include "statisticsplugin.h" #include "statisticsdb.h" -StatisticsDialog::StatisticsDialog(StatisticsContact *contact, StatisticsDB *db, QWidget* parent, +StatisticsDialog::StatisticsDialog(StatisticsContact *contact, StatisticsDB *db, TQWidget* parent, const char* name) : KDialogBase(parent, name, false, i18n("Statistics for %1").arg(contact->metaContact()->displayName()), Close, Close), m_db(db), m_contact(contact) { @@ -51,20 +51,20 @@ StatisticsDialog::StatisticsDialog(StatisticsContact *contact, StatisticsDB *db, setMinimumHeight(400); adjustSize(); - QHBox *hbox = new QHBox(this); + TQHBox *hbox = new TQHBox(this); generalHTMLPart = new KHTMLPart(hbox); generalHTMLPart->setOnlyLocalReferences(true); - connect ( generalHTMLPart->browserExtension(), SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs & ) ), - this, SLOT( slotOpenURLRequest( const KURL &, const KParts::URLArgs & ) ) ); + connect ( generalHTMLPart->browserExtension(), TQT_SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs & ) ), + this, TQT_SLOT( slotOpenURLRequest( const KURL &, const KParts::URLArgs & ) ) ); mainWidget->tabWidget->insertTab(hbox, i18n("General"), 0); mainWidget->tabWidget->setCurrentPage(0); - mainWidget->timePicker->setTime(QTime::currentTime()); - mainWidget->datePicker->setDate(QDate::currentDate()); - connect(mainWidget->askButton, SIGNAL(clicked()), this, SLOT(slotAskButtonClicked())); + mainWidget->timePicker->setTime(TQTime::currentTime()); + mainWidget->datePicker->setDate(TQDate::currentDate()); + connect(mainWidget->askButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAskButtonClicked())); setFocus(); setEscapeButton(Close); @@ -89,14 +89,14 @@ void StatisticsDialog::slotOpenURLRequest(const KURL& url, const KParts::URLArgs } } -/*void StatisticsDialog::parseTemplate(QString Template) +/*void StatisticsDialog::parseTemplate(TQString Template) { - QString fileString = ::locate("appdata", "kopete_statistics.template.html"); - QString templateString; - QFile file(file); + TQString fileString = ::locate("appdata", "kopete_statistics.template.html"); + TQString templateString; + TQFile file(file); if (file.open(IO_ReadOnly)) { - QTextStream stream(&file); + TQTextStream stream(&file); templateString = stream.read(); file.close(); } @@ -106,14 +106,14 @@ void StatisticsDialog::slotOpenURLRequest(const KURL& url, const KParts::URLArgs void StatisticsDialog::generatePageForMonth(const int monthOfYear) { - QStringList values = m_db->query(QString("SELECT status, datetimebegin, datetimeend " + TQStringList values = m_db->query(TQString("SELECT status, datetimebegin, datetimeend " "FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;").arg(m_contact->statisticsContactId())); - QStringList values2; + TQStringList values2; for (uint i=0; iquery(QString("SELECT status, datetimebegin, datetimeend " + TQStringList values = m_db->query(TQString("SELECT status, datetimebegin, datetimeend " "FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;").arg(m_contact->statisticsContactId())); - QStringList values2; + TQStringList values2; for (uint i=0; ibegin(); - generalHTMLPart->write(QString("