there are a few places which potentially pass a prefix with a trailing -,
e.g. if using directly the value of FrameSvg::prefix() or
FrameSvg::actualPrefix(). Support the assumption in such code, unbreaking
its currently not working behaviour.
Details
Details
- Reviewers
mart - Group Reviewers
Plasma - Commits
- R242:8899389c9f67: FrameSvg: make hasElementPrefix() also handle prefix with trailing -
Diff Detail
Diff Detail
- Repository
- R242 Plasma Framework (Library)
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
The other option would be to fix the places which call hasElementPrefix but given that the ones known all rely on prefix() and actualPrefix(), it seems less code to fix this in one place and change behaviour a bit to be more grateful with the argument passed.
src/plasma/framesvg.cpp | ||
---|---|---|
150 | else? or we want to test --center if -center fails? |
src/plasma/framesvg.cpp | ||
---|---|---|
150 | How would you use the else? Not yet with you what you mean here, |
src/plasma/framesvg.cpp | ||
---|---|---|
150 | if (prefix.endsWith(QLatin1Char('-'))) { return hasElement(prefix % QLatin1String("center")); } else return hasElement(prefix % QLatin1String("-center")); |
src/plasma/framesvg.cpp | ||
---|---|---|
150 | But given the return, if the else needed? Actually some people recommend to not use else after return. I might be Monday blind, sorry :) |
src/plasma/framesvg.cpp | ||
---|---|---|
150 | I guess it doesn't matter. :) |