MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / handleReject

Method handleReject

src/plugins/chat/widgets/inlinechatwidget.cpp:454–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454void InlineChatWidgetPrivate::handleReject()
455{
456 if (!chatInfo.tempText.isEmpty()) {
457 QString replaceText = chatInfo.originalText;
458 if (!replaceText.endsWith('\n'))
459 replaceText.append('\n');
460
461 int endLineOffset = chatInfo.tempText.count('\n') - chatInfo.originalText.count('\n') - 1;
462 chatInfo.tempText.clear();
463 Edit::Range replaceRange = chatInfo.originalRange;
464 replaceRange.end.line += endLineOffset;
465 editSrv->replaceRange(chatInfo.fileName, replaceRange, replaceText);
466 editSrv->setRangeBackgroundColor(chatInfo.fileName, chatInfo.originalRange.start.line,
467 chatInfo.originalRange.end.line, selectionMarker);
468 }
469
470 if (insertMarker != -1)
471 editSrv->clearAllBackgroundColor(chatInfo.fileName, insertMarker);
472 if (deleteMarker != -1)
473 editSrv->clearAllBackgroundColor(chatInfo.fileName, deleteMarker);
474 setState(Original);
475 q->setFocus();
476}
477
478void InlineChatWidgetPrivate::handleClose()
479{

Callers 2

resetMethod · 0.80
eventFilterMethod · 0.80

Calls 9

endsWithMethod · 0.80
setFocusMethod · 0.80
isEmptyMethod · 0.45
appendMethod · 0.45
countMethod · 0.45
clearMethod · 0.45
replaceRangeMethod · 0.45

Tested by

no test coverage detected