Renamed some setters for consistency.
authorJamie Thompson <jamie@.(none)>
Sat, 1 Oct 2011 17:38:45 +0000 (18:38 +0100)
committerJamie Thompson <coding@jamie-thompson.co.uk>
Sun, 2 Oct 2011 18:35:23 +0000 (19:35 +0100)
EventParsers/VMGEntities/VBody.cpp
EventParsers/VMGEntities/VCard.cpp
EventParsers/VMGEntities/VMessage.cpp
EventTypes/PhoneCall.cpp
EventTypes/PhoneCall.h
EventTypes/SMS.cpp
EventTypes/SMS.h

index 346d97b..667b5ef 100644 (file)
@@ -217,7 +217,7 @@ bool VBody::Read(const QString &initialLine, QTextStream &stream, EventTypes::SM
 
        if(hasEnded)
        {
 
        if(hasEnded)
        {
-               event.setContents(text);
+               event.Contents(text);
                //event.fld_storage_time
        }
 
                //event.fld_storage_time
        }
 
index e5e0a7d..c043eb9 100644 (file)
@@ -150,7 +150,7 @@ bool VCard::Read(const QString &initialLine, QTextStream &stream, EventTypes::SM
                                                tel = tel.replace(QRegExp("^0"), "+44");
 
                                        gchar* g_tel = g_strdup(tel.toUtf8());
                                                tel = tel.replace(QRegExp("^0"), "+44");
 
                                        gchar* g_tel = g_strdup(tel.toUtf8());
-                                       event.setTel(g_tel);
+                                       event.Tel(g_tel);
 
 //                                     if(tel.length() < 7 || tel.indexOf(QRegExp("[:alpha:]+")) > -1)
 //                                             event.fld_group_uid = g_tel;
 
 //                                     if(tel.length() < 7 || tel.indexOf(QRegExp("[:alpha:]+")) > -1)
 //                                             event.fld_group_uid = g_tel;
index 443070e..9e80739 100644 (file)
@@ -83,7 +83,7 @@ bool VMessage::Read(const QString &initialLine, QTextStream &stream, EventTypes:
                else if(lineData.startsWith("X-IRMC-STATUS:"))
                {
                        bool isRead(lineData.mid(lineData.indexOf(":") + 1) == "READ");
                else if(lineData.startsWith("X-IRMC-STATUS:"))
                {
                        bool isRead(lineData.mid(lineData.indexOf(":") + 1) == "READ");
-                       event.setIsRead(isRead);
+                       event.IsRead(isRead);
                }
                else if(lineData.startsWith("X-IRMC-BOX:"))
                {
                }
                else if(lineData.startsWith("X-IRMC-BOX:"))
                {
@@ -102,7 +102,7 @@ bool VMessage::Read(const QString &initialLine, QTextStream &stream, EventTypes:
                                qDebug() << "Unexpected box: " << box;
                                return false;
                        }
                                qDebug() << "Unexpected box: " << box;
                                return false;
                        }
-                       event.setDestination(isOutgoing ? EventTypes::SMS::SENT : EventTypes::SMS::INBOX);
+                       event.Destination(isOutgoing ? EventTypes::SMS::SENT : EventTypes::SMS::INBOX);
                }
                else if(lineData.startsWith("X-NOK-DT:"))
                {
                }
                else if(lineData.startsWith("X-NOK-DT:"))
                {
@@ -110,7 +110,7 @@ bool VMessage::Read(const QString &initialLine, QTextStream &stream, EventTypes:
                                lineData.mid(lineData.indexOf(":") + 1),
                                "yyyyMMddThhmmssZ"));
                        timestamp.setTimeSpec(Qt::UTC);
                                lineData.mid(lineData.indexOf(":") + 1),
                                "yyyyMMddThhmmssZ"));
                        timestamp.setTimeSpec(Qt::UTC);
-                       event.setTimestamp(timestamp);
+                       event.Timestamp(timestamp);
                }
                else if(lineData.startsWith("BEGIN:"))
                {
                }
                else if(lineData.startsWith("BEGIN:"))
                {
index 7997fc2..2575247 100644 (file)
@@ -61,12 +61,12 @@ PhoneCall::~PhoneCall()
 PhoneCall::PhoneCall(const Settings &settings, const RTComElEvent &event, const QList<RTComElAttachment*> attachments) :
        m_Settings(settings)
 {
 PhoneCall::PhoneCall(const Settings &settings, const RTComElEvent &event, const QList<RTComElAttachment*> attachments) :
        m_Settings(settings)
 {
-       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);
+       Destination(event.fld_outgoing ? Settings::OUTGOING : Settings::INCOMING);
+       Timestamp(QDateTime::fromTime_t(event.fld_start_time).toUTC());
+       DurationInSeconds(QDateTime::fromTime_t(event.fld_start_time).toUTC().secsTo(QDateTime::fromTime_t(event.fld_end_time).toUTC()));
+       Tel(event.fld_remote_uid);
        if(Tel().indexOf("0") == 0)
        if(Tel().indexOf("0") == 0)
-               setTel(QString(Tel()).replace(QRegExp("^0"), "+44"));
+               Tel(QString(Tel()).replace(QRegExp("^0"), "+44"));
 
        if(attachments.count() > 0)
                foreach(RTComElAttachment *attachment, attachments)
 
        if(attachments.count() > 0)
                foreach(RTComElAttachment *attachment, attachments)
@@ -80,7 +80,7 @@ PhoneCall::PhoneCall(const Settings &settings, const Settings::eDirection destin
        m_DurationInSeconds(durationInSeconds), m_Attachments(attachments)
 {
        if(Tel().indexOf("0") == 0)
        m_DurationInSeconds(durationInSeconds), m_Attachments(attachments)
 {
        if(Tel().indexOf("0") == 0)
-               setTel(QString(Tel()).replace(QRegExp("^0"), "+44"));
+               Tel(QString(Tel()).replace(QRegExp("^0"), "+44"));
 
        // TODO: Copy attachments.
 //     if(attachments.count() > 0)
 
        // TODO: Copy attachments.
 //     if(attachments.count() > 0)
index c246258..223f30d 100644 (file)
@@ -46,16 +46,16 @@ namespace EventTypes
                virtual const uint HashCode() const;
 
                const Settings::eDirection Destination() const { return m_Destination; }
                virtual const uint HashCode() const;
 
                const Settings::eDirection Destination() const { return m_Destination; }
-               void setDestination(const Settings::eDirection destination) { m_Destination = destination; }
+               void Destination(const Settings::eDirection destination) { m_Destination = destination; }
 
                virtual const QDateTime Timestamp() const { return m_Timestamp; }
 
                virtual const QDateTime Timestamp() const { return m_Timestamp; }
-               void setTimestamp(const QDateTime timestamp) { m_Timestamp = timestamp; }
+               void Timestamp(const QDateTime timestamp) { m_Timestamp = timestamp; }
 
                const QString Tel() const { return m_Tel; }
 
                const QString Tel() const { return m_Tel; }
-               void setTel(const QString tel) { m_Tel = tel; }
+               void Tel(const QString tel) { m_Tel = tel; }
 
                virtual const int DurationInSeconds() const { return m_DurationInSeconds; }
 
                virtual const int DurationInSeconds() const { return m_DurationInSeconds; }
-               void setDurationInSeconds(const int durationInSeconds) { m_DurationInSeconds = durationInSeconds; }
+               void DurationInSeconds(const int durationInSeconds) { m_DurationInSeconds = durationInSeconds; }
 
                virtual const AttachmentCollection & Attachments() const { return m_Attachments; }
                virtual AttachmentCollection & Attachments() { return m_Attachments; }
 
                virtual const AttachmentCollection & Attachments() const { return m_Attachments; }
                virtual AttachmentCollection & Attachments() { return m_Attachments; }
index 97ee9c5..d325a56 100644 (file)
@@ -60,15 +60,20 @@ SMS::~SMS()
 SMS::SMS(const Settings &settings, const RTComElEvent &event, const QList<RTComElAttachment*> attachments) :
        m_Settings(settings)
 {
 SMS::SMS(const Settings &settings, const RTComElEvent &event, const QList<RTComElAttachment*> attachments) :
        m_Settings(settings)
 {
-       setVersion(2.1);
-       setIsRead(event.fld_is_read);
-       setDestination(event.fld_outgoing ? SENT : INBOX);
-       setTimestamp(QDateTime::fromTime_t(event.fld_start_time).toUTC());
-       setTel(QString::fromUtf8(event.fld_remote_uid));
+       Version(2.1);
+       IsRead(event.fld_is_read);
+       Destination(event.fld_outgoing ? SENT : INBOX);
+       Timestamp(QDateTime::fromTime_t(event.fld_start_time).toUTC());
+       Tel(QString::fromUtf8(event.fld_remote_uid));
        if(Tel().indexOf("0") == 0)
        if(Tel().indexOf("0") == 0)
-               setTel(QString(Tel()).replace(QRegExp("^0"), "+44"));
-       //setContents(QString(event.fld_free_text).replace("\n", QChar(0x2029)));
-       setContents(QString::fromUtf8(event.fld_free_text));
+               Tel(QString(Tel()).replace(QRegExp("^0"), "+44"));
+       //Contents(QString(event.fld_free_text).replace("\n", QChar(0x2029)));
+       Contents(QString::fromUtf8(event.fld_free_text));
+       if(event.fld_flags != 0)
+       {
+               qDebug() << "fld_flags: = " << event.fld_flags;
+       }
+       Pending(event.fld_flags & GetFlagValue("RTCOM_EL_FLAG_SMS_PENDING"));
 
        // We directly access the m_Attachments member variable here rather than the
        // accessor as the accessor is const
 
        // We directly access the m_Attachments member variable here rather than the
        // accessor as the accessor is const
index 696003a..ce79556 100644 (file)
@@ -50,23 +50,25 @@ namespace EventTypes
                virtual const uint HashCode() const;
 
                const float Version() const { return m_Version; }
                virtual const uint HashCode() const;
 
                const float Version() const { return m_Version; }
-               void setVersion(const float version) { m_Version = version; }
+               void Version(const float version) { m_Version = version; }
 
                const bool IsRead() const { return m_Read; }
 
                const bool IsRead() const { return m_Read; }
-               void setIsRead(const bool isRead) { m_Read = isRead; }
+               void IsRead(const bool isRead) { m_Read = isRead; }
 
                const eDestination Destination() const { return m_Destination; }
 
                const eDestination Destination() const { return m_Destination; }
-               void setDestination(const eDestination destination) { m_Destination = destination; }
+               void Destination(const eDestination destination) { m_Destination = destination; }
 
                virtual const QDateTime Timestamp() const { return m_Timestamp; }
 
                virtual const QDateTime Timestamp() const { return m_Timestamp; }
-               void setTimestamp(const QDateTime timestamp) { m_Timestamp = timestamp; }
+               void Timestamp(const QDateTime timestamp) { m_Timestamp = timestamp; }
 
                const QString Tel() const { return m_Tel; }
 
                const QString Tel() const { return m_Tel; }
-               void setTel(const QString tel) { m_Tel = tel; }
+               void Tel(const QString tel) { m_Tel = tel; }
 
                QString Contents() const { return m_Contents; }
 
                QString Contents() const { return m_Contents; }
-               void setContents(const QString contents) { m_Contents = contents; }
+               void Contents(const QString contents) { m_Contents = contents; }
 
 
+               bool Pending() const { return m_Pending; }
+               void Pending(const bool pending) { m_Pending = pending; }
                virtual const AttachmentCollection & Attachments() const { return m_Attachments; }
                virtual AttachmentCollection & Attachments() { return m_Attachments; }
 
                virtual const AttachmentCollection & Attachments() const { return m_Attachments; }
                virtual AttachmentCollection & Attachments() { return m_Attachments; }
 
@@ -87,6 +89,7 @@ namespace EventTypes
                QString m_Tel;
                QString m_Contents;
                AttachmentCollection m_Attachments;
                QString m_Tel;
                QString m_Contents;
                AttachmentCollection m_Attachments;
+               bool m_Pending;
        };
 }
 
        };
 }