equal
deleted
inserted
replaced
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include "nmuiheaders.h" |
18 #include "nmuiheaders.h" |
19 |
19 |
|
20 static const QString NmSettingsPluginFolderPath("/resource/qt/plugins/nmail/uiext"); |
|
21 |
20 /*! |
22 /*! |
21 \class NmUiExtensionManager |
23 \class NmUiExtensionManager |
22 \brief Handles ui extension plugins |
24 \brief Handles ui extension plugins |
23 */ |
25 */ |
24 |
|
25 // ======== HELPER FUNCTIONS ======== |
|
26 |
26 |
27 /*! |
27 /*! |
28 Creates list of folder paths where plug-ins can be loaded from. |
28 Creates list of folder paths where plug-ins can be loaded from. |
29 \return folder path list. |
29 \return folder path list. |
30 */ |
30 */ |
31 QStringList NmUiExtensionManager::pluginFolders() |
31 QStringList NmUiExtensionManager::pluginFolders() |
32 { |
32 { |
33 NM_FUNCTION; |
33 NM_FUNCTION; |
34 |
34 |
35 const QString NmSettingsPluginFolderPath("/resource/qt/plugins/nmail/uiext"); |
|
36 QStringList pluginDirectories; |
35 QStringList pluginDirectories; |
37 QFileInfoList driveList = QDir::drives(); |
36 QFileInfoList driveList = QDir::drives(); |
38 |
37 |
39 foreach(const QFileInfo &driveInfo, driveList) { |
38 foreach(const QFileInfo &driveInfo, driveList) { |
40 QString pluginDirectory = |
39 QString pluginDirectory = |
79 QList<NmAction*> &actionList) |
78 QList<NmAction*> &actionList) |
80 { |
79 { |
81 NM_FUNCTION; |
80 NM_FUNCTION; |
82 |
81 |
83 for (int i = 0; i < mExtensions.count(); i++) { |
82 for (int i = 0; i < mExtensions.count(); i++) { |
84 NmUiExtensionInterface* interface = mExtensions[i]; |
83 NmUiExtensionInterface *interface = mExtensions[i]; |
85 interface->getActions(menuRequest, actionList); |
84 interface->getActions(menuRequest, actionList); |
86 } |
85 } |
87 } |
86 } |
88 /*! |
87 /*! |
89 Loads plug-ins which implements NmUiExtensionInterface and are registered |
88 Loads plug-ins which implements NmUiExtensionInterface and are registered |
105 mPluginLoaders.append(loader.data()); |
104 mPluginLoaders.append(loader.data()); |
106 loader.take(); |
105 loader.take(); |
107 } |
106 } |
108 } |
107 } |
109 |
108 |
110 NmUiExtensionInterface *interface = NULL; |
109 NmUiExtensionInterface *interface(NULL); |
111 foreach (QPluginLoader *loader, mPluginLoaders) { |
110 foreach (QPluginLoader *loader, mPluginLoaders) { |
112 NM_COMMENT(QString("Plugin fileName() : %1").arg(loader->fileName())); |
111 NM_COMMENT(QString("Plugin fileName() : %1").arg(loader->fileName())); |
113 QString fileName = loader->fileName(); |
112 QString fileName = loader->fileName(); |
114 QObject *pluginInstance = loader->instance(); |
113 QObject *pluginInstance = loader->instance(); |
115 interface = qobject_cast<NmUiExtensionInterface*>(pluginInstance); |
114 interface = qobject_cast<NmUiExtensionInterface*>(pluginInstance); |