Skip to content

ENH: expose module load/unload API #1227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Base/QTCore/qSlicerAbstractModuleFactoryManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ class Q_SLICER_BASE_QTCORE_EXPORT qSlicerAbstractModuleFactoryManager : public Q
/// Uninstantiate all instantiated modules
void uninstantiateModules();

/// Instantiate a module given its \a name
Q_INVOKABLE qSlicerAbstractCoreModule* instantiateModule(const QString& name);

/// Uninstantiate a module given its \a moduleName
Q_INVOKABLE virtual void uninstantiateModule(const QString& moduleName);

/// Enable/Disable verbose output during module discovery process
void setVerboseModuleDiscovery(bool value);

Expand Down Expand Up @@ -227,12 +233,6 @@ public slots:

void registerModules(const QString& directoryPath);

/// Instantiate a module given its \a name
qSlicerAbstractCoreModule* instantiateModule(const QString& name);

/// Uninstantiate a module given its \a moduleName
virtual void uninstantiateModule(const QString& moduleName);

private:
Q_DECLARE_PRIVATE(qSlicerAbstractModuleFactoryManager);
Q_DISABLE_COPY(qSlicerAbstractModuleFactoryManager);
Expand Down
9 changes: 5 additions & 4 deletions Base/QTCore/qSlicerModuleFactoryManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ class Q_SLICER_BASE_QTCORE_EXPORT qSlicerModuleFactoryManager

/// Load module identified by \a name
/// \todo move it as protected
bool loadModule(const QString& name);
Q_INVOKABLE bool loadModule(const QString& name);

/// Unload module identified by \a name
Q_INVOKABLE void unloadModule(const QString& name);


/// Return all module paths that are direct child of \a basePath.
QStringList modulePaths(const QString& basePath);
Expand All @@ -112,9 +116,6 @@ public slots:

bool loadModule(const QString& name, const QString& dependee);

/// Unload module identified by \a name
void unloadModule(const QString& name);

/// Uninstantiate a module given its \a moduleName
void uninstantiateModule(const QString& moduleName) override;

Expand Down