00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#include "kdevice.h"
00023
00024
using namespace KSync;
00025
00026
class Device::DevicePrivate
00027 {
00028
public:
00029
QString name;
00030
QString group;
00031
QString vendor;
00032
QString library;
00033
QString id;
00034 };
00035
00036 Device::Device(
const QString &ident,
const QString &group,
00037
const QString &vendor,
const QString &library,
00038
const QString &
id )
00039 {
00040 d =
new DevicePrivate();
00041 d->name= ident;
00042 d->group = group;
00043 d->vendor = vendor;
00044 d->library = library;
00045 d->id =
id;
00046 }
00047
00048 Device::Device()
00049 {
00050 d =
new DevicePrivate();
00051 }
00052
00053 Device::Device(
const Device &dev )
00054 {
00055 d =
new DevicePrivate();
00056 d->name = dev.name();
00057 d->group = dev.group();
00058 d->vendor = dev.vendor();
00059 d->library = dev.library();
00060 d->id = dev.d->id;
00061 }
00062
00063 Device &Device::operator=(
const Device &dev )
00064 {
00065 d =
new DevicePrivate;
00066 d->name = dev.d->name;
00067 d->group = dev.d->group;
00068 d->vendor = dev.d->vendor;
00069 d->library = dev.d->library;
00070 d->id = dev.d->id;
00071
00072
return *
this;
00073 }
00074
00075 Device::~Device()
00076 {
00077
delete d;
00078 }
00079
00080
QString Device::name()
const
00081
{
00082
return d->name;
00083 }
00084
00085
QString Device::group()
const
00086
{
00087
return d->group;
00088 }
00089
00090
QString Device::vendor()
const
00091
{
00092
return d->vendor;
00093 }
00094
00095
QString Device::library()
const
00096
{
00097
return d->library;
00098 }
00099
00100
QString Device::identify()
const
00101
{
00102
return d->id;
00103 }
00104
00105
bool Device::operator==(
const Device &dest )
00106 {
00107
if( identify() == dest.identify() &&
00108 group() == dest.group() &&
00109 vendor() == dest.vendor() ) {
00110
return true;
00111 }
else {
00112
return false;
00113 }
00114 }