Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_takeout
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
zhenfei.zhang
fmp_takeout
Commits
6f71ce4d
Commit
6f71ce4d
authored
Apr 20, 2017
by
Carwyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 解决业务插件在主线程调用停止服务卡死问题; 2. 在析构中调用停止服务接口;
parent
b7dc6d93
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
13 deletions
+25
-13
fmp_takeout.cpp
+11
-0
fmp_takeout.h
+5
-4
fmp_takeout_i.h
+7
-7
fmp_te_handlers.cpp
+2
-2
No files found.
fmp_takeout.cpp
View file @
6f71ce4d
#include "fmp_takeout_p.h"
#include "fmp_te_handlers.h"
FMPTakeout
::
FMPTakeout
(
ctkPluginContext
*
context
)
:
FMPTakeoutInterface
(
context
),
_inited
(
false
),
d_ptr
(
new
FMPTakeoutPrivate
(
this
))
{
FMPStartEventHandler
*
se
=
new
FMPStartEventHandler
(
_ctx
,
this
);
}
FMPTakeout
::~
FMPTakeout
()
{
StopService
();
if
(
d_ptr
)
{
delete
d_ptr
;
d_ptr
=
nullptr
;
}
}
void
FMPTakeout
::
InitService
()
...
...
fmp_takeout.h
View file @
6f71ce4d
...
...
@@ -14,11 +14,12 @@ class FMPTakeout : public FMPTakeoutInterface
Q_DECLARE_PRIVATE
(
FMPTakeout
)
public
:
FMPTakeout
(
ctkPluginContext
*
context
);
explicit
FMPTakeout
(
ctkPluginContext
*
context
);
virtual
~
FMPTakeout
();
protected
slots
:
void
UninitService
();
void
InitService
();
protected
:
void
UninitService
();
void
InitService
();
private
:
...
...
fmp_takeout_i.h
View file @
6f71ce4d
...
...
@@ -12,19 +12,19 @@ class FMPTakeoutInterface : public QObject, public FMPluginInterface
Q_INTERFACES
(
FMPBaseInterface
)
Q_INTERFACES
(
FMPluginInterface
)
public
:
explicit
FMPTakeoutInterface
(
ctkPluginContext
*
ctx
)
:
FMPluginInterface
(
ctx
)
explicit
FMPTakeoutInterface
(
ctkPluginContext
*
ctx
)
:
FMPluginInterface
(
ctx
)
{
connect
(
this
,
&
FMPTakeoutInterface
::
TriggerInit
,
this
,
&
FMPTakeoutInterface
::
InitService
);
connect
(
this
,
&
FMPTakeoutInterface
::
TriggerUninit
,
this
,
&
FMPTakeoutInterface
::
UninitService
);
connect
(
this
,
&
FMPTakeoutInterface
::
TriggerInit
,
this
,
&
FMPTakeoutInterface
::
OnTriggerInit
);
connect
(
this
,
&
FMPTakeoutInterface
::
TriggerUninit
,
this
,
&
FMPTakeoutInterface
::
OnTriggerUninit
);
}
signals
:
void
TriggerInit
();
void
TriggerUninit
();
void
TriggerInit
();
void
TriggerUninit
();
protected
slots
:
void
InitService
()
=
0
;
void
UninitService
()
=
0
;
void
OnTriggerInit
()
{
FMPluginInterface
::
OnTriggerInit
();
}
void
OnTriggerUninit
()
{
FMPluginInterface
::
OnTriggerUninit
();
}
};
Q_DECLARE_INTERFACE
(
FMPTakeoutInterface
,
"com.fmp.takeout"
)
...
...
fmp_te_handlers.cpp
View file @
6f71ce4d
...
...
@@ -2,7 +2,7 @@
#include "fmp_takeout.h"
FMPStartEventHandler
::
FMPStartEventHandler
(
ctkPluginContext
*
ctx
,
FMPTakeout
*
Takeout
)
:
FMPTakeoutEventHandler
(
FMP_TOPICS_SERVICES
FMPE_SERVICE_
REQ
_START
"/"
+
QString
::
number
(
ctx
->
getPlugin
()
->
getPluginId
()),
:
FMPTakeoutEventHandler
(
FMP_TOPICS_SERVICES
FMPE_SERVICE_
ACK
_START
"/"
+
QString
::
number
(
ctx
->
getPlugin
()
->
getPluginId
()),
Takeout
),
_ctx
(
ctx
)
{
...
...
@@ -16,7 +16,7 @@ void FMPStartEventHandler::handleEvent(const ctkEvent &event)
if
(
_Takeout
)
{
if
(
event
.
getProperty
(
FMP_PROPKEY_AGREED
).
toBool
())
{
// _epay->UpgradeOldPlugins(event.getProperty(FMP_PROPKEY_PID_LIST).toList());
// _Takeout->ShowForm
();
_Takeout
->
TriggerInit
();
}
else
{
// FMP_WARN_CTX(_ctx) << "Refused start request" << event.getTopic();
...
...
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