From 0608e277e7cfa0b3cf847a5e6bbd9556b0717752 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Fri, 19 May 2017 14:36:41 +0200 Subject: [PATCH] Added camp service class. --- camp/camp.pro | 6 ++++-- camp/campservice.cpp | 18 ++++++++++++++++++ camp/campservice.h | 11 +++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 camp/campservice.cpp create mode 100644 camp/campservice.h diff --git a/camp/camp.pro b/camp/camp.pro index 4a09b07..91eb172 100644 --- a/camp/camp.pro +++ b/camp/camp.pro @@ -32,7 +32,8 @@ SOURCES += camp.cpp \ settings/campsettingsform.cpp \ data/personprice.cpp \ settings/campsettings.cpp \ - campwizard.cpp + campwizard.cpp \ + campservice.cpp HEADERS += camp.h\ camp_global.h \ @@ -46,7 +47,8 @@ HEADERS += camp.h\ settings/campsettingsform.h \ data/personprice.h \ settings/campsettings.h \ - campwizard.h + campwizard.h \ + campservice.h include(../config_plugin.pri) diff --git a/camp/campservice.cpp b/camp/campservice.cpp new file mode 100644 index 0000000..f0fe322 --- /dev/null +++ b/camp/campservice.cpp @@ -0,0 +1,18 @@ +#include "campservice.h" + +CampService::CampService() +{ +} + +void CampService::addPerson(CampDataPtr data, AddressbookDataPtr address) +{ + AddressItemPtr addrItem(new AddressItem); + + addrItem->setAdbItem(address); + addrItem->setAddress(address->toString()); + addrItem->setFirstName(address->firstName()); + addrItem->setLastName(address->lastName()); + addrItem->setCampData(data); + + data->addPerson(addrItem); +} diff --git a/camp/campservice.h b/camp/campservice.h new file mode 100644 index 0000000..56929dc --- /dev/null +++ b/camp/campservice.h @@ -0,0 +1,11 @@ +#ifndef CAMPSERVICE_H +#define CAMPSERVICE_H + + +class CampService +{ +public: + CampService(); +}; + +#endif // CAMPSERVICE_H \ No newline at end of file