| 46 | OutputJob::~OutputJob() = default; |
| 47 | |
| 48 | void OutputJob::startOutput() |
| 49 | { |
| 50 | Q_D(OutputJob); |
| 51 | |
| 52 | IPlugin* i = ICore::self()->pluginController()->pluginForExtension(QStringLiteral("org.kdevelop.IOutputView")); |
| 53 | if( i ) |
| 54 | { |
| 55 | auto* view = i->extension<KDevelop::IOutputView>(); |
| 56 | if( view ) |
| 57 | { |
| 58 | if (d->standardToolView != -1) { |
| 59 | d->toolViewId = view->standardToolView(static_cast<IOutputView::StandardToolView>(d->standardToolView)); |
| 60 | } else { |
| 61 | view->registerToolView(d->toolViewId, d->toolTitle, d->type, d->toolIcon, d->options); |
| 62 | } |
| 63 | |
| 64 | if (d->title.isEmpty()) |
| 65 | d->title = objectName(); |
| 66 | |
| 67 | d->outputId = view->registerOutputInToolView(d->toolViewId, d->title, d->behaviours); |
| 68 | |
| 69 | if (!d->outputModel) { |
| 70 | d->outputModel = new QStandardItemModel(nullptr); |
| 71 | } |
| 72 | |
| 73 | // Keep the item model around after the job is gone |
| 74 | view->setModel(d->outputId, d->outputModel); |
| 75 | |
| 76 | if (!d->outputDelegate) { |
| 77 | d->outputDelegate = new QItemDelegate(nullptr); |
| 78 | } |
| 79 | |
| 80 | view->setDelegate(d->outputId, d->outputDelegate); |
| 81 | |
| 82 | if (d->killJobOnOutputClose) { |
| 83 | // can't use qt5 signal slot syntax here, IOutputView is no a QObject |
| 84 | connect(i, SIGNAL(outputRemoved(int)), this, SLOT(outputViewRemoved(int))); |
| 85 | } |
| 86 | |
| 87 | if (d->verbosity == OutputJob::Verbose) |
| 88 | view->raiseOutput(d->outputId); |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | void OutputJob::outputViewRemoved(int id) |
| 94 | { |
nothing calls this directly
no test coverage detected