Dolphin extension: dialog not showing up, help me find the error?

I want to create an extension that shows a button “convert to PDF” on all office documents supported by libreoffice. In headless mode it is pretty easy to convert documents to PDF.

But the dialog is not showing, even though I verified it?

file --mime-type example.odt
example.odt: application/vnd.oasis.opendocument.text

Here is the entry which I would place in ~/.local/share/servicemenu-download/ (It seems that is the only used location on Plasma 6 now?)

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
#X-KDE-ServiceTypes=KonqPopupMenu/Plugin #not sure which
MimeType=application/vnd.openxmlformats-officedocument.drawing+xml;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.openxmlformats-officedocument.presentationml.slideshow;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.presentation;text/html;text/html-sandboxed;
Icon=application-pdf
Actions=convert
X-KDE-Priority=TopLevel
X-KDE-StartupNotify=false

[Desktop Action convert]
Icon=application-pdf
Name=Export as PDF
Name[it]=Esporta come PDF
Name[de]=Exportieren als PDF
Name[nl]=Exporteren als PDF
Exec=flatpak run org.libreoffice.LibreOffice --headless --convert-to pdf "%f"

btw it is a feature that .desktop entries are always showing the button when right clicking on the entry itself, right?

Move your .desktop file to ~/.local/share/kio/servicemenus/ and make sure the file has executable permissions.

Read the doc :slight_smile: Creating Dolphin service menus | Developer

You probably want to add X-KDE-RequiredNumberOfUrls=1

1 Like

I will try that. Interesting new location, didnt read the new docs but the download location also works. It is probably a workaround around a bug I also already reported, that extensions are all downloaded into this directory where they previously werent used at all.

Instead of changing that in getnewstuff now it seems simply both directories work ;D