From 3c09112da2a8ee65da57fb571bdfbc4d9f5f5d21 Mon Sep 17 00:00:00 2001 From: cdfrey Date: Sat, 10 Dec 2005 07:24:31 +0000 Subject: [PATCH] - moved some record class variables to public: so they can be properly serialized --- src/record.cc | 12 ++++++------ src/record.h | 12 ++++-------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/record.cc b/src/record.cc index e1b2ad75..3c111ee1 100644 --- a/src/record.cc +++ b/src/record.cc @@ -450,14 +450,14 @@ void Contact::Parse(const Data &data, unsigned int operation) case SB_DBOP_GET_RECORDS: // using the new protocol // save the contact record ID - m_recordId = pack->data.db.data.contact.uniqueId; + RecordId = pack->data.db.data.contact.uniqueId; begin = &pack->data.db.data.contact.field[0]; break; case SB_DBOP_OLD_GET_RECORDS_REPLY: // using the old protocol // save the contact record ID - m_recordId = pack->data.db.data.old_contact.uniqueId; + RecordId = pack->data.db.data.old_contact.uniqueId; begin = &pack->data.db.data.old_contact.field[0]; break; } @@ -481,7 +481,7 @@ void Contact::Build(Data &data, unsigned int databaseId) const spack->data.db.data.contact_up.operation = SB_DBOP_SET_RECORD; spack->data.db.data.contact_up.databaseId = databaseId; spack->data.db.data.contact_up.unknown = 0; - spack->data.db.data.contact_up.uniqueId = m_recordId; + spack->data.db.data.contact_up.uniqueId = RecordId; spack->data.db.data.contact_up.unknown2 = 1; // special fields not in type table @@ -907,14 +907,14 @@ void Calendar::Parse(const Data &data, unsigned int operation) // using the new protocol // save the contact record ID throw std::logic_error("New Calendar: Not yet implemented"); -// m_recordId = pack->data.db.data.calendar.uniqueId; +// RecordId = pack->data.db.data.calendar.uniqueId; // begin = &pack->data.db.data.calendar.field[0]; break; case SB_DBOP_OLD_GET_RECORDS_REPLY: // using the old protocol // save the contact record ID - m_recordId = pack->data.db.data.old_calendar.uniqueId; + RecordId = pack->data.db.data.old_calendar.uniqueId; begin = &pack->data.db.data.old_calendar.field[0]; break; } @@ -933,7 +933,7 @@ void Calendar::Clear() void Calendar::Dump(std::ostream &os) const { - os << "Calendar entry: 0x" << setbase(16) << m_recordId << "\n"; + os << "Calendar entry: 0x" << setbase(16) << RecordId << "\n"; // cycle through the type table for( const FieldLink *b = CalendarFieldLinks; diff --git a/src/record.h b/src/record.h index c8ec7c2e..e5fae386 100644 --- a/src/record.h +++ b/src/record.h @@ -137,16 +137,13 @@ std::ostream& operator<< (std::ostream &os, const std::vector &unk class Contact { -private: - // private contact management data - uint32_t m_recordId; - public: struct GroupLink { uint32_t Link; uint16_t Unknown; + GroupLink() : Link(0), Unknown(0) {} GroupLink(uint32_t link, uint16_t unknown) : Link(link), Unknown(unknown) {} @@ -156,6 +153,7 @@ public: typedef std::vector UnknownsType; // contact specific data + uint32_t RecordId; std::string Email, Phone, @@ -193,7 +191,7 @@ public: Contact(); ~Contact(); - uint64_t GetID() const { return m_recordId; } + uint64_t GetID() const { return RecordId; } std::string GetPostalAddress() const; void Parse(const Data &data, unsigned int operation); @@ -256,10 +254,8 @@ std::ostream& operator<<(std::ostream &os, const Message::Address &msga); class Calendar { -private: - uint64_t m_recordId; - public: + uint64_t RecordId; std::string Subject; std::string Notes; std::string Location; -- 2.11.4.GIT