diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-19 11:58:08 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-19 11:58:08 -0600 |
commit | 1de96857f5b0ed5d4a36e9486ffc8c7f8c802f98 (patch) | |
tree | e24fdc0514249de1233dd5dc07f09d07a35f4269 /kopete/plugins/statistics | |
parent | 089118c18533dfa3e6ce5065dbebdd4db94051f1 (diff) | |
download | tdenetwork-1de96857f5b0ed5d4a36e9486ffc8c7f8c802f98.tar.gz tdenetwork-1de96857f5b0ed5d4a36e9486ffc8c7f8c802f98.zip |
Remove additional unneeded tq method conversions
Diffstat (limited to 'kopete/plugins/statistics')
-rw-r--r-- | kopete/plugins/statistics/statisticscontact.cpp | 34 | ||||
-rw-r--r-- | kopete/plugins/statistics/statisticsdialog.cpp | 44 |
2 files changed, 39 insertions, 39 deletions
diff --git a/kopete/plugins/statistics/statisticscontact.cpp b/kopete/plugins/statistics/statisticscontact.cpp index 3a03b7bc..d811e4d2 100644 --- a/kopete/plugins/statistics/statisticscontact.cpp +++ b/kopete/plugins/statistics/statisticscontact.cpp @@ -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 { @@ -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; } @@ -279,7 +279,7 @@ void StatisticsContact::onlineStatusChanged(Kopete::OnlineStatus::StatusType sta 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_oldStatus)).tqarg(TQString::number(m_oldStatusDateTime.toTime_t())).tqarg(TQString::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) @@ -303,7 +303,7 @@ bool StatisticsContact::wasStatus(TQDateTime dt, Kopete::OnlineStatus::StatusTyp "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); @@ -390,7 +390,7 @@ TQValueList<TQTime> StatisticsContact::mainEvents(const Kopete::OnlineStatus::St return mainEvents; TQDateTime currentDateTime = TQDateTime::currentDateTime(); - buffer = m_db->query(TQString("SELECT datetimebegin, datetimeend, status FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin").tqarg(m_statisticsContactId)); + 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/statisticsdialog.cpp b/kopete/plugins/statistics/statisticsdialog.cpp index b4ca0861..0e775405 100644 --- a/kopete/plugins/statistics/statisticsdialog.cpp +++ b/kopete/plugins/statistics/statisticsdialog.cpp @@ -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); @@ -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>" @@ -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,24 +399,24 @@ 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( + 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) |