Merge lp://staging/~florian-angermeier/contractor/filter-functions-based-on-file-size into lp://staging/contractor/0.3

Proposed by Florian Angermeier
Status: Merged
Approved by: xapantu
Approved revision: 147
Merged at revision: 137
Proposed branch: lp://staging/~florian-angermeier/contractor/filter-functions-based-on-file-size
Merge into: lp://staging/contractor/0.3
Diff against target: 710 lines (+326/-22)
13 files modified
src/Contract.vala (+60/-0)
src/ContractDirectory.vala (+2/-1)
src/ContractFile.vala (+42/-1)
src/ContractKeyFile.vala (+44/-3)
src/ContractMatcher.vala (+59/-4)
src/ContractSorter.vala (+4/-2)
src/ContractSource.vala (+4/-2)
src/DBusService.vala (+95/-1)
src/FileEnumerator.vala (+2/-1)
src/FileService.vala (+4/-2)
src/MimeTypeManager.vala (+4/-2)
src/String.vala (+4/-2)
src/Translations.vala (+2/-1)
To merge this branch: bzr merge lp://staging/~florian-angermeier/contractor/filter-functions-based-on-file-size
Reviewer Review Type Date Requested Status
xapantu (community) Approve
Review via email: mp+271211@code.staging.launchpad.net

This proposal supersedes a proposal from 2015-09-13.

Commit message

Implement filter functions based on file size:
* Get the max file size (int64, size in bytes) from a .contract file (optional key MaxFileSize)
* Add methods to the D-Bus service:
  - get_contracts_by_file_size
  - get_contracts_by_mime_and_file_size
  - get_contracts_by_mimelist_and_file_size

Add documentation

Description of the change

Implement filter functions based on file size:
* Get the max file size (int64, size in bytes) from a .contract file (optional key MaxFileSize)
* Add methods to the D-Bus service:
  - get_contracts_by_file_size
  - get_contracts_by_mime_and_file_size
  - get_contracts_by_mimelist_and_file_size

Add documentation

To post a comment you must log in.
Revision history for this message
xapantu (xapantu) wrote : Posted in a previous version of this proposal

Nice work, thanks :)

See below a few comments about code style and some other things.

We also need documentations for the public methods to get this merged, which will be used to generate the api docs (see other files (e.g. the widgets are well documented) if you are looking for examples).

review: Needs Fixing
Revision history for this message
Florian Angermeier (florian-angermeier) wrote : Posted in a previous version of this proposal

> Nice work, thanks :)
>
> See below a few comments about code style and some other things.
>
> We also need documentations for the public methods to get this merged, which
> will be used to generate the api docs (see other files (e.g. the widgets are
> well documented) if you are looking for examples).

=== modified file 'src/Contract.vala'
 --- src/Contract.vala 2013-05-20 04:55:11 +0000
 +++ src/Contract.vala 2015-09-13 00:54:10 +0000
 @@ -72,6 +77,12 @@
              } catch (Error err) {
                  warning ("Contract '%s' does not provide an icon (%s)", id, err.message);
              }
 +
 + try {
 + max_file_size = keyfile.get_max_file_size ();
 + } catch (Error err) {
 + warning ("Contract '%s' does not provide a max file size (%s)", id, err.message);

Should I change the warning outputs of all optional contract fields to debug outputs?

Revision history for this message
xapantu (xapantu) wrote : Posted in a previous version of this proposal

Well, for now, we can let them here. For instance, for the icon one, while it is strictly speaking optional, we do want to force developers to put an icon. Whereas for the max file size, it does not make sense for a lot of contracts (print for instance), so it is really an optional field (and not an optional-if-one-really-is-too-lazy-to-write-it one).

Revision history for this message
kay van der Zander (kay20) wrote :

Hey try to keep the unmerged revisions to one. not 11 ;)
use the uncommit command. http://doc.bazaar.canonical.com/latest/en/user-guide/undoing_mistakes.html#undoing-multiple-commits

Revision history for this message
xapantu (xapantu) wrote :

Thanks for everything, including the documentation. It may need some rephrasing/fomating, but that's beyond the scope of this merge request.

review: Approve

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