| 29 | using namespace KDevelop; |
| 30 | |
| 31 | class ErrorJob : public OutputJob |
| 32 | { |
| 33 | Q_OBJECT |
| 34 | public: |
| 35 | ErrorJob(QObject* parent, const QString& error) |
| 36 | : OutputJob(parent) |
| 37 | , m_error(error) |
| 38 | { |
| 39 | setStandardToolView(IOutputView::BuildView); |
| 40 | } |
| 41 | |
| 42 | void start() override |
| 43 | { |
| 44 | auto* output = new OutputModel(this); |
| 45 | setModel(output); |
| 46 | startOutput(); |
| 47 | |
| 48 | output->appendLine(i18n(" *** MESON ERROR ***\n")); |
| 49 | QStringList lines = m_error.split(QLatin1Char('\n')); |
| 50 | output->appendLines(lines); |
| 51 | |
| 52 | setError(!m_error.isEmpty()); |
| 53 | setErrorText(m_error); |
| 54 | emitResult(); |
| 55 | } |
| 56 | |
| 57 | private: |
| 58 | QString m_error; |