MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / URLFinder

Method URLFinder

src/decorators/URLFinder.cpp:26–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26URLFinder::URLFinder(ScintillaNext *editor) :
27 EditorDecorator(editor),
28 timer(new QTimer(this))
29{
30 // Setup the indicator
31 indicator = editor->allocateIndicator("url_finder");
32
33 editor->indicSetStyle(indicator, INDIC_PLAIN);
34 editor->indicSetFore(indicator, 0xFF0000);
35
36 editor->indicSetHoverStyle(indicator, INDIC_DOTS);
37 editor->indicSetHoverFore(indicator, 0xFF0000);
38
39 // Resizing the window could reveal more text
40 connect(editor, &ScintillaNext::resized, timer, qOverload<>(&QTimer::start));
41
42 timer->setInterval(200);
43 timer->setSingleShot(true);
44 connect(timer, &QTimer::timeout, this, &URLFinder::findURLs);
45
46 connect(this, &EditorDecorator::stateChanged, this, [=](bool b) {
47 if (b) {
48 connect(editor, &ScintillaNext::resized, timer, qOverload<>(&QTimer::start));
49 connect(editor, &ScintillaNext::reloaded, timer, qOverload<>(&QTimer::start));
50 findURLs();
51 }
52 else {
53 disconnect(editor, &ScintillaNext::resized, timer, qOverload<>(&QTimer::start));
54 clearURLs();
55 }
56 });
57}
58
59void URLFinder::findURLs()
60{

Callers

nothing calls this directly

Calls 1

allocateIndicatorMethod · 0.80

Tested by

no test coverage detected