summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/statistics/statisticscontact.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/plugins/statistics/statisticscontact.cpp')
-rw-r--r--kopete/plugins/statistics/statisticscontact.cpp34
1 files changed, 17 insertions, 17 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.