From 1de96857f5b0ed5d4a36e9486ffc8c7f8c802f98 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 19 Dec 2011 11:58:08 -0600 Subject: Remove additional unneeded tq method conversions --- kopete/plugins/statistics/statisticscontact.cpp | 34 +++++++++---------- kopete/plugins/statistics/statisticsdialog.cpp | 44 ++++++++++++------------- 2 files changed, 39 insertions(+), 39 deletions(-) (limited to 'kopete/plugins/statistics') 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 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;}" "" + - i18n("

Statistics for %1

").tqarg(m_contact->metaContact()->displayName()) + - "

%1


").tqarg(subTitle)); + i18n("

Statistics for %1

").arg(m_contact->metaContact()->displayName()) + + "

%1


").arg(subTitle)); generalHTMLPart->write(i18n("
General
" "Days: " @@ -351,7 +351,7 @@ void StatisticsDialog::generatePageFromTQStringList(TQStringList values, const T } else color="white"; - todayString.append(TQString("%2%3%4").tqarg(color, status, dateTime1.time().toString(), dateTime2.time().toString())); + todayString.append(TQString("%2%3%4").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("
")); generalHTMLPart->write(i18n("" - "Total seen time : %2 hour(s)
").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalTime))); + "Total seen time : %2 hour(s)
").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalTime))); generalHTMLPart->write(i18n("" - "Total online time : %2 hour(s)
").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalOnlineTime))); - generalHTMLPart->write(i18n("Total busy time : %2 hour(s)
").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalAwayTime))); - generalHTMLPart->write(i18n("Total offline time : %2 hour(s)").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalOfflineTime))); + "Total online time : %2 hour(s)
").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalOnlineTime))); + generalHTMLPart->write(i18n("Total busy time : %2 hour(s)
").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalAwayTime))); + generalHTMLPart->write(i18n("Total offline time : %2 hour(s)").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalOfflineTime))); generalHTMLPart->write(TQString("
")); if (subTitle == i18n("General information")) @@ -399,24 +399,24 @@ void StatisticsDialog::generatePageFromTQStringList(TQStringList values, const T */ { generalHTMLPart->write(TQString("
")); - generalHTMLPart->write(i18n("Average message length : %1 characters
").tqarg(m_contact->messageLength())); - generalHTMLPart->write(i18n("Time between two messages : %1 second(s)").tqarg(m_contact->timeBetweenTwoMessages())); + generalHTMLPart->write(i18n("Average message length : %1 characters
").arg(m_contact->messageLength())); + generalHTMLPart->write(i18n("Time between two messages : %1 second(s)").arg(m_contact->timeBetweenTwoMessages())); generalHTMLPart->write(TQString("
")); generalHTMLPart->write(TQString("
")); - generalHTMLPart->write(i18n("Last talk : %2
").tqarg(m_contact->metaContact()->displayName()).tqarg(KGlobal::locale()->formatDateTime(m_contact->lastTalk()))); - generalHTMLPart->write(i18n("Last time contact was present : %2").tqarg(m_contact->metaContact()->displayName()).tqarg(KGlobal::locale()->formatDateTime(m_contact->lastPresent()))); + generalHTMLPart->write(i18n("Last talk : %2
").arg(m_contact->metaContact()->displayName()).arg(KGlobal::locale()->formatDateTime(m_contact->lastTalk()))); + generalHTMLPart->write(i18n("Last time contact was present : %2").arg(m_contact->metaContact()->displayName()).arg(KGlobal::locale()->formatDateTime(m_contact->lastPresent()))); generalHTMLPart->write(TQString("
")); //generalHTMLPart->write(TQString("
")); - //generalHTMLPart->write(i18n("Main online events :
").tqarg(m_contact->metaContact()->displayName())); + //generalHTMLPart->write(i18n("Main online events :
").arg(m_contact->metaContact()->displayName())); //TQValueList mainEvents = m_contact->mainEvents(Kopete::OnlineStatus::Online); //for (uint i=0; iwrite(TQString("%1
").tqarg(mainEvents[i].toString())); + //generalHTMLPart->write(TQString("%1
").arg(mainEvents[i].toString())); //generalHTMLPart->write(TQString("
")); generalHTMLPart->write("
"); - generalHTMLPart->write(i18n("Is %1 since %2").tqarg( + generalHTMLPart->write(i18n("Is %1 since %2").arg( Kopete::OnlineStatus(m_contact->oldStatus()).description(), KGlobal::locale()->formatDateTime(m_contact->oldStatusDateTime()))); generalHTMLPart->write(TQString("
")); @@ -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) -- cgit v1.2.1