| 103 | } |
| 104 | |
| 105 | bool ExternalScriptView::eventFilter(QObject* obj, QEvent* e) |
| 106 | { |
| 107 | // no, listening to activated() is not enough since that would also trigger the edit mode which we do _not_ want here |
| 108 | // users may still rename stuff via select + F2 though |
| 109 | if (obj == scriptTree->viewport()) { |
| 110 | // const bool singleClick = KGlobalSettings::singleClick(); |
| 111 | const bool singleClick = true; //FIXME: enable singleClick for the sake of porting, should find a proper way |
| 112 | if ((!singleClick && e->type() == QEvent::MouseButtonDblClick) || |
| 113 | (singleClick && e->type() == QEvent::MouseButtonRelease)) { |
| 114 | auto* mouseEvent = dynamic_cast<QMouseEvent*>(e); |
| 115 | Q_ASSERT(mouseEvent); |
| 116 | ExternalScriptItem* item = itemForIndex(scriptTree->indexAt(mouseEvent->pos())); |
| 117 | if (item) { |
| 118 | m_plugin->execute(item); |
| 119 | e->accept(); |
| 120 | return true; |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | return QObject::eventFilter(obj, e); |
| 125 | } |
| 126 | |
| 127 | void ExternalScriptView::addScript() |
| 128 | { |
nothing calls this directly
no test coverage detected