notify clients when a contract is added or removed
Bug #1170523 reported by
Victor Martinez
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Contractor |
Fix Released
|
Wishlist
|
Victor Martinez |
Bug Description
Whenever a contract is added or removed, contractor should notify its clients about it so that those changes are reflected on whatever widget the client is using to make them available.
Having the contract_added() and contract_removed() signals as part of the DBus API would be great, though if you're feeling lazy, a single contracts_changed() signal could be enough.
Related branches
lp:~victored/contractor/dbus-api-changes
- Sergey "Shnatsel" Davidoff: Approve
- Michael Lazarski: Approve
-
Diff: 331 lines (+79/-91)8 files modifiedsrc/CMakeLists.txt (+1/-1)
src/Contract.vala (+7/-11)
src/ContractMatcher.vala (+5/-25)
src/ContractSorter.vala (+2/-2)
src/ContractSource.vala (+12/-3)
src/DBusService.vala (+18/-30)
src/MimeTypeManager.vala (+1/-19)
src/String.vala (+33/-0)
Changed in contractor: | |
status: | New → Triaged |
summary: |
- notify when a contract is added or removed + notify clients when a contract is added or removed |
Changed in contractor: | |
importance: | Undecided → Wishlist |
Changed in contractor: | |
status: | Triaged → In Progress |
assignee: | nobody → Victor (victored) |
Changed in contractor: | |
status: | In Progress → Fix Committed |
Changed in contractor: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I'd go for the simple way with having just one signal. The primary reason is that it's very future-proof and easier to implement in clients.
Individual signals for various changes sound like they would work faster, but deltas might get more costly than a full reload if we change the state of a lot of contracts at once. For example, I pull the network plug and 2/3 of contracts go off, that'd be a lot of d-bus signalling back and forth and individual updates too, all competing for CPU time. Simply reloading the list with one signal would be much better performance-wise in this case. Even now Contractor itself waits for a little while before reloading contracts - 100ms (AFAIR) after the last change to its files and *then* reloads them just once.
And it's not like we have to care about performance of passing a bunch of strings around in the first place. If it turns out to be slow, we can always add more fine-grained callbacks.