| 124 | } |
| 125 | |
| 126 | void PanadapterStack::removePanadapter(const QString& panId) |
| 127 | { |
| 128 | // Close floating window if this pan is floating |
| 129 | if (auto* fw = m_floatingWindows.take(panId)) { |
| 130 | fw->setShuttingDown(true); |
| 131 | // Don't takeApplet — the applet will be deleted below |
| 132 | // just disconnect and hide the window |
| 133 | fw->disconnect(); |
| 134 | fw->hide(); |
| 135 | fw->deleteLater(); |
| 136 | } |
| 137 | |
| 138 | auto* applet = m_pans.take(panId); |
| 139 | if (!applet) return; |
| 140 | |
| 141 | delete applet; |
| 142 | |
| 143 | // If active was removed, switch to first remaining |
| 144 | if (m_activePanId == panId) { |
| 145 | if (!m_pans.isEmpty()) |
| 146 | setActivePan(m_pans.firstKey()); |
| 147 | else |
| 148 | m_activePanId.clear(); |
| 149 | } |
| 150 | |
| 151 | // Update multi-pan mode decorations |
| 152 | bool multi = m_pans.size() > 1; |
| 153 | for (auto* a : m_pans) |
| 154 | a->setMultiPanMode(multi); |
| 155 | } |
| 156 | |
| 157 | void PanadapterStack::rekey(const QString& oldId, const QString& newId) |
| 158 | { |
no test coverage detected