Rabbit Remote Control
0.1.0-bate14
Toggle main menu visibility
Loading...
Searching...
No Matches
Service
ServiceThread.cpp
1
// Author: Kang Lin <kl222@126.com>
2
3
#include "ServiceThread.h"
4
#include <QLoggingCategory>
5
6
Q_DECLARE_LOGGING_CATEGORY(Service)
7
8
CServiceThread::CServiceThread(
CPluginService
*pPlugin, QObject *parent)
9
: QThread(parent),
10
m_pPlugin(pPlugin)
11
{
12
}
13
14
CServiceThread::~CServiceThread()
15
{
16
qDebug(Service) <<
"CServiceThread::~CServiceThread()"
;
17
}
18
19
void
CServiceThread::run()
20
{
21
CService* pService = m_pPlugin->NewService();
22
if
(!pService)
23
{
24
qCritical(Service) <<
"GetService fail"
;
25
return
;
26
}
27
qInfo(Service) <<
"The service"
<< m_pPlugin->Name() <<
"is start"
;
28
29
int
nRet = pService->
Init
();
30
if
(nRet)
31
{
32
qWarning(Service) <<
"The service"
<< m_pPlugin->Name() <<
"initial fail"
;
33
return
;
34
}
35
36
exec();
37
38
qInfo(Service) <<
"The service"
<< m_pPlugin->Name() <<
"is stop"
;
39
40
pService->Clean();
41
pService->deleteLater();
42
}
CPluginService
The service plugin interface.
Definition
PluginService.h:27
CService::Init
virtual int Init()
Load parameters, support non-Qt event loop.
Definition
Service.cpp:24
Author: Kang Lin (kl222@126.com)
Copyright (c) Kang Lin Studios All Rights Reserved