| 2905 | } |
| 2906 | |
| 2907 | void MainWin::addAspectToProject(AbstractAspect* aspect) { |
| 2908 | const QModelIndex& index = m_projectExplorer->currentIndex(); |
| 2909 | if (index.isValid()) { |
| 2910 | auto* parent = static_cast<AbstractAspect*>(index.internalPointer()); |
| 2911 | #ifdef HAVE_MQTT |
| 2912 | // doesn't make sense to add a new MQTTClient to an existing MQTTClient or to any of its successors |
| 2913 | QString className = QLatin1String(parent->metaObject()->className()); |
| 2914 | auto* clientAncestor = parent->ancestor<MQTTClient>(); |
| 2915 | if (className == QLatin1String("MQTTClient")) |
| 2916 | parent = parent->parentAspect(); |
| 2917 | else if (clientAncestor != nullptr) |
| 2918 | parent = clientAncestor->parentAspect(); |
| 2919 | #endif |
| 2920 | parent->folder()->addChild(aspect); |
| 2921 | } else |
| 2922 | m_project->addChild(aspect); |
| 2923 | } |
| 2924 | |
| 2925 | void MainWin::settingsDialog() { |
| 2926 | auto* dlg = new SettingsDialog(this, m_defaultSystemLocale); |
no test coverage detected