| 124 | } |
| 125 | |
| 126 | void PatchReviewPlugin::addHighlighting( const QUrl& highlightFile, IDocument* document ) { |
| 127 | try { |
| 128 | if ( !modelList() ) |
| 129 | throw "no model"; |
| 130 | |
| 131 | for ( int a = 0; a < modelList()->modelCount(); ++a ) { |
| 132 | auto* const model = modelList()->modelAt(a); |
| 133 | if ( !model ) |
| 134 | continue; |
| 135 | |
| 136 | QUrl file = urlForFileModel( model ); |
| 137 | |
| 138 | if ( file != highlightFile ) |
| 139 | continue; |
| 140 | |
| 141 | qCDebug(PLUGIN_PATCHREVIEW) << "highlighting" << file.toDisplayString(); |
| 142 | |
| 143 | IDocument* doc = document; |
| 144 | if( !doc ) |
| 145 | doc = ICore::self()->documentController()->documentForUrl( file ); |
| 146 | |
| 147 | qCDebug(PLUGIN_PATCHREVIEW) << "highlighting file" << file << "with doc" << doc; |
| 148 | |
| 149 | if ( !doc || !doc->textDocument() ) |
| 150 | continue; |
| 151 | |
| 152 | removeHighlighting( file ); |
| 153 | |
| 154 | m_highlighters[file] = new PatchHighlighter(model, doc, this, (qobject_cast<LocalPatchSource*>(m_patch.data()) == nullptr)); |
| 155 | } |
| 156 | } catch ( const QString & str ) { |
| 157 | qCDebug(PLUGIN_PATCHREVIEW) << "highlightFile():" << str; |
| 158 | } catch ( const char * str ) { |
| 159 | qCDebug(PLUGIN_PATCHREVIEW) << "highlightFile():" << str; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | void PatchReviewPlugin::highlightPatch() { |
| 164 | try { |
nothing calls this directly
no test coverage detected