The Desktop Entry spec says "If $XDG_CURRENT_DESKTOP is set then it contains a colon-separated list of strings."
I found this bug (in a 2014 commit of mine) by simply reading this code and wondering why there was a QStringList.
Details
Details
- Reviewers
apol aacid - Commits
- R309:4e53a06bac40: Support multiple values in XDG_CURRENT_DESKTOP
Unittest updated, fails without the fix
Diff Detail
Diff Detail
- Repository
- R309 KService
- Branch
- xdg_current_deskto
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 21643 Build 21661: arc lint + arc unit
src/services/kservice.cpp | ||
---|---|---|
658–660 | You can use QVector<QStringRef> here, it would save us constructing a bunch of strings for no reason. Maybe not in the general case of everyone having just the one desktop though. |
Comment Actions
The patch looks good to me.
src/services/kservice.cpp | ||
---|---|---|
658–660 | This adds a "KDE" allocation on every which isn't ideal either. I don't know, maybe it doesn't matter either way... |
src/services/kservice.cpp | ||
---|---|---|
658–660 | Well, it's a QStringLiteral, AFAIK the QString just points to pre-allocated UTF-16 data. Not sure if it's zero-allocation but it's pretty cheap. |