| 260 | } |
| 261 | |
| 262 | void PluginListView::onDoubleClicked(const QModelIndex& index) |
| 263 | { |
| 264 | if (!index.isValid()) { |
| 265 | return; |
| 266 | } |
| 267 | |
| 268 | if (m_core->pluginList()->timeElapsedSinceLastChecked() <= |
| 269 | QApplication::doubleClickInterval()) { |
| 270 | // don't interpret double click if we only just checked a plugin |
| 271 | return; |
| 272 | } |
| 273 | |
| 274 | try { |
| 275 | if (selectionModel()->hasSelection() && |
| 276 | selectionModel()->selectedRows().count() == 1) { |
| 277 | |
| 278 | QModelIndex idx = selectionModel()->currentIndex(); |
| 279 | QString fileName = idx.data().toString(); |
| 280 | |
| 281 | if (ModInfo::getIndex(m_core->pluginList()->origin(fileName)) == UINT_MAX) { |
| 282 | return; |
| 283 | } |
| 284 | |
| 285 | auto modIndex = ModInfo::getIndex(m_core->pluginList()->origin(fileName)); |
| 286 | ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex); |
| 287 | |
| 288 | if (modInfo->isRegular() || modInfo->isOverwrite()) { |
| 289 | |
| 290 | Qt::KeyboardModifiers modifiers = QApplication::queryKeyboardModifiers(); |
| 291 | if (modifiers.testFlag(Qt::ControlModifier)) { |
| 292 | m_modActions->openExplorer({m_core->modList()->index(modIndex, 0)}); |
| 293 | } else { |
| 294 | m_modActions->displayModInformation( |
| 295 | ModInfo::getIndex(m_core->pluginList()->origin(fileName))); |
| 296 | } |
| 297 | |
| 298 | // workaround to cancel the editor that might have opened because of |
| 299 | // selection-click |
| 300 | closePersistentEditor(index); |
| 301 | } |
| 302 | } |
| 303 | } catch (const std::exception& e) { |
| 304 | reportError(e.what()); |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | bool PluginListView::moveSelection(int key) |
| 309 | { |
nothing calls this directly
no test coverage detected