diff --git a/src/filterHotSpots/FileFilterHotspot.cpp b/src/filterHotSpots/FileFilterHotspot.cpp index ec32551c..41c7633f 100644 --- a/src/filterHotSpots/FileFilterHotspot.cpp +++ b/src/filterHotSpots/FileFilterHotspot.cpp @@ -52,7 +52,7 @@ FileFilterHotSpot::FileFilterHotSpot(int startLine, , _session(session) , _thumbnailFinished(false) { - setType(Link); + setType(File); } void FileFilterHotSpot::activate(QObject *) diff --git a/src/filterHotSpots/FilterChain.cpp b/src/filterHotSpots/FilterChain.cpp index 4f6a45d2..a4349cd3 100644 --- a/src/filterHotSpots/FilterChain.cpp +++ b/src/filterHotSpots/FilterChain.cpp @@ -251,7 +251,7 @@ void FilterChain::paint(TerminalDisplay *td, QPainter &painter) for (const auto &spot : spots) { QRegion region; - if (spot->type() == HotSpot::Link || spot->type() == HotSpot::EMailAddress || spot->type() == HotSpot::EscapedUrl) { + if (spot->type() == HotSpot::Link || spot->type() == HotSpot::EMailAddress || spot->type() == HotSpot::EscapedUrl || spot->type() == HotSpot::File) { QPair spotRegion = spot->region(td->terminalFont()->fontWidth(), td->terminalFont()->fontHeight(), td->columns(), td->contentRect()); region = spotRegion.first; @@ -259,7 +259,7 @@ void FilterChain::paint(TerminalDisplay *td, QPainter &painter) // TODO: Move this paint code to HotSpot->drawHint(); // TODO: Fix the Url Hints access from the Profile. - if (_showUrlHint && spot->type() == HotSpot::Link) { + if (_showUrlHint && (spot->type() == HotSpot::Link || spot->type() == HotSpot::File)) { if (urlNumber >= 0 && urlNumber < 10) { // Position at the beginning of the URL QRect hintRect(*region.begin()); @@ -327,7 +327,7 @@ void FilterChain::paint(TerminalDisplay *td, QPainter &painter) // TODO: Fix accessing the urlHint here. // TODO: Move this code to UrlFilterHotSpot. const bool hasMouse = region.contains(td->mapFromGlobal(QCursor::pos())); - if ((spot->type() == HotSpot::Link && _showUrlHint) || hasMouse) { + if (((spot->type() == HotSpot::Link || spot->type() == HotSpot::File) && _showUrlHint) || hasMouse) { QFontMetrics metrics(td->font()); // find the baseline (which is the invisible line that the characters in the font sit on, diff --git a/src/filterHotSpots/HotSpot.cpp b/src/filterHotSpots/HotSpot.cpp index 24292c0a..fb642fcb 100644 --- a/src/filterHotSpots/HotSpot.cpp +++ b/src/filterHotSpots/HotSpot.cpp @@ -101,7 +101,7 @@ void HotSpot::mouseMoveEvent(TerminalDisplay *td, QMouseEvent *ev) bool HotSpot::isUrl() { - return (_type == HotSpot::Link || _type == HotSpot::EMailAddress || _type == HotSpot::EscapedUrl); + return (_type == HotSpot::Link || _type == HotSpot::EMailAddress || _type == HotSpot::EscapedUrl || _type == HotSpot::File); } void HotSpot::mouseEnterEvent(TerminalDisplay *td, QMouseEvent *ev) diff --git a/src/filterHotSpots/HotSpot.h b/src/filterHotSpots/HotSpot.h index 6e3f5860..9a023407 100644 --- a/src/filterHotSpots/HotSpot.h +++ b/src/filterHotSpots/HotSpot.h @@ -53,7 +53,9 @@ public: enum Type { // the type of the hotspot is not specified NotSpecified, - // this hotspot represents a clickable link + // this hotspot rpresents a file on the filesystem + File, + // this hotspot represents a clickable URL link Link, // this hotspot represents a clickable e-mail address EMailAddress,