From 5ab221aed601a7aaa344afe130e43ab2ede76ee1 Mon Sep 17 00:00:00 2001
From: Eike Ziller <eike.ziller@nokia.com>
Date: Thu, 9 Feb 2012 13:34:33 +0100
Subject: [PATCH] Add missing information about optional plugin dependencies

Change-Id: I845dbd32534f544980d2cc3f1da3f3bf47b65e4e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@nokia.com>
---
 doc/api/plugin-specifications.qdoc | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/doc/api/plugin-specifications.qdoc b/doc/api/plugin-specifications.qdoc
index da7b5dbdfbc..94821d69047 100644
--- a/doc/api/plugin-specifications.qdoc
+++ b/doc/api/plugin-specifications.qdoc
@@ -172,6 +172,26 @@
            a hard requirement or optional. Defaults to \c{required}.
     \endtable
 
+    \section3 Optional Dependencies
+
+    A plugin can specify that a dependency on another plugin is optional, by adding the
+    \c {type="optional"} attribute to the \c dependency tag:
+
+    \list
+        \o If the dependency can be resolved, the plugin and
+           its dependency are loaded and initialized as for \c required dependencies.
+        \o If the dependency can not be resolved, the plugin is loaded and initialized
+           as if the dependency was not declared at all.
+    \endlist
+
+    The plugin is not informed about the existence of optional dependencies in any way. Since the
+    dependency might be loaded or not, the plugin may also not link against the dependency.
+    A common way to access objects from optional dependencies is to get the object from the
+    \l{The Plugin Manager, the Object Pool, and Registered Objects}{global object pool}
+    via ExtensionSystem::PluginManager::getObjectByName() or
+    ExtensionSystem::PluginManager::getObjectByClassName(), and use QMetaObject functions to call
+    methods on it.
+
     \section2 Command Line Arguments
 
     Plugins can register command line arguments that the user can give
-- 
GitLab