Plasma
serviceaccessjob.cpp
Go to the documentation of this file.
00001 /* 00002 * Copyright 2009 Rob Scheepmaker <r.scheepmaker@student.utwente.nl> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #include "serviceaccessjob.h" 00021 #include "private/remoteservice_p.h" 00022 00023 namespace Plasma 00024 { 00025 00026 class ServiceAccessJobPrivate 00027 { 00028 public: 00029 ServiceAccessJobPrivate(ServiceAccessJob *owner, KUrl location) 00030 : q(owner), 00031 service(0), 00032 location(location) 00033 { 00034 } 00035 00036 void slotStart() 00037 { 00038 q->start(); 00039 } 00040 00041 void slotServiceReady() 00042 { 00043 q->emitResult(); 00044 } 00045 00046 ServiceAccessJob *q; 00047 Service *service; 00048 KUrl location; 00049 }; 00050 00051 ServiceAccessJob::ServiceAccessJob(KUrl location, QObject *parent) 00052 : KJob(parent), 00053 d(new ServiceAccessJobPrivate(this, location)) 00054 { 00055 } 00056 00057 ServiceAccessJob::~ServiceAccessJob() 00058 { 00059 delete d; 00060 } 00061 00062 Service *ServiceAccessJob::service() const 00063 { 00064 return d->service; 00065 } 00066 00067 void ServiceAccessJob::start() 00068 { 00069 d->service = new RemoteService(parent(), d->location); 00070 connect(d->service, SIGNAL(ready()), this, SLOT(slotServiceReady())); 00071 } 00072 00073 } // namespace Plasma 00074 00075 #include "serviceaccessjob.moc" 00076
KDE 4.6 API Reference