Bug 431601 - Ctrl-clicking on filenames with line numbers on the end from `grep` output has broken recently
Summary: Ctrl-clicking on filenames with line numbers on the end from `grep` output ha...
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-01-14 17:15 UTC by Nate Graham
Modified: 2021-01-20 15:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Error message (307.88 KB, image/jpeg)
2021-01-14 17:15 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2021-01-14 17:15:18 UTC
Created attachment 134858 [details]
Error message

Everything KDE from git master.

This was a recently introduced feature that was totally awesome, but it broke sometime in the last few days.

When I ctrl+click on "src/qml/MediaPlayListView.qml:143:", it no longer opens my chosen text editor with that file on line 143; instead, it display an error dialog saying "The file or folder /home/nate/kde/src/elisa/src/qml/MediaPlayListView.qml:143 does not exist.
Comment 1 Carlos Alves 2021-01-14 17:38:51 UTC
Related to this one?
https://bugs.kde.org/show_bug.cgi?id=431496
Comment 2 Nate Graham 2021-01-14 17:50:55 UTC
Could be, yes. That's why I CCd Ahmad. :)
Comment 3 Ahmad Samir 2021-01-14 19:02:22 UTC
I think I see what the issue is (in the lovely world of mimetypes :)).
Comment 4 Nate Graham 2021-01-14 19:27:51 UTC
Thanks Ahmad!
Comment 5 Bug Janitor Service 2021-01-14 19:31:23 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/327
Comment 6 Kurt Hindenburg 2021-01-20 15:53:23 UTC
Git commit a5f298063a5a2be60a15916979ff07529b61a841 by Kurt Hindenburg, on behalf of Ahmad Samir.
Committed on 20/01/2021 at 15:36.
Pushed by hindenburg into branch 'master'.

FileFilterHotSpot: check the mime type of the file after cleaning the path

QMimeDataBase will return "application/octet-stream" as the mime type
of something like "path/to/some/textfile.txt:123:123:", because we are
using methods from it that check only the file extension. That meant
some valid text files with line/column suffixes couldn't be opened.

Instead move the mime type check _after_ the file path has been cleaned.
Also account for mime types that aren't recognized, e.g. a text file with
no extension.

M  +13   -7    src/filterHotSpots/FileFilterHotspot.cpp

https://invent.kde.org/utilities/konsole/commit/a5f298063a5a2be60a15916979ff07529b61a841