diff options
Diffstat (limited to 'kopete/plugins/statistics')
-rw-r--r-- | kopete/plugins/statistics/statisticscontact.cpp | 68 | ||||
-rw-r--r-- | kopete/plugins/statistics/statisticscontact.h | 10 | ||||
-rw-r--r-- | kopete/plugins/statistics/statisticsdcopiface.h | 6 | ||||
-rw-r--r-- | kopete/plugins/statistics/statisticsdialog.cpp | 54 | ||||
-rw-r--r-- | kopete/plugins/statistics/statisticsplugin.cpp | 26 | ||||
-rw-r--r-- | kopete/plugins/statistics/statisticsplugin.h | 10 | ||||
-rw-r--r-- | kopete/plugins/statistics/statisticswidget.ui | 18 |
7 files changed, 96 insertions, 96 deletions
diff --git a/kopete/plugins/statistics/statisticscontact.cpp b/kopete/plugins/statistics/statisticscontact.cpp index c178b39b..d811e4d2 100644 --- a/kopete/plugins/statistics/statisticscontact.cpp +++ b/kopete/plugins/statistics/statisticscontact.cpp @@ -28,10 +28,10 @@ #include "statisticscontact.h" #include "statisticsdb.h" -StatisticsContact::StatisticsContact(Kopete::MetaContact *mc, StatisticsDB *db) : m_metaContact(mc),m_db(db), m_oldtqStatus(Kopete::OnlineStatus::Unknown) +StatisticsContact::StatisticsContact(Kopete::MetaContact *mc, StatisticsDB *db) : m_metaContact(mc),m_db(db), m_oldStatus(Kopete::OnlineStatus::Unknown) { m_isChatWindowOpen = false; - m_oldStatusDateTime = TQDateTime::tqcurrentDateTime(); + m_oldStatusDateTime = TQDateTime::currentDateTime(); // Last*Changed are always false at start m_timeBetweenTwoMessagesChanged = false; @@ -60,7 +60,7 @@ void StatisticsContact::initialize(Kopete::Contact *c) // Generate statisticsContactId or get it from database TQStringList buffer = m_db->query(TQString("SELECT statisticid FROM contacts " "WHERE contactid LIKE '%1';" - ).tqarg(c->contactId())); + ).arg(c->contactId())); if (buffer.isEmpty()) { @@ -68,7 +68,7 @@ void StatisticsContact::initialize(Kopete::Contact *c) if ( !c->metaContact()->metaContactId().isEmpty() && !m_db->query(TQString("SELECT metacontactid FROM commonstats " "WHERE metacontactid LIKE '%1';" - ).tqarg(c->metaContact()->metaContactId())).isEmpty()) + ).arg(c->metaContact()->metaContactId())).isEmpty()) { // Use old style id m_statisticsContactId = c->metaContact()->metaContactId(); @@ -81,7 +81,7 @@ void StatisticsContact::initialize(Kopete::Contact *c) // Assign contactId to m_statisticsContactId m_db->query(TQString("INSERT INTO contacts (statisticid, contactid) VALUES('%1', '%2');" - ).tqarg(m_statisticsContactId).tqarg(c->contactId())); + ).arg(m_statisticsContactId).arg(c->contactId())); } else { @@ -107,7 +107,7 @@ void StatisticsContact::initialize(Kopete::Contact *c) // Get last time a message was received - m_lastMessageReceived = TQDateTime::tqcurrentDateTime(); + m_lastMessageReceived = TQDateTime::currentDateTime(); // Check for lastPresent @@ -129,11 +129,11 @@ void StatisticsContact::contactAdded( Kopete::Contact *c ) // Check if contact is allready in database if not add it if (m_db->query(TQString("SELECT id FROM contacts " "WHERE statisticid LIKE '%1' AND contactid LIKE '%2';" - ).tqarg(m_statisticsContactId).tqarg(c->contactId())).isEmpty()) + ).arg(m_statisticsContactId).arg(c->contactId())).isEmpty()) { // Assign contactId to m_statisticsContactId m_db->query(TQString("INSERT INTO contacts (statisticid, contactid) VALUES('%1', '%2');" - ).tqarg(m_statisticsContactId).tqarg(c->contactId())); + ).arg(m_statisticsContactId).arg(c->contactId())); } kdDebug() << k_funcinfo << " m_statisticsContactId: " << m_statisticsContactId << endl; } @@ -151,7 +151,7 @@ void StatisticsContact::contactRemoved( Kopete::Contact *c ) kdDebug() << k_funcinfo << " m_statisticsContactId: " << m_statisticsContactId << endl; m_db->query(TQString("DELETE FROM contacts WHERE statisticid LIKE '%1' AND contactid LIKE '%2';" - ).tqarg(m_statisticsContactId).tqarg(c->contactId())); + ).arg(m_statisticsContactId).arg(c->contactId())); } void StatisticsContact::removeFromDB() @@ -160,9 +160,9 @@ void StatisticsContact::removeFromDB() return; kdDebug() << k_funcinfo << " m_statisticsContactId: " << m_statisticsContactId << endl; - m_db->query(TQString("DELETE FROM contacts WHERE statisticid LIKE '%1';").tqarg(m_statisticsContactId)); - m_db->query(TQString("DELETE FROM contactstatus WHERE metacontactid LIKE '%1';").tqarg(m_statisticsContactId)); - m_db->query(TQString("DELETE FROM commonstats WHERE metacontactid LIKE '%1';").tqarg(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 = TQString(); } @@ -176,7 +176,7 @@ void StatisticsContact::commonStatsSave(const TQString name, const TQString stat return; m_db->query(TQString("UPDATE commonstats SET statvalue1 = '%1', statvalue2='%2'" - "WHERE statname LIKE '%3' AND metacontactid LIKE '%4';").tqarg(statVar1).tqarg(statVar2).tqarg(name).tqarg(m_statisticsContactId)); + "WHERE statname LIKE '%3' AND metacontactid LIKE '%4';").arg(statVar1).arg(statVar2).arg(name).arg(m_statisticsContactId)); } @@ -196,7 +196,7 @@ void StatisticsContact::commonStatsCheck(const TQString name, TQString& statVar1 if (m_statisticsContactId.isEmpty()) return; - TQStringList buffer = m_db->query(TQString("SELECT statvalue1,statvalue2 FROM commonstats WHERE statname LIKE '%1' AND metacontactid LIKE '%2';").tqarg(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 TQString name, TQString& statVar1 } else { - m_db->query(TQString("INSERT INTO commonstats (metacontactid, statname, statvalue1, statvalue2) VALUES('%1', '%2', 0, 0);").tqarg(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,18 +234,18 @@ void StatisticsContact::commonStatsCheck(const TQString name, TQString& statVar1 void StatisticsContact::newMessageReceived(Kopete::Message& m) { kdDebug() << "statistics: new message received" << endl; - TQDateTime tqcurrentDateTime = TQDateTime::tqcurrentDateTime(); + TQDateTime currentDateTime = TQDateTime::currentDateTime(); if (m_timeBetweenTwoMessagesOn != -1 && m_isChatWindowOpen) { - m_timeBetweenTwoMessages = (m_timeBetweenTwoMessages*m_timeBetweenTwoMessagesOn + m_lastMessageReceived.secsTo(tqcurrentDateTime))/(1 + m_timeBetweenTwoMessagesOn); + m_timeBetweenTwoMessages = (m_timeBetweenTwoMessages*m_timeBetweenTwoMessagesOn + m_lastMessageReceived.secsTo(currentDateTime))/(1 + m_timeBetweenTwoMessagesOn); } setIsChatWindowOpen(true); m_timeBetweenTwoMessagesOn += 1; - m_lastMessageReceived = tqcurrentDateTime; + m_lastMessageReceived = currentDateTime; // Message lenght @@ -254,7 +254,7 @@ void StatisticsContact::newMessageReceived(Kopete::Message& m) // Last talked /// @todo do this in message sent too. So we need setLastTalk() - m_lastTalk = tqcurrentDateTime; + m_lastTalk = currentDateTime; m_messageLengthChanged = true; m_lastTalkChanged = true; @@ -269,32 +269,32 @@ void StatisticsContact::onlineStatusChanged(Kopete::OnlineStatus::StatusType sta if (m_statisticsContactId.isEmpty()) return; - TQDateTime tqcurrentDateTime = TQDateTime::tqcurrentDateTime(); + TQDateTime currentDateTime = TQDateTime::currentDateTime(); - /// We don't want to log if oldtqStatus is unknown + /// We don't want to log if oldStatus is unknown /// the change could not be a real one; see StatisticsPlugin::slotMySelfOnlineStatusChanged - if (m_oldtqStatus != Kopete::OnlineStatus::Unknown) + if (m_oldStatus != Kopete::OnlineStatus::Unknown) { - kdDebug() << "statistics - status change for "<< metaContact()->metaContactId() << " : "<< TQString::number(m_oldtqStatus) << endl; + 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'" ");").tqarg(m_statisticsContactId).tqarg(Kopete::OnlineStatus::statusTypeToString(m_oldtqStatus)).tqarg(TQString::number(m_oldStatusDateTime.toTime_t())).tqarg(TQString::number(tqcurrentDateTime.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_oldtqStatus == Kopete::OnlineStatus::Online || m_oldtqStatus == Kopete::OnlineStatus::Away) + if (m_oldStatus == Kopete::OnlineStatus::Online || m_oldStatus == Kopete::OnlineStatus::Away) // If the last status was Online or Away, the last time contact was present is the time he goes offline { - m_lastPresent = tqcurrentDateTime; + m_lastPresent = currentDateTime; m_lastPresentChanged = true; } - m_oldtqStatus = status; - m_oldStatusDateTime = tqcurrentDateTime; + m_oldStatus = status; + m_oldStatusDateTime = currentDateTime; } -bool StatisticsContact::wastqStatus(TQDateTime dt, Kopete::OnlineStatus::StatusType status) +bool StatisticsContact::wasStatus(TQDateTime dt, Kopete::OnlineStatus::StatusType status) { if (m_statisticsContactId.isEmpty()) return false; @@ -303,7 +303,7 @@ bool StatisticsContact::wastqStatus(TQDateTime dt, Kopete::OnlineStatus::StatusT "FROM contactstatus WHERE metacontactid LIKE '%1' AND datetimebegin <= %2 AND datetimeend >= %3 " "AND status LIKE '%4' " "ORDER BY datetimebegin;" - ).tqarg(m_statisticsContactId).tqarg(dt.toTime_t()).tqarg(dt.toTime_t()).tqarg(Kopete::OnlineStatus::statusTypeToString(status))); + ).arg(m_statisticsContactId).arg(dt.toTime_t()).arg(dt.toTime_t()).arg(Kopete::OnlineStatus::statusTypeToString(status))); if (!values.isEmpty()) return true; @@ -318,7 +318,7 @@ TQString StatisticsContact::statusAt(TQDateTime dt) 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;" - ).tqarg(m_statisticsContactId).tqarg(dt.toTime_t()).tqarg(dt.toTime_t())); + ).arg(m_statisticsContactId).arg(dt.toTime_t()).arg(dt.toTime_t())); if (!values.isEmpty()) return Kopete::OnlineStatus(Kopete::OnlineStatus::statusStringToType(values[0])).description(); else return ""; @@ -337,7 +337,7 @@ TQString StatisticsContact::mainStatusDate(const TQDate& date) "(datetimebegin >= %2 AND datetimebegin <= %3 OR " "datetimeend >= %4 AND datetimeend <= %5) " "ORDER BY datetimebegin;" - ).tqarg(m_statisticsContactId).tqarg(dt1.toTime_t()).tqarg(dt2.toTime_t()).tqarg(dt1.toTime_t()).tqarg(dt2.toTime_t()); + ).arg(m_statisticsContactId).arg(dt1.toTime_t()).arg(dt2.toTime_t()).arg(dt1.toTime_t()).arg(dt2.toTime_t()); kdDebug() << request << endl; TQStringList values = m_db->query(request); @@ -389,8 +389,8 @@ TQValueList<TQTime> StatisticsContact::mainEvents(const Kopete::OnlineStatus::St if (m_statisticsContactId.isEmpty()) return mainEvents; - TQDateTime tqcurrentDateTime = TQDateTime::tqcurrentDateTime(); - buffer = m_db->query(TQString("SELECT datetimebegin, datetimeend, status FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin").tqarg(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. diff --git a/kopete/plugins/statistics/statisticscontact.h b/kopete/plugins/statistics/statisticscontact.h index 1559e1fd..9d7f6575 100644 --- a/kopete/plugins/statistics/statisticscontact.h +++ b/kopete/plugins/statistics/statisticscontact.h @@ -55,9 +55,9 @@ public: TQString statisticsContactId() { return m_statisticsContactId; } /** \brief Access method - * \return m_oldtqStatus + * \return m_oldStatus */ - Kopete::OnlineStatus::StatusType oldtqStatus() { return m_oldtqStatus; } + Kopete::OnlineStatus::StatusType oldStatus() { return m_oldStatus; } /** \brief Access method * \return m_oldStatusDateTime @@ -106,7 +106,7 @@ public: /** * \returns true if contact was status at dt, false else. */ - bool wastqStatus(TQDateTime dt, Kopete::OnlineStatus::StatusType status); + bool wasStatus(TQDateTime dt, Kopete::OnlineStatus::StatusType status); /** * \returns the status of the contact at dt. Return false if dt is invalid. @@ -209,9 +209,9 @@ private: /** * The interest of statistics contact is to manage the changes of status - * in order to correctly update the database. That's why here we keep the oldtqStatus + * in order to correctly update the database. That's why here we keep the oldStatus */ - Kopete::OnlineStatus::StatusType m_oldtqStatus; + Kopete::OnlineStatus::StatusType m_oldStatus; /// We keep the old status datetime here TQDateTime m_oldStatusDateTime; diff --git a/kopete/plugins/statistics/statisticsdcopiface.h b/kopete/plugins/statistics/statisticsdcopiface.h index 36336ae2..9a769935 100644 --- a/kopete/plugins/statistics/statisticsdcopiface.h +++ b/kopete/plugins/statistics/statisticsdcopiface.h @@ -60,15 +60,15 @@ k_dcop: /** * \returns return the status of the contact at datetime. */ - virtual TQString dcoptqStatus(TQString id, TQString datetime) = 0; + virtual TQString dcopStatus(TQString id, TQString datetime) = 0; /** * \returns return the status of the contact at timeStamp. */ - virtual TQString dcoptqStatus(TQString 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 TQString dcopMaintqStatus(TQString 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 3c0a67c1..9bea7995 100644 --- a/kopete/plugins/statistics/statisticsdialog.cpp +++ b/kopete/plugins/statistics/statisticsdialog.cpp @@ -17,9 +17,9 @@ #include <tqtabwidget.h> #include <tqwidget.h> #include <tqhbox.h> -#include <tqlayout.h> +#include <layout.h> #include <tqpushbutton.h> -#include <tqtextedit.h> +#include <textedit.h> #include <tqcombobox.h> #include <tqstring.h> @@ -42,7 +42,7 @@ StatisticsDialog::StatisticsDialog(StatisticsContact *contact, StatisticsDB *db, TQWidget* parent, const char* name) : KDialogBase(parent, name, false, - i18n("Statistics for %1").tqarg(contact->metaContact()->displayName()), Close, Close), m_db(db), m_contact(contact) + i18n("Statistics for %1").arg(contact->metaContact()->displayName()), Close, Close), m_db(db), m_contact(contact) { mainWidget = new StatisticsWidget(this); setMainWidget(mainWidget); @@ -63,7 +63,7 @@ StatisticsDialog::StatisticsDialog(StatisticsContact *contact, StatisticsDB *db, mainWidget->tabWidget->setCurrentPage(0); mainWidget->timePicker->setTime(TQTime::currentTime()); - mainWidget->datePicker->setDate(TQDate::tqcurrentDate()); + mainWidget->datePicker->setDate(TQDate::currentDate()); connect(mainWidget->askButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAskButtonClicked())); setFocus(); @@ -107,7 +107,7 @@ void StatisticsDialog::slotOpenURLRequest(const KURL& url, const KParts::URLArgs void StatisticsDialog::generatePageForMonth(const int monthOfYear) { TQStringList values = m_db->query(TQString("SELECT status, datetimebegin, datetimeend " - "FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;").tqarg(m_contact->statisticsContactId())); + "FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;").arg(m_contact->statisticsContactId())); TQStringList values2; @@ -129,7 +129,7 @@ void StatisticsDialog::generatePageForMonth(const int monthOfYear) void StatisticsDialog::generatePageForDay(const int dayOfWeek) { TQStringList values = m_db->query(TQString("SELECT status, datetimebegin, datetimeend " - "FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;").tqarg(m_contact->statisticsContactId())); + "FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;").arg(m_contact->statisticsContactId())); TQStringList values2; @@ -190,8 +190,8 @@ void StatisticsDialog::generatePageFromTQStringList(TQStringList values, const T "margin-right: 5px;" "padding:3px 3px 3px 10px;}" "</style></head><body>" + - i18n("<h1>Statistics for %1</h1>").tqarg(m_contact->metaContact()->displayName()) + - "<h3>%1</h3><hr>").tqarg(subTitle)); + i18n("<h1>Statistics for %1</h1>").arg(m_contact->metaContact()->displayName()) + + "<h3>%1</h3><hr>").arg(subTitle)); generalHTMLPart->write(i18n("<div class=\"statgroup\"><b><a href=\"main:generalinfo\" title=\"General summary view\">General</a></b><br>" "<span title=\"Select the a day or a month to view the stat for\"><b>Days: </b>" @@ -265,7 +265,7 @@ void StatisticsDialog::generatePageFromTQStringList(TQStringList values, const T TQDateTime dateTime2; dateTime2.setTime_t(values[i+2].toInt()); - if (dateTime1.date() == TQDate::tqcurrentDate() || dateTime2.date() == TQDate::tqcurrentDate()) + if (dateTime1.date() == TQDate::currentDate() || dateTime2.date() == TQDate::currentDate()) today = true; else today = false; @@ -351,7 +351,7 @@ void StatisticsDialog::generatePageFromTQStringList(TQStringList values, const T } else color="white"; - todayString.append(TQString("<tr style=\"color:%1\"><td>%2</td><td>%3</td><td>%4</td></tr>").tqarg(color, status, dateTime1.time().toString(), dateTime2.time().toString())); + todayString.append(TQString("<tr style=\"color:%1\"><td>%2</td><td>%3</td><td>%4</td></tr>").arg(color, status, dateTime1.time().toString(), dateTime2.time().toString())); } @@ -386,11 +386,11 @@ void StatisticsDialog::generatePageFromTQStringList(TQStringList values, const T // Some "total times" generalHTMLPart->write(i18n("<div class=\"statgroup\">")); generalHTMLPart->write(i18n("<b title=\"The total time I have been able to see %1 status\">" - "Total seen time :</b> %2 hour(s)<br>").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalTime))); + "Total seen time :</b> %2 hour(s)<br>").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalTime))); generalHTMLPart->write(i18n("<b title=\"The total time I have seen %1 online\">" - "Total online time :</b> %2 hour(s)<br>").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalOnlineTime))); - generalHTMLPart->write(i18n("<b title=\"The total time I have seen %1 away\">Total busy time :</b> %2 hour(s)<br>").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalAwayTime))); - generalHTMLPart->write(i18n("<b title=\"The total time I have seen %1 offline\">Total offline time :</b> %2 hour(s)").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalOfflineTime))); + "Total online time :</b> %2 hour(s)<br>").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalOnlineTime))); + generalHTMLPart->write(i18n("<b title=\"The total time I have seen %1 away\">Total busy time :</b> %2 hour(s)<br>").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalAwayTime))); + generalHTMLPart->write(i18n("<b title=\"The total time I have seen %1 offline\">Total offline time :</b> %2 hour(s)").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalOfflineTime))); generalHTMLPart->write(TQString("</div>")); if (subTitle == i18n("General information")) @@ -399,25 +399,25 @@ void StatisticsDialog::generatePageFromTQStringList(TQStringList values, const T */ { generalHTMLPart->write(TQString("<div class=\"statgroup\">")); - generalHTMLPart->write(i18n("<b>Average message length :</b> %1 characters<br>").tqarg(m_contact->messageLength())); - generalHTMLPart->write(i18n("<b>Time between two messages : </b> %1 second(s)").tqarg(m_contact->timeBetweenTwoMessages())); + generalHTMLPart->write(i18n("<b>Average message length :</b> %1 characters<br>").arg(m_contact->messageLength())); + generalHTMLPart->write(i18n("<b>Time between two messages : </b> %1 second(s)").arg(m_contact->timeBetweenTwoMessages())); generalHTMLPart->write(TQString("</div>")); generalHTMLPart->write(TQString("<div class=\"statgroup\">")); - generalHTMLPart->write(i18n("<b title=\"The last time you talked with %1\">Last talk :</b> %2<br>").tqarg(m_contact->metaContact()->displayName()).tqarg(KGlobal::locale()->formatDateTime(m_contact->lastTalk()))); - generalHTMLPart->write(i18n("<b title=\"The last time I have seen %1 online or away\">Last time contact was present :</b> %2").tqarg(m_contact->metaContact()->displayName()).tqarg(KGlobal::locale()->formatDateTime(m_contact->lastPresent()))); + generalHTMLPart->write(i18n("<b title=\"The last time you talked with %1\">Last talk :</b> %2<br>").arg(m_contact->metaContact()->displayName()).arg(KGlobal::locale()->formatDateTime(m_contact->lastTalk()))); + generalHTMLPart->write(i18n("<b title=\"The last time I have seen %1 online or away\">Last time contact was present :</b> %2").arg(m_contact->metaContact()->displayName()).arg(KGlobal::locale()->formatDateTime(m_contact->lastPresent()))); generalHTMLPart->write(TQString("</div>")); //generalHTMLPart->write(TQString("<div class=\"statgroup\">")); - //generalHTMLPart->write(i18n("<b title=\"%1 uses to set his status online at these hours (EXPERIMENTAL)\">Main online events :</b><br>").tqarg(m_contact->metaContact()->displayName())); + //generalHTMLPart->write(i18n("<b title=\"%1 uses to set his status online at these hours (EXPERIMENTAL)\">Main online events :</b><br>").arg(m_contact->metaContact()->displayName())); //TQValueList<TQTime> mainEvents = m_contact->mainEvents(Kopete::OnlineStatus::Online); //for (uint i=0; i<mainEvents.count(); i++) - //generalHTMLPart->write(TQString("%1<br>").tqarg(mainEvents[i].toString())); + //generalHTMLPart->write(TQString("%1<br>").arg(mainEvents[i].toString())); //generalHTMLPart->write(TQString("</div>")); generalHTMLPart->write("<div title=\"" +i18n("Current status") + "\" class=\"statgroup\">"); - generalHTMLPart->write(i18n("Is <b>%1</b> since <b>%2</b>").tqarg( - Kopete::OnlineStatus(m_contact->oldtqStatus()).description(), + generalHTMLPart->write(i18n("Is <b>%1</b> since <b>%2</b>").arg( + Kopete::OnlineStatus(m_contact->oldStatus()).description(), KGlobal::locale()->formatDateTime(m_contact->oldStatusDateTime()))); generalHTMLPart->write(TQString("</div>")); } @@ -440,7 +440,7 @@ void StatisticsDialog::generatePageFromTQStringList(TQStringList values, const T +TQString("\" src=\"file://") +colorPath +"\" width=\"4%\" title=\"" - +i18n("Between %1:00 and %2:00, I was able to see %3 status %4% of the hour.").tqarg(i).tqarg((i+1)%24).tqarg(m_contact->metaContact()->displayName()).tqarg(hrWidth) + +i18n("Between %1:00 and %2:00, I was able to see %3 status %4% of the hour.").arg(i).arg((i+1)%24).arg(m_contact->metaContact()->displayName()).arg(hrWidth) +TQString("\">"); } generalHTMLPart->write(chartString); @@ -478,7 +478,7 @@ void StatisticsDialog::generatePageGeneral() TQStringList values; values = m_db->query(TQString("SELECT status, datetimebegin, datetimeend " "FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;") - .tqarg(m_contact->statisticsContactId())); + .arg(m_contact->statisticsContactId())); generatePageFromTQStringList(values, i18n("General information")); } @@ -524,9 +524,9 @@ void StatisticsDialog::slotAskButtonClicked() if (mainWidget->questionComboBox->currentItem()==0) { TQString text = i18n("1 is date, 2 is contact name, 3 is online status", "%1, %2 was %3") - .tqarg(KGlobal::locale()->formatDateTime(TQDateTime(mainWidget->datePicker->date(), mainWidget->timePicker->time()))) - .tqarg(m_contact->metaContact()->displayName()) - .tqarg(m_contact->statusAt(TQDateTime(mainWidget->datePicker->date(), mainWidget->timePicker->time()))); + .arg(KGlobal::locale()->formatDateTime(TQDateTime(mainWidget->datePicker->date(), mainWidget->timePicker->time()))) + .arg(m_contact->metaContact()->displayName()) + .arg(m_contact->statusAt(TQDateTime(mainWidget->datePicker->date(), mainWidget->timePicker->time()))); mainWidget->answerEdit->setText(text); } else if (mainWidget->questionComboBox->currentItem()==1) diff --git a/kopete/plugins/statistics/statisticsplugin.cpp b/kopete/plugins/statistics/statisticsplugin.cpp index b28ce8ce..5e19b73c 100644 --- a/kopete/plugins/statistics/statisticsplugin.cpp +++ b/kopete/plugins/statistics/statisticsplugin.cpp @@ -53,7 +53,7 @@ StatisticsPlugin::StatisticsPlugin( TQObject *parent, const char *name, const TQ { KAction *viewMetaContactStatistics = new KAction( i18n("View &Statistics" ), - TQString::tqfromLatin1( "log" ), 0, this, TQT_SLOT(slotViewStatistics()), + TQString::fromLatin1( "log" ), 0, this, TQT_SLOT(slotViewStatistics()), actionCollection(), "viewMetaContactStatistics" ); viewMetaContactStatistics->setEnabled(Kopete::ContactList::self()->selectedMetaContacts().count() == 1); @@ -205,59 +205,59 @@ bool StatisticsPlugin::dcopWasOnline(TQString id, int timeStamp) { TQDateTime dt; dt.setTime_t(timeStamp); - return dcopWastqStatus(id, dt, Kopete::OnlineStatus::Online); + return dcopWasStatus(id, dt, Kopete::OnlineStatus::Online); } bool StatisticsPlugin::dcopWasOnline(TQString id, TQString dateTime) { - return dcopWastqStatus(id, TQDateTime::fromString(dateTime), Kopete::OnlineStatus::Online); + return dcopWasStatus(id, TQDateTime::fromString(dateTime), Kopete::OnlineStatus::Online); } bool StatisticsPlugin::dcopWasAway(TQString id, int timeStamp) { TQDateTime dt; dt.setTime_t(timeStamp); - return dcopWastqStatus(id, dt, Kopete::OnlineStatus::Away); + return dcopWasStatus(id, dt, Kopete::OnlineStatus::Away); } bool StatisticsPlugin::dcopWasAway(TQString id, TQString dateTime) { - return dcopWastqStatus(id, TQDateTime::fromString(dateTime), Kopete::OnlineStatus::Away); + return dcopWasStatus(id, TQDateTime::fromString(dateTime), Kopete::OnlineStatus::Away); } bool StatisticsPlugin::dcopWasOffline(TQString id, int timeStamp) { TQDateTime dt; dt.setTime_t(timeStamp); - return dcopWastqStatus(id, dt, Kopete::OnlineStatus::Offline); + return dcopWasStatus(id, dt, Kopete::OnlineStatus::Offline); } bool StatisticsPlugin::dcopWasOffline(TQString id, TQString dateTime) { - return dcopWastqStatus(id, TQDateTime::fromString(dateTime), Kopete::OnlineStatus::Offline); + return dcopWasStatus(id, TQDateTime::fromString(dateTime), Kopete::OnlineStatus::Offline); } -bool StatisticsPlugin::dcopWastqStatus(TQString id, TQDateTime dateTime, Kopete::OnlineStatus::StatusType status) +bool StatisticsPlugin::dcopWasStatus(TQString id, TQDateTime dateTime, Kopete::OnlineStatus::StatusType status) { kdDebug() << k_funcinfo << "statistics - DCOP wasOnline :" << id << endl; if (dateTime.isValid() && statisticsContactMap.contains(id)) { - return statisticsContactMap[id]->wastqStatus(dateTime, status); + return statisticsContactMap[id]->wasStatus(dateTime, status); } return false; } -TQString StatisticsPlugin::dcoptqStatus(TQString id, int timeStamp) +TQString StatisticsPlugin::dcopStatus(TQString id, int timeStamp) { TQDateTime dt; dt.setTime_t(timeStamp); - return dcoptqStatus(id, dt.toString()); + return dcopStatus(id, dt.toString()); } -TQString StatisticsPlugin::dcoptqStatus(TQString id, TQString dateTime) +TQString StatisticsPlugin::dcopStatus(TQString id, TQString dateTime) { TQDateTime dt = TQDateTime::fromString(dateTime); @@ -269,7 +269,7 @@ TQString StatisticsPlugin::dcoptqStatus(TQString id, TQString dateTime) return ""; } -TQString StatisticsPlugin::dcopMaintqStatus(TQString id, int timeStamp) +TQString StatisticsPlugin::dcopMainStatus(TQString id, int timeStamp) { TQDateTime dt; dt.setTime_t(timeStamp); diff --git a/kopete/plugins/statistics/statisticsplugin.h b/kopete/plugins/statistics/statisticsplugin.h index 467bd6b8..d6f75c81 100644 --- a/kopete/plugins/statistics/statisticsplugin.h +++ b/kopete/plugins/statistics/statisticsplugin.h @@ -61,7 +61,7 @@ class KActionCollection; * * <table> * <tr> - * <td>Event</td><td>Changes to database</td><td>oldtqStatus</td> + * <td>Event</td><td>Changes to database</td><td>oldStatus</td> * </tr> * <tr> * <td>John 17:44 Away <i>(connexion)</i></td><td> - <i>(oldstatus was offline)</i></td><td>oldstatus = away </td> @@ -191,12 +191,12 @@ public slots: bool dcopWasOffline(TQString id, int timeStamp); bool dcopWasOffline(TQString id, TQString dt); - bool dcopWastqStatus(TQString id, TQDateTime dateTime, Kopete::OnlineStatus::StatusType status); + bool dcopWasStatus(TQString id, TQDateTime dateTime, Kopete::OnlineStatus::StatusType status); - TQString dcoptqStatus(TQString id, TQString dateTime); - TQString dcoptqStatus(TQString id, int timeStamp); + TQString dcopStatus(TQString id, TQString dateTime); + TQString dcopStatus(TQString id, int timeStamp); - TQString dcopMaintqStatus(TQString id, int timeStamp); + TQString dcopMainStatus(TQString id, int timeStamp); private: StatisticsDB *m_db; diff --git a/kopete/plugins/statistics/statisticswidget.ui b/kopete/plugins/statistics/statisticswidget.ui index 87dd1b4d..4c53d8e2 100644 --- a/kopete/plugins/statistics/statisticswidget.ui +++ b/kopete/plugins/statistics/statisticswidget.ui @@ -52,7 +52,7 @@ </property> <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>tqlayout11</cstring> + <cstring>layout11</cstring> </property> <hbox> <property name="name"> @@ -68,7 +68,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="tqsizeHint"> + <property name="sizeHint"> <size> <width>61</width> <height>31</height> @@ -77,7 +77,7 @@ </spacer> <widget class="TQLayoutWidget"> <property name="name"> - <cstring>tqlayout9</cstring> + <cstring>layout9</cstring> </property> <vbox> <property name="name"> @@ -98,7 +98,7 @@ </widget> <widget class="TQLayoutWidget"> <property name="name"> - <cstring>tqlayout7</cstring> + <cstring>layout7</cstring> </property> <hbox> <property name="name"> @@ -127,7 +127,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="tqsizeHint"> + <property name="sizeHint"> <size> <width>40</width> <height>20</height> @@ -148,7 +148,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="tqsizeHint"> + <property name="sizeHint"> <size> <width>60</width> <height>41</height> @@ -172,7 +172,7 @@ </property> <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>tqlayout5</cstring> + <cstring>layout5</cstring> </property> <hbox> <property name="name"> @@ -181,12 +181,12 @@ <widget class="TQComboBox"> <item> <property name="text"> - <string>Contact tqStatus at Date & Time</string> + <string>Contact Status at Date & Time</string> </property> </item> <item> <property name="text"> - <string>Most Used tqStatus at Date</string> + <string>Most Used Status at Date</string> </property> </item> <property name="name"> |