Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaojing.zhang
fmp_vip
Commits
27759247
Commit
27759247
authored
Apr 17, 2017
by
Carwyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.同步基础接口InitService/UninitService
parent
794b72a6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
34 deletions
+36
-34
fmp_ve_handlers.cpp
+1
-1
fmp_vip.cpp
+6
-8
fmp_vip.h
+4
-3
fmp_vip_i.h
+16
-3
fmp_vip_p.cpp
+7
-12
fmp_vip_p.h
+2
-7
No files found.
fmp_ve_handlers.cpp
View file @
27759247
...
@@ -17,7 +17,7 @@ void FMPStartEventHandler::handleEvent(const ctkEvent &event)
...
@@ -17,7 +17,7 @@ void FMPStartEventHandler::handleEvent(const ctkEvent &event)
{
{
if
(
_vip
)
{
if
(
_vip
)
{
if
(
event
.
getProperty
(
FMP_PROPKEY_AGREED
).
toBool
())
{
if
(
event
.
getProperty
(
FMP_PROPKEY_AGREED
).
toBool
())
{
_vip
->
StartVip
();
_vip
->
TriggerInit
();
}
}
else
{
else
{
FMP_WARN
()
<<
"Refused start request"
<<
event
.
getTopic
();
FMP_WARN
()
<<
"Refused start request"
<<
event
.
getTopic
();
...
...
fmp_vip.cpp
View file @
27759247
...
@@ -13,16 +13,14 @@ FMPVip::FMPVip(ctkPluginContext *context)
...
@@ -13,16 +13,14 @@ FMPVip::FMPVip(ctkPluginContext *context)
FMPLoggerInterface
::
InitContext
(
context
);
FMPLoggerInterface
::
InitContext
(
context
);
}
}
int
FMPVip
::
Stop
Service
()
void
FMPVip
::
Init
Service
()
{
{
if
(
!
_inited
)
return
FMP_SUCCESS
;
d_func
()
->
Init
();
Q_D
(
FMPVip
);
return
d
->
StopService
();
}
}
int
FMPVip
::
StartVip
()
void
FMPVip
::
UninitService
()
{
{
Q_D
(
FMPVip
);
if
(
_inited
)
{
return
d
->
StartVip
();
d_func
()
->
Uninit
();
}
}
}
fmp_vip.h
View file @
27759247
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
class
FMPVipPrivate
;
class
FMPVipPrivate
;
class
FMPVip
:
public
QObject
,
public
FMPVipInterface
class
FMPVip
:
public
FMPVipInterface
{
{
Q_OBJECT
Q_OBJECT
Q_INTERFACES
(
FMPBaseInterface
)
Q_INTERFACES
(
FMPBaseInterface
)
...
@@ -16,8 +16,9 @@ class FMPVip : public QObject, public FMPVipInterface
...
@@ -16,8 +16,9 @@ class FMPVip : public QObject, public FMPVipInterface
public
:
public
:
FMPVip
(
ctkPluginContext
*
context
);
FMPVip
(
ctkPluginContext
*
context
);
int
StopService
();
protected
slots
:
int
StartVip
();
void
InitService
();
void
UninitService
();
private
:
private
:
bool
_inited
;
bool
_inited
;
FMPVipPrivate
*
d_ptr
;
FMPVipPrivate
*
d_ptr
;
...
...
fmp_vip_i.h
View file @
27759247
...
@@ -7,11 +7,24 @@
...
@@ -7,11 +7,24 @@
* 业务插件接口,必须继承自 FMPluginInterface
* 业务插件接口,必须继承自 FMPluginInterface
* @brief The FMPVipInterface class
* @brief The FMPVipInterface class
*/
*/
class
FMPVipInterface
:
public
FMPluginInterface
class
FMPVipInterface
:
public
QObject
,
public
FMPluginInterface
{
{
Q_OBJECT
Q_INTERFACES
(
FMPBaseInterface
)
Q_INTERFACES
(
FMPluginInterface
)
public
:
public
:
explicit
FMPVipInterface
(
ctkPluginContext
*
ctx
)
:
FMPluginInterface
(
ctx
)
{}
explicit
FMPVipInterface
(
ctkPluginContext
*
ctx
)
:
FMPluginInterface
(
ctx
)
virtual
int
StartVip
()
=
0
;
{
connect
(
this
,
&
FMPVipInterface
::
TriggerInit
,
this
,
&
FMPVipInterface
::
InitService
);
connect
(
this
,
&
FMPVipInterface
::
TriggerUninit
,
this
,
&
FMPVipInterface
::
UninitService
);
}
protected
slots
:
void
InitService
()
=
0
;
void
UninitService
()
=
0
;
signals
:
void
TriggerInit
();
void
TriggerUninit
();
};
};
...
...
fmp_vip_p.cpp
View file @
27759247
...
@@ -14,10 +14,9 @@
...
@@ -14,10 +14,9 @@
FMPVipPrivate
::
FMPVipPrivate
(
FMPVip
*
vip
)
:
FMPVipPrivate
::
FMPVipPrivate
(
FMPVip
*
vip
)
:
q_ptr
(
vip
)
q_ptr
(
vip
)
{
{
connect
(
this
,
&
FMPVipPrivate
::
startVip
,
this
,
&
FMPVipPrivate
::
onStartVip
);
}
}
int
FMPVipPrivate
::
StartVip
()
int
FMPVipPrivate
::
Init
()
{
{
Q_Q
(
FMPVip
);
Q_Q
(
FMPVip
);
FMPHomeInterface
*
home
=
q
->
GetService
<
FMPHomeInterface
>
(
q
->
_ctx
);
FMPHomeInterface
*
home
=
q
->
GetService
<
FMPHomeInterface
>
(
q
->
_ctx
);
...
@@ -27,17 +26,21 @@ int FMPVipPrivate::StartVip()
...
@@ -27,17 +26,21 @@ int FMPVipPrivate::StartVip()
_settings
=
q
->
GetService
<
FMPSettingsInterface
>
(
q
->
_ctx
);
_settings
=
q
->
GetService
<
FMPSettingsInterface
>
(
q
->
_ctx
);
FMPVipSettings
::
instance
()
->
init
(
_settings
);
FMPVipSettings
::
instance
()
->
init
(
_settings
);
emit
startVip
();
auto
resend
=
new
ReSend
();
resend
->
start
();
FMPVipServer
::
instance
();
q
->
_inited
=
true
;
q
->
_inited
=
true
;
home
->
notification
(
QString
::
fromLocal8Bit
(
"[非码会员]启动成功!"
));
home
->
notification
(
QString
::
fromLocal8Bit
(
"[非码会员]启动成功!"
));
FMP_INFO
()
<<
"Vip start"
;
FMP_INFO
()
<<
"Vip start"
;
}
}
return
FMP_SUCCESS
;
return
FMP_SUCCESS
;
}
}
int
FMPVipPrivate
::
StopService
()
int
FMPVipPrivate
::
Uninit
()
{
{
Q_Q
(
FMPVip
);
Q_Q
(
FMPVip
);
...
@@ -45,11 +48,3 @@ int FMPVipPrivate::StopService()
...
@@ -45,11 +48,3 @@ int FMPVipPrivate::StopService()
q
->
_inited
=
false
;
q
->
_inited
=
false
;
return
FMP_SUCCESS
;
return
FMP_SUCCESS
;
}
}
void
FMPVipPrivate
::
onStartVip
()
{
auto
resend
=
new
ReSend
();
resend
->
start
();
FMPVipServer
::
instance
();
}
fmp_vip_p.h
View file @
27759247
...
@@ -13,13 +13,8 @@ class FMPVipPrivate : public QObject
...
@@ -13,13 +13,8 @@ class FMPVipPrivate : public QObject
public
:
public
:
FMPVipPrivate
(
FMPVip
*
vip
);
FMPVipPrivate
(
FMPVip
*
vip
);
int
StopService
();
int
Init
();
int
StartVip
();
int
Uninit
();
signals
:
void
startVip
();
private
slots
:
void
onStartVip
();
public
:
public
:
FMPVip
*
q_ptr
;
FMPVip
*
q_ptr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment