Merge lp://qastaging/~elementary-apps/contractor/multiple-files into lp://qastaging/contractor/0.3

Proposed by Tom Beckmann
Status: Needs review
Proposed branch: lp://qastaging/~elementary-apps/contractor/multiple-files
Merge into: lp://qastaging/contractor/0.3
Diff against target: 55 lines (+17/-1)
3 files modified
src/Contract.vala (+2/-1)
src/ContractKeyFile.vala (+14/-0)
src/GenericContract.vala (+1/-0)
To merge this branch: bzr merge lp://qastaging/~elementary-apps/contractor/multiple-files
Reviewer Review Type Date Requested Status
Sergey "Shnatsel" Davidoff Needs Fixing
Review via email: mp+231132@code.qastaging.launchpad.net

Description of the change

This adds a supports-multiple-files field to GenericContract, which is exported over dbus. It is set by detecting whether a capital file replacement sequence is found in the contract's exec field. The implementation is about the same as found in glib for replacing the sequence.

I'll make an update for granite's wrapper ready as well, at least in get_contracts_for_file(s) we can abstract the additional key away and auto filter.

Does anyone know if there are docs that would need to be updated accordingly? I didn't see any in contractor, I'll update the ones in granite though.

To post a comment you must log in.
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

From the application standpoint all contracts support multiple files, and Contractor just takes care of launching the command multiple times for multiple files (if the contract has %f or %u in exec). That's how it works in .desktop files, too. And what are you trying to achieve with these branches?

review: Needs Information
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

%f or %u in invocation is just an implementation detail and doesn't mean that the action only makes sense for a single file. You'll have to introduce a new key to express the latter.

Also, this introduces an API break without an API version number bump. D-bus APIs also allow exposing several API revisions at once; that's something we might want to consider.

review: Needs Fixing
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

For the moment this is being fixed by making "Set as Wallpaper" work for multiple selected files.

Unmerged revisions

137. By Tom Beckmann

add a supports-mutiple-files field to GenericContract

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches