Renamed destination to direction for clarity.
[qwerkisync] / EventTypes / PhoneCall.cpp
index bfed790..7997fc2 100644 (file)
@@ -61,7 +61,7 @@ PhoneCall::~PhoneCall()
 PhoneCall::PhoneCall(const Settings &settings, const RTComElEvent &event, const QList<RTComElAttachment*> attachments) :
        m_Settings(settings)
 {
-       setDestination(event.fld_outgoing ? OUTGOING : INCOMING);
+       setDestination(event.fld_outgoing ? Settings::OUTGOING : Settings::INCOMING);
        setTimestamp(QDateTime::fromTime_t(event.fld_start_time).toUTC());
        setDurationInSeconds(QDateTime::fromTime_t(event.fld_start_time).toUTC().secsTo(QDateTime::fromTime_t(event.fld_end_time).toUTC()));
        setTel(event.fld_remote_uid);
@@ -75,7 +75,7 @@ PhoneCall::PhoneCall(const Settings &settings, const RTComElEvent &event, const
        qDebug() << "Created new Phone Call from RtCom:\n" << *this;
 }
 
-PhoneCall::PhoneCall(const Settings &settings, const eDestination destination, const QDateTime &timestamp, const QString &tel, int durationInSeconds, const AttachmentCollection &attachments) :
+PhoneCall::PhoneCall(const Settings &settings, const Settings::eDirection destination, const QDateTime &timestamp, const QString &tel, int durationInSeconds, const AttachmentCollection &attachments) :
        m_Settings(settings), m_Destination(destination), m_Timestamp(timestamp), m_Tel(tel),
        m_DurationInSeconds(durationInSeconds), m_Attachments(attachments)
 {
@@ -129,7 +129,7 @@ RTComElEvent * PhoneCall::toRTComEvent(const NumberToNameLookup &numberToNameLoo
        RTCOM_EL_EVENT_SET_FIELD (event, end_time, Timestamp().addSecs(DurationInSeconds()).toUTC().toTime_t());
        RTCOM_EL_EVENT_SET_FIELD (event, storage_time, Timestamp().addSecs(DurationInSeconds()).toUTC().toTime_t());
        //RTCOM_EL_EVENT_SET_FIELD (event, is_read, 0);
-       RTCOM_EL_EVENT_SET_FIELD (event, outgoing, Destination() == PhoneCall::OUTGOING ? 1 : 0);
+       RTCOM_EL_EVENT_SET_FIELD (event, outgoing, Destination() == Settings::OUTGOING ? 1 : 0);
        //if(local_uid) // Voicemail local_uid transform needed here
        RTCOM_EL_EVENT_SET_FIELD (event, local_uid, g_strdup("ring/tel/ring"));
        //RTCOM_EL_EVENT_SET_FIELD (&event, local_name, g_strdup("<SelfHandle>"));
@@ -175,7 +175,8 @@ void PhoneCall::Export(const QString &baseDirectory) const
 
 QDebug operator<<(QDebug dbg, PhoneCall& event)
 {
-       dbg.nospace() << "\tDirection:\t\t" << (event.Destination() == PhoneCall::OUTGOING ? "Made" : "Recieved") << "\n";
+       dbg.nospace() << "\tHash:\t\t" << event.HashCode() << "\n";
+       dbg.nospace() << "\tDirection:\t\t" << (event.Destination() == Settings::OUTGOING ? "Made" : "Recieved") << "\n";
        dbg.nospace() << "\tTimestamp:\t" << event.Timestamp().toUTC() << "\n";
        dbg.nospace() << "\tDuration:\t\t" << event.DurationInSeconds() << " seconds\n";
        dbg.nospace() << "\tRemote-Tel:\t" << event.Tel() << "\n";