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

Proposed by Florian Angermeier
Status: Superseded
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) Needs Fixing
Review via email: mp+270890@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2015-09-15.

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

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

To post a comment you must log in.
Revision history for this message
xapantu (xapantu) wrote :

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 :

> 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?

142. By Florian Angermeier

Code style fixes. http://elementary.io/de/docs/code/reference#indentation

143. By Florian Angermeier

documentation for Contractor.DBusService

Revision history for this message
xapantu (xapantu) wrote :

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).

144. By Florian Angermeier

Change the type of the message if no MaxFileSize key is in a contract file present from warning to debug.

145. By Florian Angermeier

add more documentation for:
* Contractor.Contract
* Contractor.ContractKeyFile
* Contractor.ContractMatcher

146. By Florian Angermeier

Forgot to finish a documentation string.

147. By Florian Angermeier

* more documentation for Contractor.ContractFile
* fixes for existing documentation

Unmerged revisions

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