00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If you 00004 ** did not receive the LICENSE file with this file, you may obtain it from the 00005 ** Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to the 00008 ** terms described in the LICENSE file. 00009 */ 00010 00011 #include "servicelist.h" 00012 00013 /** Default constructor. */ 00014 ServiceList::ServiceList() 00015 { 00016 } 00017 00018 /** Constructor to create a new Servicelist with initial settings */ 00019 void ServiceList::addService(Service service) 00020 { 00021 _services.append(service); 00022 } 00023 00024 /** Destructor */ 00025 ServiceList::~ServiceList() 00026 { 00027 } 00028 00029 /* Sets the serviceList */ 00030 void ServiceList::setServices(QList<Service> services) 00031 { 00032 _services = services; 00033 } 00034 00035 /** Writes ServiceList class data from <b>myObj</b> to the QDataStream 00036 * <b>out</b>. */ 00037 QDataStream&operator<<(QDataStream &out, const ServiceList &myObj) 00038 { 00039 out << myObj.services(); /* Write the services*/ 00040 return out; 00041 } 00042 00043 /** Reads ServiceList class data in from the QDataStream <b>in</b> and 00044 populates * the <b>myObj</b> object accordingly. */ 00045 QDataStream&operator>>(QDataStream &in, ServiceList &myObj) 00046 { 00047 QList<Service> services; 00048 /* Read in from the data stream */ 00049 in >> services; 00050 /* Set the appropriate class member variables */ 00051 myObj.setServices(services); 00052 /* Return the updated data stream */ 00053 return in; 00054 } 00055