Changeset View
Changeset View
Standalone View
Standalone View
src/view/kateview.cpp
Show First 20 Lines • Show All 3638 Lines • ▼ Show 20 Line(s) | |||||
3639 | 3639 | | |||
3640 | void KTextEditor::ViewPrivate::printPreview() | 3640 | void KTextEditor::ViewPrivate::printPreview() | ||
3641 | { | 3641 | { | ||
3642 | KatePrinter::printPreview(this); | 3642 | KatePrinter::printPreview(this); | ||
3643 | } | 3643 | } | ||
3644 | 3644 | | |||
3645 | //END | 3645 | //END | ||
3646 | 3646 | | |||
3647 | //BEGIN KTextEditor::InlineNoteInterface | ||||
3648 | void KTextEditor::ViewPrivate::registerInlineNoteProvider(KTextEditor::InlineNoteProvider *provider) | ||||
3649 | { | ||||
3650 | if (! m_inlineNoteProviders.contains(provider)) { | ||||
3651 | m_inlineNoteProviders.append(provider); | ||||
3652 | | ||||
3653 | connect(provider, SIGNAL(reset()), this, SLOT(inlineNotesReset())); | ||||
3654 | connect(provider, SIGNAL(lineChanged(int)), this, SLOT(inlineNotesLineChanged(int))); | ||||
anthonyfieroni: Use new syntax connect | |||||
3655 | | ||||
3656 | inlineNotesReset(); | ||||
3657 | } | ||||
3658 | } | ||||
3659 | | ||||
3660 | void KTextEditor::ViewPrivate::unregisterInlineNoteProvider(KTextEditor::InlineNoteProvider *provider) | ||||
3661 | { | ||||
3662 | const int index = m_inlineNoteProviders.indexOf(provider); | ||||
3663 | if (index >= 0) { | ||||
3664 | m_inlineNoteProviders.removeAt(index); | ||||
3665 | | ||||
3666 | disconnect(provider, nullptr, this, nullptr); | ||||
anthonyfieroni: ```
provider->disconnect(this);
``` | |||||
3667 | | ||||
3668 | inlineNotesReset(); | ||||
3669 | } | ||||
3670 | } | ||||
3671 | | ||||
3672 | QVarLengthArray<KTextEditor::InlineNote, 8> KTextEditor::ViewPrivate::inlineNotes(int line) const | ||||
3673 | { | ||||
3674 | QVarLengthArray<KTextEditor::InlineNote, 8> allInlineNotes; | ||||
3675 | for (KTextEditor::InlineNoteProvider *provider: m_inlineNoteProviders) { | ||||
3676 | int index = 0; | ||||
3677 | for (auto column: provider->inlineNotes(line)) { | ||||
3678 | allInlineNotes.append({ | ||||
3679 | provider, | ||||
3680 | {line, column}, | ||||
3681 | index | ||||
3682 | }); | ||||
3683 | index++; | ||||
3684 | } | ||||
3685 | } | ||||
3686 | return allInlineNotes; | ||||
3687 | } | ||||
3688 | | ||||
3689 | void KTextEditor::ViewPrivate::inlineNotesReset() | ||||
3690 | { | ||||
3691 | repaintText(false); | ||||
3692 | } | ||||
3693 | | ||||
3694 | void KTextEditor::ViewPrivate::inlineNotesLineChanged(int line) | ||||
3695 | { | ||||
3696 | tagLines(line, line); | ||||
3697 | repaintText(false); | ||||
3698 | } | ||||
3699 | | ||||
3700 | //END KTextEditor::InlineNoteInterface | ||||
3701 | | ||||
3647 | KTextEditor::Attribute::Ptr KTextEditor::ViewPrivate::defaultStyleAttribute(KTextEditor::DefaultStyle defaultStyle) const | 3702 | KTextEditor::Attribute::Ptr KTextEditor::ViewPrivate::defaultStyleAttribute(KTextEditor::DefaultStyle defaultStyle) const | ||
3648 | { | 3703 | { | ||
3649 | KateRendererConfig * renderConfig = const_cast<KTextEditor::ViewPrivate*>(this)->renderer()->config(); | 3704 | KateRendererConfig * renderConfig = const_cast<KTextEditor::ViewPrivate*>(this)->renderer()->config(); | ||
3650 | 3705 | | |||
3651 | KTextEditor::Attribute::Ptr style = m_doc->highlight()->attributes(renderConfig->schema()).at(defaultStyle); | 3706 | KTextEditor::Attribute::Ptr style = m_doc->highlight()->attributes(renderConfig->schema()).at(defaultStyle); | ||
3652 | if (!style->hasProperty(QTextFormat::BackgroundBrush)) { | 3707 | if (!style->hasProperty(QTextFormat::BackgroundBrush)) { | ||
3653 | // make sure the returned style has the default background color set | 3708 | // make sure the returned style has the default background color set | ||
3654 | style = new KTextEditor::Attribute(*style); | 3709 | style = new KTextEditor::Attribute(*style); | ||
Show All 30 Lines |
Use new syntax connect