| 106 | if (_pluginsDir.cd("plugins")) { |
| 107 | if (_pluginsDir.cd("tools")) { |
| 108 | foreach(QString fileName, _pluginsDir.entryList(QDir::Files)) { |
| 109 | if (fileName.toLower().endsWith(sharedLibraryExtensions)) { |
| 110 | QPluginLoader loader(_pluginsDir.absoluteFilePath(fileName)); |
| 111 | QObject *plugin = loader.instance(); |
| 112 | if (plugin) { |
| 113 | std::shared_ptr<ToolPluginInterface> tool(qobject_cast<ToolPluginInterface*>(plugin)); |
| 114 | if (tool) { |
| 115 | tool->setViewer(viewer); |
| 116 | QAction* toolAction = tool->getToolButton(); |
| 117 | connect(toolAction, SIGNAL(triggered(bool)), viewer, SLOT(changeActiveTool())); |
| 118 | _toolPluginFileNames.push_back(fileName.toStdString()); |
| 119 | viewer->addTool(tool); |
| 120 | QToolBar* mainToolBar = this->findChild<QToolBar *>("mainToolBar"); |
| 121 | toolAction->setCheckable(true); |
| 122 | _toolActions->addAction(toolAction); |
| 123 | mainToolBar->addAction(toolAction); |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | _pluginsDir.cdUp(); |
| 129 | } |
| 130 | if (_pluginsDir.cd("workstationextension")) { |
nothing calls this directly
no test coverage detected