Skip to content

Commit

Permalink
mechanism to allow specifing file editing capability
Browse files Browse the repository at this point in the history
By adding actions="view|edit" to mime/mediatype pixiewood will also add
the EDIT action to the intent handler for that particular mimetype.

This is not specified in the appstream metadata format, but appstreamcli
doesn't check for parameters so it works for now.
I hope to have that behviour codified in appstream at some point.
See ximion/appstream#689
  • Loading branch information
sp1ritCS committed Dec 26, 2024
1 parent fe1ad45 commit 9089648
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions generate/manifest.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<xsl:for-each select="pw:metainfo/meta:component/meta:provides/meta:mediatype | pw:metainfo/meta:component/meta:mimetypes/meta:mimetype">
<xsl:variable name="actions" select="str:split(@actions, '|')" />
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<!-- if mime is editable: action.EDIT -->
<xsl:if test="boolean($actions[. = 'edit'])">
<action android:name="android.intent.action.EDIT"/>
</xsl:if>
<category android:name="android.intent.category.DEFAULT"/>
<!-- if should be browsable: category.BROWSABLE + scheme http+https -->
<!-- TODO: how to do browsable intents?: category.BROWSABLE + scheme http+https -->
<data android:scheme="content"/>
<data android:scheme="file"/>
<data android:mimeType="{.}" />
Expand Down

0 comments on commit 9089648

Please sign in to comment.