Skip to content

Commit 8b8677f

Browse files
committed
feat: associate application/x-perf-data and application/x-hotspot with hotspot
This patch adds a custom mimetype for *.perfparser files called application/x-hotspot and registers hotspot as the default application to open it. Fixes: #718
1 parent eabff39 commit 8b8677f

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,22 @@ if(NOT APPIMAGE_BUILD)
165165
add_subdirectory(tests)
166166
endif()
167167

168+
install(
169+
FILES com.kdab.hotspot.xml
170+
DESTINATION ${KDE_INSTALL_MIMEDIR}
171+
)
172+
173+
find_package(SharedMimeInfo 1.8)
174+
set_package_properties(
175+
SharedMimeInfo PROPERTIES
176+
TYPE OPTIONAL
177+
PURPOSE "Associate hotspot "
178+
)
179+
180+
if(SharedMimeInfo_FOUND)
181+
update_xdg_mimetypes(${KDE_INSTALL_MIMEDIR})
182+
endif()
183+
168184
install(
169185
FILES com.kdab.hotspot.desktop
170186
DESTINATION ${KDE_INSTALL_APPDIR}

com.kdab.hotspot.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Exec=hotspot %f
99
Icon=hotspot
1010
Categories=Development;
1111
Keywords=performance;perf;
12-
MimeType=application/x-perf-data;
12+
MimeType=application/x-perf-data;application/x-hotspot;

com.kdab.hotspot.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
3+
<mime-type type="application/x-hotspot">
4+
<glob pattern="*.perfparser"/>
5+
</mime-type>
6+
</mime-info>

0 commit comments

Comments
 (0)