Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dtk
dtk
Commits
9dfebaa5
Commit
9dfebaa5
authored
May 14, 2014
by
Julien Wintz
Browse files
Output error string on plugin load/unload failure.
parent
aad1fd07
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/dtkCore/dtkCorePluginFactory_t.h
View file @
9dfebaa5
...
...
@@ -24,8 +24,9 @@ template <typename T> dtkCorePluginFactory<T>::~dtkCorePluginFactory(void)
}
#pragma mark -
#pragma mark Type creator registration
// /////////////////////////////////////////////////////////////////
// Type creator registration
// /////////////////////////////////////////////////////////////////
template
<
typename
T
>
void
dtkCorePluginFactory
<
T
>::
record
(
const
QString
&
key
,
creator
func
)
{
...
...
@@ -37,8 +38,9 @@ template <typename T> void dtkCorePluginFactory<T>::record(const QString& key, c
this
->
creators
.
insert
(
key
,
func
);
}
#pragma mark -
#pragma mark Type creator invokation
// /////////////////////////////////////////////////////////////////
// Type creator invokation
// /////////////////////////////////////////////////////////////////
template
<
typename
T
>
T
*
dtkCorePluginFactory
<
T
>::
create
(
const
QString
&
key
)
{
...
...
@@ -48,8 +50,9 @@ template <typename T> T *dtkCorePluginFactory<T>::create(const QString& key)
return
this
->
creators
.
value
(
key
)();
}
#pragma mark -
#pragma mark Type creator inspection
// /////////////////////////////////////////////////////////////////
// Type creator inspection
// /////////////////////////////////////////////////////////////////
template
<
typename
T
>
QStringList
dtkCorePluginFactory
<
T
>::
keys
(
void
)
{
...
...
src/dtkCore/dtkCorePluginManager_t.h
View file @
9dfebaa5
...
...
@@ -87,8 +87,9 @@ template <typename T> dtkCorePluginManager<T>::~dtkCorePluginManager(void)
d
=
NULL
;
}
#pragma mark -
#pragma Manager Management
// /////////////////////////////////////////////////////////////////
// Manager Management
// /////////////////////////////////////////////////////////////////
template
<
typename
T
>
void
dtkCorePluginManager
<
T
>::
initialize
(
const
QString
&
path
)
{
...
...
@@ -107,8 +108,9 @@ template <typename T> void dtkCorePluginManager<T>::uninitialize(void)
this
->
unload
(
path
);
}
#pragma mark -
#pragma Plugin Management
// /////////////////////////////////////////////////////////////////
// Plugin Management
// /////////////////////////////////////////////////////////////////
template
<
typename
T
>
void
dtkCorePluginManager
<
T
>::
scan
(
const
QString
&
path
)
{
...
...
@@ -142,6 +144,7 @@ template <typename T> void dtkCorePluginManager<T>::load(const QString& path)
T
*
plugin
=
qobject_cast
<
T
*>
(
loader
->
instance
());
if
(
!
plugin
)
{
qDebug
()
<<
loader
->
errorString
();
delete
loader
;
return
;
}
...
...
@@ -158,16 +161,19 @@ template <typename T> void dtkCorePluginManager<T>::unload(const QString& path)
T
*
plugin
=
qobject_cast
<
T
*>
(
loader
->
instance
());
if
(
plugin
)
plugin
->
uninitialize
();
plugin
->
uninitialize
();
if
(
loader
->
unload
())
{
d
->
loaders
.
remove
(
path
);
delete
loader
;
}
else
{
qDebug
()
<<
loader
->
errorString
();
}
}
#pragma mark -
#pragma Plugin Queries
// /////////////////////////////////////////////////////////////////
// Plugin Queries
// /////////////////////////////////////////////////////////////////
template
<
typename
T
>
QStringList
dtkCorePluginManager
<
T
>::
plugins
(
void
)
{
...
...
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