summaryrefslogtreecommitdiff
path: root/plugins/HistoryStats
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-07-31 18:07:27 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-07-31 18:07:27 +0300
commit500dd4848842f6d4207584417448586d060fbd6a (patch)
tree569ac641e814da1d706d36b12eaf35183a3ce7a5 /plugins/HistoryStats
parentb47e4b4b32698470bf52c0dc1c2d1af56c46c9b5 (diff)
Contact: group of functions gathered into the personal namespace
Diffstat (limited to 'plugins/HistoryStats')
-rw-r--r--plugins/HistoryStats/src/_langext.h2
-rw-r--r--plugins/HistoryStats/src/colbase_words.cpp8
-rw-r--r--plugins/HistoryStats/src/colbase_words.h8
-rw-r--r--plugins/HistoryStats/src/column.h32
-rw-r--r--plugins/HistoryStats/src/column_chatduration.cpp24
-rw-r--r--plugins/HistoryStats/src/column_chatduration.h2
-rw-r--r--plugins/HistoryStats/src/column_events.cpp10
-rw-r--r--plugins/HistoryStats/src/column_events.h2
-rw-r--r--plugins/HistoryStats/src/column_group.cpp2
-rw-r--r--plugins/HistoryStats/src/column_group.h2
-rw-r--r--plugins/HistoryStats/src/column_inout.cpp42
-rw-r--r--plugins/HistoryStats/src/column_inout.h2
-rw-r--r--plugins/HistoryStats/src/column_inoutgraph.cpp12
-rw-r--r--plugins/HistoryStats/src/column_inoutgraph.h2
-rw-r--r--plugins/HistoryStats/src/column_nick.cpp2
-rw-r--r--plugins/HistoryStats/src/column_nick.h2
-rw-r--r--plugins/HistoryStats/src/column_protocol.cpp2
-rw-r--r--plugins/HistoryStats/src/column_protocol.h2
-rw-r--r--plugins/HistoryStats/src/column_rank.cpp2
-rw-r--r--plugins/HistoryStats/src/column_rank.h2
-rw-r--r--plugins/HistoryStats/src/column_split.cpp14
-rw-r--r--plugins/HistoryStats/src/column_split.h14
-rw-r--r--plugins/HistoryStats/src/column_splittimeline.cpp18
-rw-r--r--plugins/HistoryStats/src/column_splittimeline.h18
-rw-r--r--plugins/HistoryStats/src/column_timeline.cpp18
-rw-r--r--plugins/HistoryStats/src/column_timeline.h18
-rw-r--r--plugins/HistoryStats/src/column_wordcount.cpp8
-rw-r--r--plugins/HistoryStats/src/column_wordcount.h8
-rw-r--r--plugins/HistoryStats/src/column_words.cpp8
-rw-r--r--plugins/HistoryStats/src/column_words.h8
-rw-r--r--plugins/HistoryStats/src/contact.cpp16
-rw-r--r--plugins/HistoryStats/src/contact.h26
-rw-r--r--plugins/HistoryStats/src/dlgoption_subinput.cpp2
-rw-r--r--plugins/HistoryStats/src/dlgoption_suboutput.cpp2
-rw-r--r--plugins/HistoryStats/src/iconlib.cpp2
-rw-r--r--plugins/HistoryStats/src/statistic.cpp142
-rw-r--r--plugins/HistoryStats/src/statistic.h30
37 files changed, 257 insertions, 257 deletions
diff --git a/plugins/HistoryStats/src/_langext.h b/plugins/HistoryStats/src/_langext.h
index f5e94694f7..c481f65567 100644
--- a/plugins/HistoryStats/src/_langext.h
+++ b/plugins/HistoryStats/src/_langext.h
@@ -21,7 +21,7 @@
range_each_(index_var, 0, _countof(array_var))
#define vector_each_(index_var, vector_var) \
- for (int index_var = 0; index_var != (vector_var).size(); ++index_var)
+ for (size_t index_var = 0; index_var != (vector_var).size(); ++index_var)
#define iter_each_(cont_type, iter_var, cont_var) \
for (cont_type::iterator iter_var = (cont_var).begin(); iter_var != (cont_var).end(); ++iter_var)
diff --git a/plugins/HistoryStats/src/colbase_words.cpp b/plugins/HistoryStats/src/colbase_words.cpp
index e45c77e019..d17d6b8b9d 100644
--- a/plugins/HistoryStats/src/colbase_words.cpp
+++ b/plugins/HistoryStats/src/colbase_words.cpp
@@ -297,13 +297,13 @@ void ColBaseWords::impl_contactDataBeginAcquire()
}
}
-void ColBaseWords::impl_contactDataPrepare(Contact& contact) const
+void ColBaseWords::impl_contactDataPrepare(CContact& contact) const
{
WordMap* pData = new WordMap;
contact.setSlot(contactDataSlotGet(), pData);
}
-void ColBaseWords::impl_contactDataFree(Contact& contact) const
+void ColBaseWords::impl_contactDataFree(CContact& contact) const
{
WordMap* pData = reinterpret_cast<WordMap*>(contact.getSlot(contactDataSlotGet()));
if (pData) {
@@ -312,7 +312,7 @@ void ColBaseWords::impl_contactDataFree(Contact& contact) const
}
}
-void ColBaseWords::impl_contactDataAcquireMessage(Contact& contact, Message& msg)
+void ColBaseWords::impl_contactDataAcquireMessage(CContact& contact, Message& msg)
{
if (m_nSource == 2 || m_nSource == 1 && msg.isOutgoing() || m_nSource == 0 && !msg.isOutgoing()) {
WordMap* pData = reinterpret_cast<WordMap*>(contact.getSlot(contactDataSlotGet()));
@@ -320,7 +320,7 @@ void ColBaseWords::impl_contactDataAcquireMessage(Contact& contact, Message& msg
}
}
-void ColBaseWords::impl_contactDataMerge(Contact& contact, const Contact& include) const
+void ColBaseWords::impl_contactDataMerge(CContact& contact, const CContact& include) const
{
WordMap* pData = reinterpret_cast<WordMap*>(contact.getSlot(contactDataSlotGet()));
const WordMap* pIncData = reinterpret_cast<const WordMap*>(include.getSlot(contactDataSlotGet()));
diff --git a/plugins/HistoryStats/src/colbase_words.h b/plugins/HistoryStats/src/colbase_words.h
index 2d9ef4c667..c73a1cda09 100644
--- a/plugins/HistoryStats/src/colbase_words.h
+++ b/plugins/HistoryStats/src/colbase_words.h
@@ -47,10 +47,10 @@ protected:
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual ext::string impl_contactDataGetUID() const;
virtual void impl_contactDataBeginAcquire();
- virtual void impl_contactDataPrepare(Contact& contact) const;
- virtual void impl_contactDataFree(Contact& contact) const;
- virtual void impl_contactDataAcquireMessage(Contact& contact, Message& msg);
- virtual void impl_contactDataMerge(Contact& contact, const Contact& include) const;
+ virtual void impl_contactDataPrepare(CContact& contact) const;
+ virtual void impl_contactDataFree(CContact& contact) const;
+ virtual void impl_contactDataAcquireMessage(CContact& contact, Message& msg);
+ virtual void impl_contactDataMerge(CContact& contact, const CContact& include) const;
public:
const ColFilterSet& getFilterWords() const { return m_FilterWords; }
diff --git a/plugins/HistoryStats/src/column.h b/plugins/HistoryStats/src/column.h
index 495c65b5f3..2cc401ee39 100644
--- a/plugins/HistoryStats/src/column.h
+++ b/plugins/HistoryStats/src/column.h
@@ -183,13 +183,13 @@ public:
ext::string contactDataGetUID() const { return impl_contactDataGetUID(); }
void contactDataBeginAcquire() { impl_contactDataBeginAcquire(); }
void contactDataEndAcquire() { impl_contactDataEndAcquire(); }
- void contactDataPrepare(Contact& contact) const { impl_contactDataPrepare(contact); }
- void contactDataFree(Contact& contact) const { impl_contactDataFree(contact); }
- void contactDataAcquireMessage(Contact& contact, Message& msg) { impl_contactDataAcquireMessage(contact, msg); }
- void contactDataAcquireChat(Contact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration) { impl_contactDataAcquireChat(contact, bOutgoing, localTimestampStarted, duration); }
- void contactDataMerge(Contact& contact, const Contact& include) const { impl_contactDataMerge(contact, include); }
- void contactDataTransform(Contact& contact) const { impl_contactDataTransform(contact); }
- void contactDataTransformCleanup(Contact& contact) const { impl_contactDataTransformCleanup(contact); }
+ void contactDataPrepare(CContact& contact) const { impl_contactDataPrepare(contact); }
+ void contactDataFree(CContact& contact) const { impl_contactDataFree(contact); }
+ void contactDataAcquireMessage(CContact& contact, Message& msg) { impl_contactDataAcquireMessage(contact, msg); }
+ void contactDataAcquireChat(CContact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration) { impl_contactDataAcquireChat(contact, bOutgoing, localTimestampStarted, duration); }
+ void contactDataMerge(CContact& contact, const CContact& include) const { impl_contactDataMerge(contact, include); }
+ void contactDataTransform(CContact& contact) const { impl_contactDataTransform(contact); }
+ void contactDataTransformCleanup(CContact& contact) const { impl_contactDataTransformCleanup(contact); }
void columnDataBeforeOmit() { impl_columnDataBeforeOmit(); }
void columnDataAfterOmit() { impl_columnDataAfterOmit(); }
StyleList outputGetAdditionalStyles(IDProvider& idp) { return impl_outputGetAdditionalStyles(idp); }
@@ -197,7 +197,7 @@ public:
void outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const { impl_outputRenderHeader(tos, row, rowSpan); }
void outputBegin();
void outputEnd() { impl_outputEnd(); }
- void outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display) { impl_outputRenderRow(tos, contact, display); }
+ void outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display) { impl_outputRenderRow(tos, contact, display); }
protected:
/*** VIRTUAL/ABSTRACT *** GLOBAL ***/
@@ -287,28 +287,28 @@ protected:
* data for given contact. Works on previously defined slot.
* [virtual/default: do nothing]
*/
- virtual void impl_contactDataPrepare(Contact&) const { }
+ virtual void impl_contactDataPrepare(CContact&) const { }
/*
* Frees all data structures associated with this column for the
* given contact. Works on previously defined slot.
* [virtual/default: do nothing]
*/
- virtual void impl_contactDataFree(Contact&) const { }
+ virtual void impl_contactDataFree(CContact&) const { }
/*
* Acquires data for this column and for the given contact. Works
* on previously defined slot.
* [virtual/default: do nothing]
*/
- virtual void impl_contactDataAcquireMessage(Contact&, Message&) { }
+ virtual void impl_contactDataAcquireMessage(CContact&, Message&) { }
/*
* Acquires data for this column and for the given contact. Works
* on previously defined slot.
* [virtual/default: do nothing]
*/
- virtual void impl_contactDataAcquireChat(Contact&, bool, uint32_t, uint32_t) { }
+ virtual void impl_contactDataAcquireChat(CContact&, bool, uint32_t, uint32_t) { }
/*** VIRTUAL/ABSTRACT *** DATA POSTPROCESSING ***/
@@ -317,20 +317,20 @@ protected:
* column doesn't acquire any data.
* [virtual/default: do nothing]
*/
- virtual void impl_contactDataMerge(Contact&, const Contact&) const { }
+ virtual void impl_contactDataMerge(CContact&, const CContact&) const { }
/*
* Perform any post processing for additional per-contact data. Will
* be called after merge but before sort.
* [virtual/default: do nothing]
*/
- virtual void impl_contactDataTransform(Contact&) const { }
+ virtual void impl_contactDataTransform(CContact&) const { }
/*
* Perform cleanup after post processing.
* [virtual/default: do nothing]
*/
- virtual void impl_contactDataTransformCleanup(Contact&) const { }
+ virtual void impl_contactDataTransformCleanup(CContact&) const { }
/*** VIRTUAL/ABSTRACT *** COLUMN SPECIFIC GLOBAL DATA ***/
@@ -385,7 +385,7 @@ protected:
* modfies rendering depending on value in "display".
* [virtual/abstract]
*/
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display) = 0;
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display) = 0;
};
#endif // HISTORYSTATS_GUARD_COLUMN_H
diff --git a/plugins/HistoryStats/src/column_chatduration.cpp b/plugins/HistoryStats/src/column_chatduration.cpp
index 3e6b0cae76..adcdca36ee 100644
--- a/plugins/HistoryStats/src/column_chatduration.cpp
+++ b/plugins/HistoryStats/src/column_chatduration.cpp
@@ -98,18 +98,18 @@ void ColChatDuration::impl_columnDataAfterOmit()
// AFTER, i.e. contacts are trimmed to what user will see
if (m_bGraph) {
- static uint32_t (Contact::*getChatDurX[4])() const = {
- &Contact::getChatDurMin,
- &Contact::getChatDurAvg,
- &Contact::getChatDurMax,
- &Contact::getChatDurSum,
+ static uint32_t (CContact::*getChatDurX[4])() const = {
+ &CContact::getChatDurMin,
+ &CContact::getChatDurAvg,
+ &CContact::getChatDurMax,
+ &CContact::getChatDurSum,
};
m_nMaxForGraph = 1;
upto_each_(i, getStatistic()->countContacts())
{
- const Contact& cur = getStatistic()->getContact(i);
+ const CContact& cur = getStatistic()->getContact(i);
if (cur.isChatDurValid())
m_nMaxForGraph = max(m_nMaxForGraph, (cur.*getChatDurX[m_nVisMode])());
@@ -125,13 +125,13 @@ void ColChatDuration::impl_columnDataAfterOmit()
}
}
-void ColChatDuration::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display)
+void ColChatDuration::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display)
{
- static uint32_t (Contact::*getChatDurX[4])() const = {
- &Contact::getChatDurMin,
- &Contact::getChatDurAvg,
- &Contact::getChatDurMax,
- &Contact::getChatDurSum,
+ static uint32_t (CContact::*getChatDurX[4])() const = {
+ &CContact::getChatDurMin,
+ &CContact::getChatDurAvg,
+ &CContact::getChatDurMax,
+ &CContact::getChatDurSum,
};
// begin output
diff --git a/plugins/HistoryStats/src/column_chatduration.h b/plugins/HistoryStats/src/column_chatduration.h
index ac6a014562..f6af1212fb 100644
--- a/plugins/HistoryStats/src/column_chatduration.h
+++ b/plugins/HistoryStats/src/column_chatduration.h
@@ -40,7 +40,7 @@ protected:
virtual void impl_columnDataAfterOmit();
virtual StyleList impl_outputGetAdditionalStyles(IDProvider& idp);
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_CHATDURATION_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/column_events.cpp b/plugins/HistoryStats/src/column_events.cpp
index e51d79d1e8..7439c22266 100644
--- a/plugins/HistoryStats/src/column_events.cpp
+++ b/plugins/HistoryStats/src/column_events.cpp
@@ -68,12 +68,12 @@ void ColEvents::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan)
}
}
-void ColEvents::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType)
+void ColEvents::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType)
{
- static int (Contact::*getData[3])() const = {
- &Contact::getInFiles,
- &Contact::getOutFiles,
- &Contact::getTotalFiles,
+ static int (CContact::*getData[3])() const = {
+ &CContact::getInFiles,
+ &CContact::getOutFiles,
+ &CContact::getTotalFiles,
};
tos << L"<td class=\"num\">"
diff --git a/plugins/HistoryStats/src/column_events.h b/plugins/HistoryStats/src/column_events.h
index 5fd9d52dff..ccebe37dd8 100644
--- a/plugins/HistoryStats/src/column_events.h
+++ b/plugins/HistoryStats/src/column_events.h
@@ -30,7 +30,7 @@ protected:
virtual void impl_configFromUI(OptionsCtrl& Opt);
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_EVENTS_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/column_group.cpp b/plugins/HistoryStats/src/column_group.cpp
index 740e97d0e1..3c4dc6c827 100644
--- a/plugins/HistoryStats/src/column_group.cpp
+++ b/plugins/HistoryStats/src/column_group.cpp
@@ -13,7 +13,7 @@ void ColGroup::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan)
}
}
-void ColGroup::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display)
+void ColGroup::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display)
{
if (display == asContact)
{
diff --git a/plugins/HistoryStats/src/column_group.h b/plugins/HistoryStats/src/column_group.h
index 4683bdb47e..d4cb88b614 100644
--- a/plugins/HistoryStats/src/column_group.h
+++ b/plugins/HistoryStats/src/column_group.h
@@ -17,7 +17,7 @@ protected:
virtual int impl_getFeatures() const { return 0; }
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_GROUP_H
diff --git a/plugins/HistoryStats/src/column_inout.cpp b/plugins/HistoryStats/src/column_inout.cpp
index 4a7ab6aec8..257519707f 100644
--- a/plugins/HistoryStats/src/column_inout.cpp
+++ b/plugins/HistoryStats/src/column_inout.cpp
@@ -120,20 +120,20 @@ void ColInOut::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan)
}
}
-void ColInOut::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType)
+void ColInOut::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType)
{
if (m_bAbsolute)
{
- static int (Contact::*getData[])() const = {
- &Contact::getInBytes,
- &Contact::getOutBytes,
- &Contact::getTotalBytes,
- &Contact::getInMessages,
- &Contact::getOutMessages,
- &Contact::getTotalMessages,
- &Contact::getInChats,
- &Contact::getOutChats,
- &Contact::getTotalChats,
+ static int (CContact::*getData[])() const = {
+ &CContact::getInBytes,
+ &CContact::getOutBytes,
+ &CContact::getTotalBytes,
+ &CContact::getInMessages,
+ &CContact::getOutMessages,
+ &CContact::getTotalMessages,
+ &CContact::getInChats,
+ &CContact::getOutChats,
+ &CContact::getTotalChats,
};
tos << L"<td class=\"num\">"
@@ -142,16 +142,16 @@ void ColInOut::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, D
}
else
{
- static double (Contact::*getData[])() const = {
- &Contact::getInBytesAvg,
- &Contact::getOutBytesAvg,
- &Contact::getTotalBytesAvg,
- &Contact::getInMessagesAvg,
- &Contact::getOutMessagesAvg,
- &Contact::getTotalMessagesAvg,
- &Contact::getInChatsAvg,
- &Contact::getOutChatsAvg,
- &Contact::getTotalChatsAvg,
+ static double (CContact::*getData[])() const = {
+ &CContact::getInBytesAvg,
+ &CContact::getOutBytesAvg,
+ &CContact::getTotalBytesAvg,
+ &CContact::getInMessagesAvg,
+ &CContact::getOutMessagesAvg,
+ &CContact::getTotalMessagesAvg,
+ &CContact::getInChatsAvg,
+ &CContact::getOutChatsAvg,
+ &CContact::getTotalChatsAvg,
};
static const double avgFactor[] = {
diff --git a/plugins/HistoryStats/src/column_inout.h b/plugins/HistoryStats/src/column_inout.h
index c1ece71bff..fd8be4025e 100644
--- a/plugins/HistoryStats/src/column_inout.h
+++ b/plugins/HistoryStats/src/column_inout.h
@@ -34,7 +34,7 @@ protected:
virtual void impl_configFromUI(OptionsCtrl& Opt);
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_INOUT_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/column_inoutgraph.cpp b/plugins/HistoryStats/src/column_inoutgraph.cpp
index f5f10559fd..f293ac1f95 100644
--- a/plugins/HistoryStats/src/column_inoutgraph.cpp
+++ b/plugins/HistoryStats/src/column_inoutgraph.cpp
@@ -168,20 +168,20 @@ void ColInOutGraph::impl_outputRenderHeader(ext::ostream& tos, int row, int rowS
}
}
-void ColInOutGraph::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType)
+void ColInOutGraph::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType)
{
// fetch absolute values
- static int (Contact::*getOut[3])() const = { &Contact::getOutBytes, &Contact::getOutMessages, &Contact::getOutChats };
- static int (Contact::*getIn[3])() const = { &Contact::getInBytes, &Contact::getInMessages, &Contact::getInChats };
+ static int (CContact::*getOut[3])() const = { &CContact::getOutBytes, &CContact::getOutMessages, &CContact::getOutChats };
+ static int (CContact::*getIn[3])() const = { &CContact::getInBytes, &CContact::getInMessages, &CContact::getInChats };
int numOut = (contact.*getOut[m_nSource])();
int numIn = (contact.*getIn[m_nSource])();
int numTotal = numOut + numIn;
// fetch average values
- static double (Contact::*getAvgOut[3])() const = { &Contact::getOutBytesAvg, &Contact::getOutMessagesAvg, &Contact::getOutChatsAvg };
- static double (Contact::*getAvgIn[3])() const = { &Contact::getInBytesAvg, &Contact::getInMessagesAvg, &Contact::getInChatsAvg };
- static double (Contact::*getAvgTotal[3])() const = { &Contact::getTotalBytesAvg, &Contact::getTotalMessagesAvg, &Contact::getTotalChatsAvg };
+ static double (CContact::*getAvgOut[3])() const = { &CContact::getOutBytesAvg, &CContact::getOutMessagesAvg, &CContact::getOutChatsAvg };
+ static double (CContact::*getAvgIn[3])() const = { &CContact::getInBytesAvg, &CContact::getInMessagesAvg, &CContact::getInChatsAvg };
+ static double (CContact::*getAvgTotal[3])() const = { &CContact::getTotalBytesAvg, &CContact::getTotalMessagesAvg, &CContact::getTotalChatsAvg };
static const double avgFactor[] = {
60.0 * 60.0 * 24.0,
diff --git a/plugins/HistoryStats/src/column_inoutgraph.h b/plugins/HistoryStats/src/column_inoutgraph.h
index 6b08170ff4..40acdff87c 100644
--- a/plugins/HistoryStats/src/column_inoutgraph.h
+++ b/plugins/HistoryStats/src/column_inoutgraph.h
@@ -48,7 +48,7 @@ protected:
virtual StyleList impl_outputGetAdditionalStyles(IDProvider& idp);
virtual SIZE impl_outputMeasureHeader() const;
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_INOUTGRAPH_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/column_nick.cpp b/plugins/HistoryStats/src/column_nick.cpp
index 948656d5d1..6b665232d7 100644
--- a/plugins/HistoryStats/src/column_nick.cpp
+++ b/plugins/HistoryStats/src/column_nick.cpp
@@ -56,7 +56,7 @@ void ColNick::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) c
}
}
-void ColNick::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display)
+void ColNick::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display)
{
tos << L"<td";
diff --git a/plugins/HistoryStats/src/column_nick.h b/plugins/HistoryStats/src/column_nick.h
index b11959838e..1dea54b2e3 100644
--- a/plugins/HistoryStats/src/column_nick.h
+++ b/plugins/HistoryStats/src/column_nick.h
@@ -32,7 +32,7 @@ protected:
virtual void impl_configFromUI(OptionsCtrl& Opt);
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_NICK_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/column_protocol.cpp b/plugins/HistoryStats/src/column_protocol.cpp
index ac583492ac..0e7f0fb81a 100644
--- a/plugins/HistoryStats/src/column_protocol.cpp
+++ b/plugins/HistoryStats/src/column_protocol.cpp
@@ -11,7 +11,7 @@ void ColProtocol::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpa
writeRowspanTD(tos, getCustomTitle(TranslateT("Protocol"), TranslateT("Protocol")), row, 1, rowSpan);
}
-void ColProtocol::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display)
+void ColProtocol::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display)
{
if (display == asContact)
tos << L"<td>" << utils::htmlEscape(contact.getProtocol()) << L"</td>" << ext::endl;
diff --git a/plugins/HistoryStats/src/column_protocol.h b/plugins/HistoryStats/src/column_protocol.h
index 1fc303e91f..a3cdb83b19 100644
--- a/plugins/HistoryStats/src/column_protocol.h
+++ b/plugins/HistoryStats/src/column_protocol.h
@@ -17,7 +17,7 @@ protected:
virtual int impl_getFeatures() const { return 0; }
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
diff --git a/plugins/HistoryStats/src/column_rank.cpp b/plugins/HistoryStats/src/column_rank.cpp
index 93f2027961..f0e8368a22 100644
--- a/plugins/HistoryStats/src/column_rank.cpp
+++ b/plugins/HistoryStats/src/column_rank.cpp
@@ -16,7 +16,7 @@ void ColRank::impl_outputBegin()
m_nNextRank = 1;
}
-void ColRank::impl_outputRenderRow(ext::ostream& tos, const Contact&, DisplayType display)
+void ColRank::impl_outputRenderRow(ext::ostream& tos, const CContact&, DisplayType display)
{
if (display == asContact)
tos << L"<td class=\"num\">"
diff --git a/plugins/HistoryStats/src/column_rank.h b/plugins/HistoryStats/src/column_rank.h
index fddadbaae7..b7ba469a1c 100644
--- a/plugins/HistoryStats/src/column_rank.h
+++ b/plugins/HistoryStats/src/column_rank.h
@@ -21,7 +21,7 @@ protected:
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
virtual void impl_outputBegin();
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_RANK_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/column_split.cpp b/plugins/HistoryStats/src/column_split.cpp
index 1866d0f765..b1cc140530 100644
--- a/plugins/HistoryStats/src/column_split.cpp
+++ b/plugins/HistoryStats/src/column_split.cpp
@@ -167,7 +167,7 @@ void ColSplit::impl_contactDataBeginAcquire()
}
}
-void ColSplit::impl_contactDataPrepare(Contact& contact) const
+void ColSplit::impl_contactDataPrepare(CContact& contact) const
{
SplitParams params = getParams();
@@ -181,7 +181,7 @@ void ColSplit::impl_contactDataPrepare(Contact& contact) const
contact.setSlot(contactDataSlotGet(), pData);
}
-void ColSplit::impl_contactDataFree(Contact& contact) const
+void ColSplit::impl_contactDataFree(CContact& contact) const
{
int* pData = reinterpret_cast<int*>(contact.getSlot(contactDataSlotGet()));
@@ -192,7 +192,7 @@ void ColSplit::impl_contactDataFree(Contact& contact) const
}
}
-void ColSplit::addToSlot(Contact& contact, uint32_t localTimestamp, int toAdd)
+void ColSplit::addToSlot(CContact& contact, uint32_t localTimestamp, int toAdd)
{
if (toAdd > 0)
{
@@ -202,7 +202,7 @@ void ColSplit::addToSlot(Contact& contact, uint32_t localTimestamp, int toAdd)
}
}
-void ColSplit::impl_contactDataAcquireMessage(Contact& contact, Message& msg)
+void ColSplit::impl_contactDataAcquireMessage(CContact& contact, Message& msg)
{
if (!msg.isOutgoing() && m_nSourceType == 0 || msg.isOutgoing() && m_nSourceType == 1 || m_nSourceType == 2)
{
@@ -217,7 +217,7 @@ void ColSplit::impl_contactDataAcquireMessage(Contact& contact, Message& msg)
}
}
-void ColSplit::impl_contactDataAcquireChat(Contact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t)
+void ColSplit::impl_contactDataAcquireChat(CContact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t)
{
if (m_nSource == 2 && (!bOutgoing && m_nSourceType == 0 || bOutgoing && m_nSourceType == 1 || m_nSourceType == 2))
{
@@ -225,7 +225,7 @@ void ColSplit::impl_contactDataAcquireChat(Contact& contact, bool bOutgoing, uin
}
}
-void ColSplit::impl_contactDataMerge(Contact& contact, const Contact& include) const
+void ColSplit::impl_contactDataMerge(CContact& contact, const CContact& include) const
{
SplitParams params = getParams();
@@ -340,7 +340,7 @@ ColSplit::SplitParams ColSplit::getParams() const
return params;
}
-void ColSplit::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType)
+void ColSplit::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType)
{
SplitParams params = getParams();
diff --git a/plugins/HistoryStats/src/column_split.h b/plugins/HistoryStats/src/column_split.h
index 88284554f4..02a36c32f5 100644
--- a/plugins/HistoryStats/src/column_split.h
+++ b/plugins/HistoryStats/src/column_split.h
@@ -43,7 +43,7 @@ private:
private:
SplitParams getParams() const;
- void addToSlot(Contact& contact, uint32_t localTimestamp, int toAdd);
+ void addToSlot(CContact& contact, uint32_t localTimestamp, int toAdd);
public:
explicit ColSplit();
@@ -61,14 +61,14 @@ protected:
virtual int impl_configGetRestrictions(ext::string* pDetails) const;
virtual ext::string impl_contactDataGetUID() const;
virtual void impl_contactDataBeginAcquire();
- virtual void impl_contactDataPrepare(Contact& contact) const;
- virtual void impl_contactDataFree(Contact& contact) const;
- virtual void impl_contactDataAcquireMessage(Contact& contact, Message& msg);
- virtual void impl_contactDataAcquireChat(Contact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration);
- virtual void impl_contactDataMerge(Contact& contact, const Contact& include) const;
+ virtual void impl_contactDataPrepare(CContact& contact) const;
+ virtual void impl_contactDataFree(CContact& contact) const;
+ virtual void impl_contactDataAcquireMessage(CContact& contact, Message& msg);
+ virtual void impl_contactDataAcquireChat(CContact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration);
+ virtual void impl_contactDataMerge(CContact& contact, const CContact& include) const;
virtual StyleList impl_outputGetAdditionalStyles(IDProvider& idp);
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_SPLIT_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/column_splittimeline.cpp b/plugins/HistoryStats/src/column_splittimeline.cpp
index 8737fe7879..1d63efa2c4 100644
--- a/plugins/HistoryStats/src/column_splittimeline.cpp
+++ b/plugins/HistoryStats/src/column_splittimeline.cpp
@@ -187,14 +187,14 @@ void ColSplitTimeline::impl_contactDataBeginAcquire()
}
}
-void ColSplitTimeline::impl_contactDataPrepare(Contact& contact) const
+void ColSplitTimeline::impl_contactDataPrepare(CContact& contact) const
{
TimelineMap* pData = new TimelineMap;
contact.setSlot(contactDataSlotGet(), pData);
}
-void ColSplitTimeline::impl_contactDataFree(Contact& contact) const
+void ColSplitTimeline::impl_contactDataFree(CContact& contact) const
{
TimelineMap* pData = reinterpret_cast<TimelineMap*>(contact.getSlot(contactDataSlotGet()));
@@ -205,7 +205,7 @@ void ColSplitTimeline::impl_contactDataFree(Contact& contact) const
}
}
-void ColSplitTimeline::addToSlot(Contact& contact, bool bOutgoing, uint32_t localTimestamp, int toAdd)
+void ColSplitTimeline::addToSlot(CContact& contact, bool bOutgoing, uint32_t localTimestamp, int toAdd)
{
if (toAdd > 0)
{
@@ -217,7 +217,7 @@ void ColSplitTimeline::addToSlot(Contact& contact, bool bOutgoing, uint32_t loca
}
}
-void ColSplitTimeline::impl_contactDataAcquireMessage(Contact& contact, Message& msg)
+void ColSplitTimeline::impl_contactDataAcquireMessage(CContact& contact, Message& msg)
{
if (m_nSource == 0)
{
@@ -229,7 +229,7 @@ void ColSplitTimeline::impl_contactDataAcquireMessage(Contact& contact, Message&
}
}
-void ColSplitTimeline::impl_contactDataAcquireChat(Contact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t)
+void ColSplitTimeline::impl_contactDataAcquireChat(CContact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t)
{
if (m_nSource == 2)
{
@@ -237,7 +237,7 @@ void ColSplitTimeline::impl_contactDataAcquireChat(Contact& contact, bool bOutgo
}
}
-void ColSplitTimeline::impl_contactDataMerge(Contact& contact, const Contact& include) const
+void ColSplitTimeline::impl_contactDataMerge(CContact& contact, const CContact& include) const
{
TimelineMap* pData = reinterpret_cast<TimelineMap*>(contact.getSlot(contactDataSlotGet()));
const TimelineMap* pIncData = reinterpret_cast<const TimelineMap*>(include.getSlot(contactDataSlotGet()));
@@ -357,7 +357,7 @@ void ColSplitTimeline::impl_columnDataAfterOmit()
m_nTimelineWidth = 3 * ((m_nNumBlocks + params.blocks_in_column * params.columns_to_group - 1) / (params.blocks_in_column * params.columns_to_group));
}
-void ColSplitTimeline::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display)
+void ColSplitTimeline::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display)
{
if (m_nSourceType != 3)
{
@@ -420,7 +420,7 @@ ColSplitTimeline::SplitParams ColSplitTimeline::getParams() const
return params;
}
-void ColSplitTimeline::outputRenderRowInOut(ext::ostream& tos, const Contact& contact, DisplayType)
+void ColSplitTimeline::outputRenderRowInOut(ext::ostream& tos, const CContact& contact, DisplayType)
{
SplitParams params = getParams();
const TimelineMap* pData = reinterpret_cast<const TimelineMap*>(contact.getSlot(contactDataSlotGet()));
@@ -554,7 +554,7 @@ void ColSplitTimeline::outputRenderRowInOut(ext::ostream& tos, const Contact& co
tos << L"</td>" << ext::endl;
}
-void ColSplitTimeline::outputRenderRowRatio(ext::ostream& tos, const Contact& contact, DisplayType)
+void ColSplitTimeline::outputRenderRowRatio(ext::ostream& tos, const CContact& contact, DisplayType)
{
SplitParams params = getParams();
const TimelineMap* pData = reinterpret_cast<const TimelineMap*>(contact.getSlot(contactDataSlotGet()));
diff --git a/plugins/HistoryStats/src/column_splittimeline.h b/plugins/HistoryStats/src/column_splittimeline.h
index 89fc04e4bb..53a7bf987e 100644
--- a/plugins/HistoryStats/src/column_splittimeline.h
+++ b/plugins/HistoryStats/src/column_splittimeline.h
@@ -67,10 +67,10 @@ private:
}
SplitParams getParams() const;
- void addToSlot(Contact& contact, bool bOutgoing, uint32_t localTimestamp, int toAdd);
+ void addToSlot(CContact& contact, bool bOutgoing, uint32_t localTimestamp, int toAdd);
- void outputRenderRowInOut(ext::ostream& tos, const Contact& contact, DisplayType display);
- void outputRenderRowRatio(ext::ostream& tos, const Contact& contact, DisplayType display);
+ void outputRenderRowInOut(ext::ostream& tos, const CContact& contact, DisplayType display);
+ void outputRenderRowRatio(ext::ostream& tos, const CContact& contact, DisplayType display);
public:
explicit ColSplitTimeline();
@@ -88,14 +88,14 @@ protected:
virtual int impl_configGetRestrictions(ext::string*) const { return crPNGFull; }
virtual ext::string impl_contactDataGetUID() const;
virtual void impl_contactDataBeginAcquire();
- virtual void impl_contactDataPrepare(Contact& contact) const;
- virtual void impl_contactDataFree(Contact& contact) const;
- virtual void impl_contactDataAcquireMessage(Contact& contact, Message& msg);
- virtual void impl_contactDataAcquireChat(Contact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration);
- virtual void impl_contactDataMerge(Contact& contact, const Contact& include) const;
+ virtual void impl_contactDataPrepare(CContact& contact) const;
+ virtual void impl_contactDataFree(CContact& contact) const;
+ virtual void impl_contactDataAcquireMessage(CContact& contact, Message& msg);
+ virtual void impl_contactDataAcquireChat(CContact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration);
+ virtual void impl_contactDataMerge(CContact& contact, const CContact& include) const;
virtual void impl_columnDataAfterOmit();
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_SPLITTIMELINE_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/column_timeline.cpp b/plugins/HistoryStats/src/column_timeline.cpp
index 1910701edd..96d7d52374 100644
--- a/plugins/HistoryStats/src/column_timeline.cpp
+++ b/plugins/HistoryStats/src/column_timeline.cpp
@@ -99,14 +99,14 @@ ext::string ColTimeline::impl_contactDataGetUID() const
return ext::str(ext::format(L"timeline-|") % m_nSource);
}
-void ColTimeline::impl_contactDataPrepare(Contact& contact) const
+void ColTimeline::impl_contactDataPrepare(CContact& contact) const
{
TimelineMap* pData = new TimelineMap;
contact.setSlot(contactDataSlotGet(), pData);
}
-void ColTimeline::impl_contactDataFree(Contact& contact) const
+void ColTimeline::impl_contactDataFree(CContact& contact) const
{
TimelineMap* pData = reinterpret_cast<TimelineMap*>(contact.getSlot(contactDataSlotGet()));
@@ -117,7 +117,7 @@ void ColTimeline::impl_contactDataFree(Contact& contact) const
}
}
-void ColTimeline::addToSlot(Contact& contact, bool bOutgoing, uint32_t localTimestamp, int toAdd)
+void ColTimeline::addToSlot(CContact& contact, bool bOutgoing, uint32_t localTimestamp, int toAdd)
{
if (toAdd > 0)
{
@@ -129,7 +129,7 @@ void ColTimeline::addToSlot(Contact& contact, bool bOutgoing, uint32_t localTime
}
}
-void ColTimeline::impl_contactDataAcquireMessage(Contact& contact, Message& msg)
+void ColTimeline::impl_contactDataAcquireMessage(CContact& contact, Message& msg)
{
if (m_nSource == 0)
{
@@ -141,7 +141,7 @@ void ColTimeline::impl_contactDataAcquireMessage(Contact& contact, Message& msg)
}
}
-void ColTimeline::impl_contactDataAcquireChat(Contact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t)
+void ColTimeline::impl_contactDataAcquireChat(CContact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t)
{
if (m_nSource == 2)
{
@@ -149,7 +149,7 @@ void ColTimeline::impl_contactDataAcquireChat(Contact& contact, bool bOutgoing,
}
}
-void ColTimeline::impl_contactDataMerge(Contact& contact, const Contact& include) const
+void ColTimeline::impl_contactDataMerge(CContact& contact, const CContact& include) const
{
TimelineMap* pData = reinterpret_cast<TimelineMap*>(contact.getSlot(contactDataSlotGet()));
const TimelineMap* pIncData = reinterpret_cast<const TimelineMap*>(include.getSlot(contactDataSlotGet()));
@@ -230,7 +230,7 @@ void ColTimeline::impl_columnDataAfterOmit()
m_nTimelineWidth = 3 * (1 + (m_nLastDay - m_nFirstDay) / m_nDays);
}
-void ColTimeline::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display)
+void ColTimeline::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display)
{
if (m_nSourceType != 3)
{
@@ -242,7 +242,7 @@ void ColTimeline::impl_outputRenderRow(ext::ostream& tos, const Contact& contact
}
}
-void ColTimeline::outputRenderRowInOut(ext::ostream& tos, const Contact& contact, DisplayType)
+void ColTimeline::outputRenderRowInOut(ext::ostream& tos, const CContact& contact, DisplayType)
{
const TimelineMap* pData = reinterpret_cast<const TimelineMap*>(contact.getSlot(contactDataSlotGet()));
@@ -381,7 +381,7 @@ void ColTimeline::outputRenderRowInOut(ext::ostream& tos, const Contact& contact
}
}
-void ColTimeline::outputRenderRowRatio(ext::ostream& tos, const Contact& contact, DisplayType)
+void ColTimeline::outputRenderRowRatio(ext::ostream& tos, const CContact& contact, DisplayType)
{
const TimelineMap* pData = reinterpret_cast<const TimelineMap*>(contact.getSlot(contactDataSlotGet()));
diff --git a/plugins/HistoryStats/src/column_timeline.h b/plugins/HistoryStats/src/column_timeline.h
index 751b296ce1..e81618132f 100644
--- a/plugins/HistoryStats/src/column_timeline.h
+++ b/plugins/HistoryStats/src/column_timeline.h
@@ -43,10 +43,10 @@ private:
return 0;
}
- void addToSlot(Contact& contact, bool bOutgoing, uint32_t localTimestamp, int toAdd);
+ void addToSlot(CContact& contact, bool bOutgoing, uint32_t localTimestamp, int toAdd);
- void outputRenderRowInOut(ext::ostream& tos, const Contact& contact, DisplayType display);
- void outputRenderRowRatio(ext::ostream& tos, const Contact& contact, DisplayType display);
+ void outputRenderRowInOut(ext::ostream& tos, const CContact& contact, DisplayType display);
+ void outputRenderRowRatio(ext::ostream& tos, const CContact& contact, DisplayType display);
public:
explicit ColTimeline();
@@ -63,15 +63,15 @@ protected:
virtual void impl_configFromUI(OptionsCtrl& Opt);
virtual int impl_configGetRestrictions(ext::string* pDetails) const;
virtual ext::string impl_contactDataGetUID() const;
- virtual void impl_contactDataPrepare(Contact& contact) const;
- virtual void impl_contactDataFree(Contact& contact) const;
- virtual void impl_contactDataAcquireMessage(Contact& contact, Message& msg);
- virtual void impl_contactDataAcquireChat(Contact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration);
- virtual void impl_contactDataMerge(Contact& contact, const Contact& include) const;
+ virtual void impl_contactDataPrepare(CContact& contact) const;
+ virtual void impl_contactDataFree(CContact& contact) const;
+ virtual void impl_contactDataAcquireMessage(CContact& contact, Message& msg);
+ virtual void impl_contactDataAcquireChat(CContact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration);
+ virtual void impl_contactDataMerge(CContact& contact, const CContact& include) const;
virtual void impl_columnDataAfterOmit();
virtual StyleList impl_outputGetAdditionalStyles(IDProvider& idp);
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_TIMELINE_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/column_wordcount.cpp b/plugins/HistoryStats/src/column_wordcount.cpp
index e764e378de..7de0db68b8 100644
--- a/plugins/HistoryStats/src/column_wordcount.cpp
+++ b/plugins/HistoryStats/src/column_wordcount.cpp
@@ -63,7 +63,7 @@ void ColWordCount::impl_configFromUI(OptionsCtrl& Opt)
m_bDetail = Opt.isItemChecked (m_hDetail );
}
-void ColWordCount::impl_contactDataFree(Contact& contact) const
+void ColWordCount::impl_contactDataFree(CContact& contact) const
{
ColBaseWords::impl_contactDataFree(contact);
@@ -76,7 +76,7 @@ void ColWordCount::impl_contactDataFree(Contact& contact) const
}
}
-void ColWordCount::impl_contactDataTransform(Contact& contact) const
+void ColWordCount::impl_contactDataTransform(CContact& contact) const
{
WordMap* pData = reinterpret_cast<WordMap*>(contact.getSlot(contactDataSlotGet()));
size_t* pTrData = new size_t[2];
@@ -95,7 +95,7 @@ void ColWordCount::impl_contactDataTransform(Contact& contact) const
pTrData[1] = pData->size();
}
-void ColWordCount::impl_contactDataTransformCleanup(Contact& contact) const
+void ColWordCount::impl_contactDataTransformCleanup(CContact& contact) const
{
WordMap* pData = reinterpret_cast<WordMap*>(contact.getSlot(contactDataSlotGet()));
@@ -132,7 +132,7 @@ void ColWordCount::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSp
}
}
-void ColWordCount::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType)
+void ColWordCount::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType)
{
const size_t* pWordCount = reinterpret_cast<const size_t*>(contact.getSlot(contactDataTransformSlotGet()));
diff --git a/plugins/HistoryStats/src/column_wordcount.h b/plugins/HistoryStats/src/column_wordcount.h
index e29b6836aa..93f52a3ed2 100644
--- a/plugins/HistoryStats/src/column_wordcount.h
+++ b/plugins/HistoryStats/src/column_wordcount.h
@@ -29,11 +29,11 @@ protected:
virtual void impl_configWrite(SettingsTree& settings) const;
virtual void impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup);
virtual void impl_configFromUI(OptionsCtrl& Opt);
- virtual void impl_contactDataFree(Contact& contact) const;
- virtual void impl_contactDataTransform(Contact& contact) const;
- virtual void impl_contactDataTransformCleanup(Contact& contact) const;
+ virtual void impl_contactDataFree(CContact& contact) const;
+ virtual void impl_contactDataTransform(CContact& contact) const;
+ virtual void impl_contactDataTransformCleanup(CContact& contact) const;
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_WORDCOUNT_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/column_words.cpp b/plugins/HistoryStats/src/column_words.cpp
index 47028ffccf..0cb5b1e053 100644
--- a/plugins/HistoryStats/src/column_words.cpp
+++ b/plugins/HistoryStats/src/column_words.cpp
@@ -165,7 +165,7 @@ void ColWords::impl_configFromUI(OptionsCtrl& Opt)
utils::ensureRange(m_nNum, 1, 1000, 10);
}
-void ColWords::impl_contactDataFree(Contact& contact) const
+void ColWords::impl_contactDataFree(CContact& contact) const
{
ColBaseWords::impl_contactDataFree(contact);
@@ -178,7 +178,7 @@ void ColWords::impl_contactDataFree(Contact& contact) const
}
}
-void ColWords::impl_contactDataTransform(Contact& contact) const
+void ColWords::impl_contactDataTransform(CContact& contact) const
{
WordMap* pData = reinterpret_cast<WordMap*>(contact.getSlot(contactDataSlotGet()));
WordList* pTrData = new WordList;
@@ -188,7 +188,7 @@ void ColWords::impl_contactDataTransform(Contact& contact) const
generateWords(pData, pTrData);
}
-void ColWords::impl_contactDataTransformCleanup(Contact& contact) const
+void ColWords::impl_contactDataTransformCleanup(CContact& contact) const
{
WordMap* pData = reinterpret_cast<WordMap*>(contact.getSlot(contactDataSlotGet()));
@@ -238,7 +238,7 @@ void ColWords::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan)
}
}
-void ColWords::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType)
+void ColWords::impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType)
{
const WordList* pWords = reinterpret_cast<const WordList*>(contact.getSlot(contactDataTransformSlotGet()));
diff --git a/plugins/HistoryStats/src/column_words.h b/plugins/HistoryStats/src/column_words.h
index d215fd4753..915b058ac3 100644
--- a/plugins/HistoryStats/src/column_words.h
+++ b/plugins/HistoryStats/src/column_words.h
@@ -72,12 +72,12 @@ protected:
virtual void impl_configWrite(SettingsTree& settings) const;
virtual void impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup);
virtual void impl_configFromUI(OptionsCtrl& Opt);
- virtual void impl_contactDataFree(Contact& contact) const;
- virtual void impl_contactDataTransform(Contact& contact) const;
- virtual void impl_contactDataTransformCleanup(Contact& contact) const;
+ virtual void impl_contactDataFree(CContact& contact) const;
+ virtual void impl_contactDataTransform(CContact& contact) const;
+ virtual void impl_contactDataTransformCleanup(CContact& contact) const;
virtual StyleList impl_outputGetAdditionalStyles(IDProvider& idp);
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
- virtual void impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display);
+ virtual void impl_outputRenderRow(ext::ostream& tos, const CContact& contact, DisplayType display);
};
#endif // HISTORYSTATS_GUARD_COLUMN_WORDS_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/contact.cpp b/plugins/HistoryStats/src/contact.cpp
index cd96f3c224..c6a4617c9b 100644
--- a/plugins/HistoryStats/src/contact.cpp
+++ b/plugins/HistoryStats/src/contact.cpp
@@ -5,7 +5,7 @@
#include <queue>
#include <cmath>
-Contact::Contact(Statistic* pStatistic, int nSlots, const ext::string& nick, const ext::string& protocol, const ext::string& group, int nContacts, int nSubcontacts) :
+CContact::CContact(Statistic* pStatistic, int nSlots, const ext::string& nick, const ext::string& protocol, const ext::string& group, int nContacts, int nSubcontacts) :
m_Nick(nick),
m_Protocol(protocol),
m_Group(group),
@@ -27,7 +27,7 @@ Contact::Contact(Statistic* pStatistic, int nSlots, const ext::string& nick, con
m_Slots.resize(nSlots, NULL);
}
-void Contact::updateTime(uint32_t msgTime)
+void CContact::updateTime(uint32_t msgTime)
{
if (!m_bFirstLastTimeValid) {
m_FirstTime = msgTime;
@@ -40,7 +40,7 @@ void Contact::updateTime(uint32_t msgTime)
}
}
-void Contact::updateChatDur(uint32_t timeDelta)
+void CContact::updateChatDur(uint32_t timeDelta)
{
m_bChatDurValid = true;
@@ -50,7 +50,7 @@ void Contact::updateChatDur(uint32_t timeDelta)
m_ChatDurMax = max(m_ChatDurMax, timeDelta);
}
-double Contact::getAvg(int nTotal) const
+double CContact::getAvg(int nTotal) const
{
uint32_t dwHistTime = m_pStatistic->getLastTime() - getFirstTime();
if (dwHistTime < m_pStatistic->getAverageMinTime())
@@ -59,7 +59,7 @@ double Contact::getAvg(int nTotal) const
return dwHistTime ? (0.0 + nTotal) / dwHistTime : 0.0;
}
-void Contact::addMessage(Message& msg)
+void CContact::addMessage(Message& msg)
{
if (msg.isOutgoing()) {
m_Bytes.out += msg.getLength();
@@ -73,7 +73,7 @@ void Contact::addMessage(Message& msg)
updateTime(msg.getTimestamp());
}
-void Contact::addChat(bool bOutgoing, uint32_t, uint32_t duration)
+void CContact::addChat(bool bOutgoing, uint32_t, uint32_t duration)
{
if (bOutgoing)
m_Chats.out++;
@@ -83,7 +83,7 @@ void Contact::addChat(bool bOutgoing, uint32_t, uint32_t duration)
updateChatDur(duration);
}
-void Contact::addEvent(uint16_t eventType, bool bOutgoing)
+void CContact::addEvent(uint16_t eventType, bool bOutgoing)
{
InOut* pIO = nullptr;
@@ -102,7 +102,7 @@ void Contact::addEvent(uint16_t eventType, bool bOutgoing)
pIO->in++;
}
-void Contact::merge(const Contact& other)
+void CContact::merge(const CContact& other)
{
if (m_Nick != other.m_Nick)
m_Nick = TranslateT("(multiple)");
diff --git a/plugins/HistoryStats/src/contact.h b/plugins/HistoryStats/src/contact.h
index 4da79c71a7..b57b02126d 100644
--- a/plugins/HistoryStats/src/contact.h
+++ b/plugins/HistoryStats/src/contact.h
@@ -15,11 +15,11 @@
#include "statistic.h"
/*
- * Contact
+ * CContact
*/
-class Contact
- : private pattern::NotCopyable<Contact>
+class CContact
+ : private pattern::NotCopyable<CContact>
{
private:
ext::string m_Nick;
@@ -48,7 +48,7 @@ private:
double getAvg(int nTotal) const;
public:
- explicit Contact(Statistic* pStatistic, int nSlots, const ext::string& nick, const ext::string& protocol, const ext::string& group, int nContacts, int nSubcontacts);
+ explicit CContact(Statistic* pStatistic, int nSlots, const ext::string& nick, const ext::string& protocol, const ext::string& group, int nContacts, int nSubcontacts);
// basic contact info
const ext::string& getNick() const { return m_Nick; }
@@ -107,7 +107,7 @@ public:
void addMessage(Message& msg);
void addChat(bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration);
void addEvent(uint16_t eventType, bool bOutgoing);
- void merge(const Contact& other);
+ void merge(const CContact& other);
// slot stuff
int countSlot() const { return m_Slots.size(); }
@@ -126,7 +126,7 @@ protected:
bool m_bAsc;
public:
- virtual bool cmp(const Contact&, const Contact&) { return m_bAsc; }
+ virtual bool cmp(const CContact&, const CContact&) { return m_bAsc; }
void setDir(bool bAsc) { m_bAsc = bAsc; }
explicit ContactCompareBase() : m_bAsc(true) { }
};
@@ -140,11 +140,11 @@ class ContactCompare
: public ContactCompareBase
{
private:
- T_ (Contact::*m_getData)() const;
+ T_ (CContact::*m_getData)() const;
ContactCompareBase* m_pNextCmp;
public:
- virtual bool cmp(const Contact& first, const Contact& second)
+ virtual bool cmp(const CContact& first, const CContact& second)
{
T_ firstVal = (first.*m_getData)();
T_ secondVal = (second.*m_getData)();
@@ -160,7 +160,7 @@ public:
}
public:
- explicit ContactCompare(ContactCompareBase* pNextCmp, T_ (Contact::*getData)() const)
+ explicit ContactCompare(ContactCompareBase* pNextCmp, T_ (CContact::*getData)() const)
: m_pNextCmp(pNextCmp)
{
m_getData = getData;
@@ -175,11 +175,11 @@ class ContactCompareStr
: public ContactCompareBase
{
private:
- const ext::string& (Contact::*m_getData)() const;
+ const ext::string& (CContact::*m_getData)() const;
ContactCompareBase* m_pNextCmp;
public:
- virtual bool cmp(const Contact& first, const Contact& second)
+ virtual bool cmp(const CContact& first, const CContact& second)
{
const ext::string& firstVal = (first.*m_getData)();
const ext::string& secondVal = (second.*m_getData)();
@@ -198,7 +198,7 @@ public:
}
public:
- explicit ContactCompareStr(ContactCompareBase* pNextCmp, const ext::string& (Contact::*getData)() const)
+ explicit ContactCompareStr(ContactCompareBase* pNextCmp, const ext::string& (CContact::*getData)() const)
: m_pNextCmp(pNextCmp)
{
m_getData = getData;
@@ -215,7 +215,7 @@ private:
ContactCompareBase* m_pCmp;
public:
- bool operator ()(const Contact* first, const Contact* second) { return m_pCmp->cmp(*first, *second); }
+ bool operator ()(const CContact* first, const CContact* second) { return m_pCmp->cmp(*first, *second); }
explicit ContactCompareOp(ContactCompareBase* pCmp) : m_pCmp(pCmp) { }
};
diff --git a/plugins/HistoryStats/src/dlgoption_subinput.cpp b/plugins/HistoryStats/src/dlgoption_subinput.cpp
index 31f836c87f..d35b302686 100644
--- a/plugins/HistoryStats/src/dlgoption_subinput.cpp
+++ b/plugins/HistoryStats/src/dlgoption_subinput.cpp
@@ -73,7 +73,7 @@ void DlgOption::SubInput::onWMInitDialog()
m_hChatSessionTimeout = m_Options.insertEdit(hTemp, TranslateT("Time between two chat sessions (seconds)"), L"", OptionsCtrl::OCF_NUMBER);
m_hAverageMinTime = m_Options.insertEdit(hTemp, TranslateT("Minimum time to assume when calculating average (days)"), L"", OptionsCtrl::OCF_NUMBER);
m_hWordDelimiters = m_Options.insertEdit(hTemp, TranslateT("Word delimiting characters"));
- hTemp = m_Options.insertGroup(nullptr, TranslateT("Contact filtering"), OptionsCtrl::OCF_ROOTGROUP | OptionsCtrl::OCF_NODISABLECHILDS);
+ hTemp = m_Options.insertGroup(nullptr, TranslateT("CContact filtering"), OptionsCtrl::OCF_ROOTGROUP | OptionsCtrl::OCF_NODISABLECHILDS);
m_hProtocols = m_Options.insertGroup(hTemp, TranslateT("Ignore all contacts with protocol..."));
hTemp2 = m_Options.insertGroup(hTemp, TranslateT("History read mode for metacontacts"), 0);
diff --git a/plugins/HistoryStats/src/dlgoption_suboutput.cpp b/plugins/HistoryStats/src/dlgoption_suboutput.cpp
index bd20a1744e..1fc553fd2b 100644
--- a/plugins/HistoryStats/src/dlgoption_suboutput.cpp
+++ b/plugins/HistoryStats/src/dlgoption_suboutput.cpp
@@ -98,7 +98,7 @@ void DlgOption::SubOutput::onWMInitDialog()
OptionsCtrl::Item hTemp;
OptionsCtrl::Item hTemp2;
- hTemp = m_Options.insertGroup(nullptr, TranslateT("Contact filtering and totals"), OptionsCtrl::OCF_ROOTGROUP | OptionsCtrl::OCF_NODISABLECHILDS);
+ hTemp = m_Options.insertGroup(nullptr, TranslateT("CContact filtering and totals"), OptionsCtrl::OCF_ROOTGROUP | OptionsCtrl::OCF_NODISABLECHILDS);
m_hRemoveEmptyContacts = m_Options.insertCheck(hTemp, TranslateT("Remove contacts with empty history"));
m_hRemoveOutChatsZero = m_Options.insertCheck(hTemp, TranslateT("Remove contacts with only incoming chats"), OptionsCtrl::OCF_DISABLECHILDSONUNCHECK);
m_hRemoveOutBytesZero = m_Options.insertCheck(m_hRemoveOutChatsZero, TranslateT("Remove only if you never answered"));
diff --git a/plugins/HistoryStats/src/iconlib.cpp b/plugins/HistoryStats/src/iconlib.cpp
index 4e2ff979d2..26aa494e16 100644
--- a/plugins/HistoryStats/src/iconlib.cpp
+++ b/plugins/HistoryStats/src/iconlib.cpp
@@ -11,7 +11,7 @@ IconLib::IconInfo IconLib::m_IconInfo[] = {
{ IDI_HISTORYSTATS , "main_menu" , nullptr, LPGENW("Create statistics (main menu)") },
{ IDI_HISTORYSTATS , "menu_show" , nullptr, LPGENW("Show statistics (main menu)") },
{ IDI_HISTORYSTATS , "menu_config" , nullptr, LPGENW("Configure... (main menu)") },
- { IDI_HISTORYSTATS , "contact_menu" , nullptr, LPGENW("Contact menu") },
+ { IDI_HISTORYSTATS , "contact_menu" , nullptr, LPGENW("CContact menu") },
{ IDI_EXCLUDE_NO , "exclude_no" , nullptr, LPGENW("Unexcluded contacts") },
{ IDI_EXCLUDE_YES , "exclude_yes" , nullptr, LPGENW("Excluded contacts") },
{ IDI_TREE_CHECK1 , "tree_check1" , LPGENW("Options tree"), LPGENW("Checkbox") },
diff --git a/plugins/HistoryStats/src/statistic.cpp b/plugins/HistoryStats/src/statistic.cpp
index 79c2eeac1e..37da089c20 100644
--- a/plugins/HistoryStats/src/statistic.cpp
+++ b/plugins/HistoryStats/src/statistic.cpp
@@ -65,7 +65,7 @@ void Statistic::prepareColumns()
}
}
-void Statistic::prepareContactData(Contact& contact)
+void Statistic::prepareContactData(CContact& contact)
{
iter_each_(std::vector<Column*>, i, m_AcquireCols)
{
@@ -73,7 +73,7 @@ void Statistic::prepareContactData(Contact& contact)
}
}
-void Statistic::freeContactData(Contact& contact)
+void Statistic::freeContactData(CContact& contact)
{
iter_each_(std::vector<Column*>, i, m_AcquireCols)
{
@@ -86,7 +86,7 @@ void Statistic::freeContactData(Contact& contact)
}
}
-void Statistic::mergeContactData(Contact& contact, const Contact& include)
+void Statistic::mergeContactData(CContact& contact, const CContact& include)
{
iter_each_(std::vector<Column*>, i, m_AcquireCols)
{
@@ -94,7 +94,7 @@ void Statistic::mergeContactData(Contact& contact, const Contact& include)
}
}
-void Statistic::transformContactData(Contact& contact)
+void Statistic::transformContactData(CContact& contact)
{
iter_each_(std::vector<Column*>, i, m_TransformCols)
{
@@ -102,9 +102,9 @@ void Statistic::transformContactData(Contact& contact)
}
}
-Contact& Statistic::addContact(const ext::string& nick, const ext::string& protoDisplayName, const ext::string& groupName, int nSources)
+CContact& Statistic::addContact(const ext::string& nick, const ext::string& protoDisplayName, const ext::string& groupName, int nSources)
{
- Contact* pContact = new Contact(this, m_nNextSlot, nick, protoDisplayName, groupName, 1, nSources);
+ CContact* pContact = new CContact(this, m_nNextSlot, nick, protoDisplayName, groupName, 1, nSources);
prepareContactData(*pContact);
m_Contacts.push_back(pContact);
@@ -112,7 +112,7 @@ Contact& Statistic::addContact(const ext::string& nick, const ext::string& proto
return *pContact;
}
-const Contact& Statistic::getContact(int index) const
+const CContact& Statistic::getContact(int index) const
{
assert(index >= 0 && index < m_Contacts.size());
@@ -243,7 +243,7 @@ bool Statistic::newFilePNG(Canvas& canvas, ext::string& finalURL)
return true;
}
-void Statistic::handleAddMessage(Contact& contact, Message& msg)
+void Statistic::handleAddMessage(CContact& contact, Message& msg)
{
contact.addMessage(msg);
@@ -253,7 +253,7 @@ void Statistic::handleAddMessage(Contact& contact, Message& msg)
}
}
-void Statistic::handleAddChat(Contact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration)
+void Statistic::handleAddChat(CContact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration)
{
if (duration >= m_Settings.m_ChatSessionMinDur) {
contact.addChat(bOutgoing, localTimestampStarted, duration);
@@ -385,7 +385,7 @@ bool Statistic::stepReadDB()
setProgressLabel(true, hisContact.getNick());
- Contact& curContact = addContact(hisContact.getNick(), hisContact.getProtocol(), hisContact.getGroup(), hisContact.getSources().size());
+ CContact& curContact = addContact(hisContact.getNick(), hisContact.getProtocol(), hisContact.getGroup(), hisContact.getSources().size());
// signal begin of history for this contact
hisContact.beginRead();
@@ -498,7 +498,7 @@ bool Statistic::stepRemoveContacts()
vector_each_(i, m_Contacts)
{
bool bRemove = false;
- Contact* pCur = m_Contacts[i];
+ CContact* pCur = m_Contacts[i];
if (!bRemove && m_Settings.m_RemoveEmptyContacts)
bRemove = (pCur->getTotalMessages() == 0);
@@ -527,7 +527,7 @@ bool Statistic::stepSortContacts()
return false;
ContactCompareBase cmpLast;
- ContactCompareStr cmpName(&cmpLast, &Contact::getNick);
+ ContactCompareStr cmpName(&cmpLast, &CContact::getNick);
int cmpDepth = 3;
@@ -547,111 +547,111 @@ bool Statistic::stepSortContacts()
for (int i = cmpDepth - 1; i >= 0; --i) {
switch (m_Settings.m_Sort[i].by) {
case Settings::skNick:
- pCmp = new ContactCompareStr(pPrev, &Contact::getNick);
+ pCmp = new ContactCompareStr(pPrev, &CContact::getNick);
break;
case Settings::skProtocol:
- pCmp = new ContactCompareStr(pPrev, &Contact::getProtocol);
+ pCmp = new ContactCompareStr(pPrev, &CContact::getProtocol);
break;
case Settings::skGroup:
- pCmp = new ContactCompareStr(pPrev, &Contact::getGroup);
+ pCmp = new ContactCompareStr(pPrev, &CContact::getGroup);
break;
case Settings::skBytesOut:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getOutBytes);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getOutBytes);
break;
case Settings::skBytesIn:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getInBytes);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getInBytes);
break;
case Settings::skBytesTotal:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getTotalBytes);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getTotalBytes);
break;
case Settings::skMessagesOut:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getOutMessages);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getOutMessages);
break;
case Settings::skMessagesIn:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getOutMessages);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getOutMessages);
break;
case Settings::skMessagesTotal:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getTotalMessages);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getTotalMessages);
break;
case Settings::skChatsOut:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getOutChats);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getOutChats);
break;
case Settings::skChatsIn:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getInChats);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getInChats);
break;
case Settings::skChatsTotal:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getTotalChats);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getTotalChats);
break;
case Settings::skChatDurationTotal:
- pCmp = new ContactCompare<uint32_t>(pPrev, &Contact::getChatDurSum);
+ pCmp = new ContactCompare<uint32_t>(pPrev, &CContact::getChatDurSum);
break;
case Settings::skTimeOfFirstMessage:
- pCmp = new ContactCompare<uint32_t>(pPrev, &Contact::getFirstTime);
+ pCmp = new ContactCompare<uint32_t>(pPrev, &CContact::getFirstTime);
break;
case Settings::skTimeOfLastMessage:
- pCmp = new ContactCompare<uint32_t>(pPrev, &Contact::getLastTime);
+ pCmp = new ContactCompare<uint32_t>(pPrev, &CContact::getLastTime);
break;
case Settings::skBytesOutAvg:
- pCmp = new ContactCompare<double>(pPrev, &Contact::getOutBytesAvg);
+ pCmp = new ContactCompare<double>(pPrev, &CContact::getOutBytesAvg);
break;
case Settings::skBytesInAvg:
- pCmp = new ContactCompare<double>(pPrev, &Contact::getInBytesAvg);
+ pCmp = new ContactCompare<double>(pPrev, &CContact::getInBytesAvg);
break;
case Settings::skBytesTotalAvg:
- pCmp = new ContactCompare<double>(pPrev, &Contact::getTotalBytesAvg);
+ pCmp = new ContactCompare<double>(pPrev, &CContact::getTotalBytesAvg);
break;
case Settings::skMessagesOutAvg:
- pCmp = new ContactCompare<double>(pPrev, &Contact::getOutMessagesAvg);
+ pCmp = new ContactCompare<double>(pPrev, &CContact::getOutMessagesAvg);
break;
case Settings::skMessagesInAvg:
- pCmp = new ContactCompare<double>(pPrev, &Contact::getOutMessagesAvg);
+ pCmp = new ContactCompare<double>(pPrev, &CContact::getOutMessagesAvg);
break;
case Settings::skMessagesTotalAvg:
- pCmp = new ContactCompare<double>(pPrev, &Contact::getTotalMessagesAvg);
+ pCmp = new ContactCompare<double>(pPrev, &CContact::getTotalMessagesAvg);
break;
case Settings::skChatsOutAvg:
- pCmp = new ContactCompare<double>(pPrev, &Contact::getOutChatsAvg);
+ pCmp = new ContactCompare<double>(pPrev, &CContact::getOutChatsAvg);
break;
case Settings::skChatsInAvg:
- pCmp = new ContactCompare<double>(pPrev, &Contact::getInChatsAvg);
+ pCmp = new ContactCompare<double>(pPrev, &CContact::getInChatsAvg);
break;
case Settings::skChatsTotalAvg:
- pCmp = new ContactCompare<double>(pPrev, &Contact::getTotalChatsAvg);
+ pCmp = new ContactCompare<double>(pPrev, &CContact::getTotalChatsAvg);
break;
case Settings::skChatDurationMin:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getChatDurMinForSort);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getChatDurMinForSort);
break;
case Settings::skChatDurationAvg:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getChatDurAvgForSort);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getChatDurAvgForSort);
break;
case Settings::skChatDurationMax:
- pCmp = new ContactCompare<int>(pPrev, &Contact::getChatDurMaxForSort);
+ pCmp = new ContactCompare<int>(pPrev, &CContact::getChatDurMaxForSort);
break;
}
@@ -694,7 +694,7 @@ bool Statistic::stepOmitContacts()
if (shouldTerminate())
return false;
- m_pOmitted = new Contact(this, m_nNextSlot, L"", L"", L"", 0, 0);
+ m_pOmitted = new CContact(this, m_nNextSlot, L"", L"", L"", 0, 0);
prepareContactData(*m_pOmitted);
// omit depending on some value
@@ -703,36 +703,36 @@ bool Statistic::stepOmitContacts()
{
int type; // 0 = int, 1 = double, 2 = uint32_t
double factor; // factor to multiply function output with
- int (Contact::*int_fn)() const;
- double (Contact::*double_fn)() const;
- uint32_t(Contact::*DWORD_fn)() const;
+ int (CContact::*int_fn)() const;
+ double (CContact::*double_fn)() const;
+ uint32_t(CContact::*DWORD_fn)() const;
} valueMap[] = {
- { 0, 1.0, &Contact::getInBytes, nullptr, nullptr },
- { 0, 1.0, &Contact::getOutBytes, nullptr, nullptr },
- { 0, 1.0, &Contact::getTotalBytes, nullptr, nullptr },
- { 1, 604800.0, nullptr, &Contact::getInBytesAvg, nullptr },
- { 1, 604800.0, nullptr, &Contact::getOutBytesAvg, nullptr },
- { 1, 604800.0, nullptr, &Contact::getTotalBytesAvg, nullptr },
- { 0, 1.0, &Contact::getInMessages, nullptr, nullptr },
- { 0, 1.0, &Contact::getOutMessages, nullptr, nullptr },
- { 0, 1.0, &Contact::getTotalMessages, nullptr, nullptr },
- { 1, 604800.0, nullptr, &Contact::getInMessagesAvg, nullptr },
- { 1, 604800.0, nullptr, &Contact::getOutMessagesAvg, nullptr },
- { 1, 604800.0, nullptr, &Contact::getTotalMessagesAvg, nullptr },
- { 0, 1.0, &Contact::getInChats, nullptr, nullptr },
- { 0, 1.0, &Contact::getOutChats, nullptr, nullptr },
- { 0, 1.0, &Contact::getTotalChats, nullptr, nullptr },
- { 1, 604800.0, nullptr, &Contact::getInChatsAvg, nullptr },
- { 1, 604800.0, nullptr, &Contact::getOutChatsAvg, nullptr },
- { 1, 604800.0, nullptr, &Contact::getTotalChatsAvg, nullptr },
- { 2, 1 / 3600.0, nullptr, nullptr, &Contact::getChatDurSum },
+ { 0, 1.0, &CContact::getInBytes, nullptr, nullptr },
+ { 0, 1.0, &CContact::getOutBytes, nullptr, nullptr },
+ { 0, 1.0, &CContact::getTotalBytes, nullptr, nullptr },
+ { 1, 604800.0, nullptr, &CContact::getInBytesAvg, nullptr },
+ { 1, 604800.0, nullptr, &CContact::getOutBytesAvg, nullptr },
+ { 1, 604800.0, nullptr, &CContact::getTotalBytesAvg, nullptr },
+ { 0, 1.0, &CContact::getInMessages, nullptr, nullptr },
+ { 0, 1.0, &CContact::getOutMessages, nullptr, nullptr },
+ { 0, 1.0, &CContact::getTotalMessages, nullptr, nullptr },
+ { 1, 604800.0, nullptr, &CContact::getInMessagesAvg, nullptr },
+ { 1, 604800.0, nullptr, &CContact::getOutMessagesAvg, nullptr },
+ { 1, 604800.0, nullptr, &CContact::getTotalMessagesAvg, nullptr },
+ { 0, 1.0, &CContact::getInChats, nullptr, nullptr },
+ { 0, 1.0, &CContact::getOutChats, nullptr, nullptr },
+ { 0, 1.0, &CContact::getTotalChats, nullptr, nullptr },
+ { 1, 604800.0, nullptr, &CContact::getInChatsAvg, nullptr },
+ { 1, 604800.0, nullptr, &CContact::getOutChatsAvg, nullptr },
+ { 1, 604800.0, nullptr, &CContact::getTotalChatsAvg, nullptr },
+ { 2, 1 / 3600.0, nullptr, nullptr, &CContact::getChatDurSum },
};
int valueKey = m_Settings.m_OmitByValueData;
double fLimit = static_cast<double>(m_Settings.m_OmitByValueLimit) / valueMap[valueKey].factor;
for (int i = m_Contacts.size() - 1; i >= 0; --i) {
- Contact& cur = *m_Contacts[i];
+ CContact& cur = *m_Contacts[i];
bool bDoOmit = false;
@@ -772,7 +772,7 @@ bool Statistic::stepOmitContacts()
// omit depending on message time
if (m_Settings.m_OmitByTime) {
for (int i = m_Contacts.size() - 1; i >= 0; --i) {
- Contact& cur = *m_Contacts[i];
+ CContact& cur = *m_Contacts[i];
if (!cur.isFirstLastTimeValid() || (getTimeStarted() > cur.getLastTime() && getTimeStarted() - cur.getLastTime() > m_Settings.m_OmitByTimeDays * 86400)) {
if (m_Settings.m_OmittedInTotals && m_Settings.m_CalcTotals || m_Settings.m_OmittedInExtraRow) {
@@ -796,7 +796,7 @@ bool Statistic::stepOmitContacts()
// omit depending on rank
if (m_Settings.m_OmitByRank) {
while (m_Contacts.size() > m_Settings.m_OmitNumOnTop) {
- Contact& cur = *m_Contacts.back();
+ CContact& cur = *m_Contacts.back();
if (m_Settings.m_OmittedInTotals && m_Settings.m_CalcTotals || m_Settings.m_OmittedInExtraRow) {
m_pOmitted->merge(cur);
@@ -826,7 +826,7 @@ bool Statistic::stepCalcTotals()
if (shouldTerminate())
return false;
- m_pTotals = new Contact(this, m_nNextSlot, L"", L"", L"", 0, 0);
+ m_pTotals = new CContact(this, m_nNextSlot, L"", L"", L"", 0, 0);
prepareContactData(*m_pTotals);
setProgressMax(true, m_Contacts.size() + 1);
@@ -834,7 +834,7 @@ bool Statistic::stepCalcTotals()
// normal contacts
vector_each_(i, m_Contacts)
{
- Contact &curContact = *m_Contacts[i];
+ CContact &curContact = *m_Contacts[i];
setProgressLabel(true, curContact.getNick());
@@ -883,7 +883,7 @@ bool Statistic::stepTransformData()
// normal contacts
vector_each_(i, m_Contacts)
{
- Contact& curContact = *m_Contacts[i];
+ CContact& curContact = *m_Contacts[i];
setProgressLabel(true, curContact.getNick());
transformContactData(curContact);
@@ -1022,7 +1022,7 @@ bool Statistic::stepWriteHTML()
{
tos << L"<tr>" << ext::endl;
- const Contact& curContact = getContact(i);
+ const CContact& curContact = getContact(i);
setProgressLabel(true, curContact.getNick());
@@ -1065,7 +1065,7 @@ bool Statistic::stepWriteHTML()
if (!bInterrupted && m_Settings.m_OmitContacts && m_Settings.m_OmittedInExtraRow && m_bActuallyOmitted) {
setProgressLabel(true, TranslateT("Writing omitted contacts"));
- const Contact& omittedContact = getOmitted();
+ const CContact& omittedContact = getOmitted();
tos << L"<tr class=\"omitted\">" << ext::endl;
@@ -1090,7 +1090,7 @@ bool Statistic::stepWriteHTML()
if (!bInterrupted && m_Settings.m_CalcTotals) {
setProgressLabel(true, TranslateT("Writing totals"));
- const Contact& totalsContact = getTotals();
+ const CContact& totalsContact = getTotals();
tos << L"<tr class=\"totals\">" << ext::endl;
diff --git a/plugins/HistoryStats/src/statistic.h b/plugins/HistoryStats/src/statistic.h
index 9897bf6732..ae70555ced 100644
--- a/plugins/HistoryStats/src/statistic.h
+++ b/plugins/HistoryStats/src/statistic.h
@@ -12,7 +12,7 @@
#include "settings.h"
#include "message.h"
-class Contact; // forward declaration instead of #include "contact.h"
+class CContact; // forward declaration instead of #include "contact.h"
class Statistic
: private pattern::NotCopyable<Statistic>
@@ -51,8 +51,8 @@ public:
etWATError = EVENTTYPE_WAT_ERROR,
};
- typedef std::vector<Contact*> ContactList;
- typedef std::vector<const Contact*> ContactListC;
+ typedef std::vector<CContact*> ContactList;
+ typedef std::vector<const CContact*> ContactListC;
typedef std::pair<ext::string, ext::string> ConflictingFile; // (desired, temp)
typedef std::list<ConflictingFile> ConflictingFiles;
typedef std::map<Canvas::Digest, ext::string> ImageMap;
@@ -76,8 +76,8 @@ private:
ContactList m_Contacts;
// special 'contacts': omitted, totals
- Contact* m_pTotals;
- Contact* m_pOmitted;
+ CContact* m_pTotals;
+ CContact* m_pOmitted;
bool
m_bActuallyOmitted, // did we really omit something
@@ -122,17 +122,17 @@ private:
private:
// contact handling
void prepareColumns();
- void prepareContactData(Contact& contact);
- void freeContactData(Contact& contact);
- void mergeContactData(Contact& contact, const Contact& include);
- void transformContactData(Contact& contact);
- Contact& addContact(const ext::string& nick, const ext::string& protoDisplayName, const ext::string& groupName, int nSources);
+ void prepareContactData(CContact& contact);
+ void freeContactData(CContact& contact);
+ void mergeContactData(CContact& contact, const CContact& include);
+ void transformContactData(CContact& contact);
+ CContact& addContact(const ext::string& nick, const ext::string& protoDisplayName, const ext::string& groupName, int nSources);
// misc routines
uint32_t getTimeStarted() { return m_TimeStarted; }
bool shouldTerminate() { return (WaitForSingleObject(m_hCancelEvent, 0) == WAIT_OBJECT_0) || bool_(Miranda_IsTerminated()); }
- void handleAddMessage(Contact& contact, Message& msg);
- void handleAddChat(Contact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration);
+ void handleAddMessage(CContact& contact, Message& msg);
+ void handleAddChat(CContact& contact, bool bOutgoing, uint32_t localTimestampStarted, uint32_t duration);
// progress dialog handling
static INT_PTR CALLBACK staticProgressProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -167,9 +167,9 @@ public:
static void run(const Settings& settings, InvocationSource invokedFrom, HINSTANCE hInst, HWND hWndParent = nullptr);
int countContacts() const { return m_Contacts.size(); }
- const Contact& getContact(int index) const;
- const Contact& getTotals() const { assert(m_pTotals); return *m_pTotals; }
- const Contact& getOmitted() const { assert(m_pOmitted); return *m_pOmitted; }
+ const CContact& getContact(int index) const;
+ const CContact& getTotals() const { assert(m_pTotals); return *m_pTotals; }
+ const CContact& getOmitted() const { assert(m_pOmitted); return *m_pOmitted; }
bool hasTotals() const { return (m_pTotals != nullptr) && m_Settings.m_CalcTotals; } // MEMO: only makes sense after 'calc totals'-step
bool hasOmitted() const { return (m_pOmitted != nullptr) && m_Settings.m_OmitContacts && m_Settings.m_OmittedInExtraRow && m_bActuallyOmitted; } // MEMO: only makes sense after 'omit'-step
uint32_t getFirstTime(); // MEMO: only makes sense after 'calc totals'-step