With it, we can now write :
query |= Type(types);
instead of :
query = query | Type(types);
Details
- Reviewers
ivan
Compiles
Diff Detail
- Repository
- R159 KActivities Statistics
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 15522 Build 15540: arc lint + arc unit
This is something I did have initally in kastats, it was killed because while this is tempting
query |= Type(types);
it ruins the idea of the chaning API because it can not be used like this:
query |= Type(types) | OtherTerm(...);
In order for this to work properly, we'd need to use expression templates which would make the library significanly more complex.
I don't think it is worth it.
I see, I am not sure to want to go that way.
Chaining would still be possible simply with another form:
query = query | Type(types) | OtherTerm(...);
I don't think it is worth it.
I would be ok to abandon this, this was motived by :
https://phabricator.kde.org/D22144#inline-131974
Do you see a problem, or should we consider it as fine ?
You can also use set*/add* member functions for this so that David doesn't complain. As I said, pipes are mainly there for chaining - easy query creation API to simplify the alternative of set set set set set. But if you set a single field, I'd say set*/add* is a fine option.