Instead compare string length with an integer
Details
- Reviewers
iasensio - Group Reviewers
Plasma - Commits
- R108:1dcf514e21f6: Don't compare string with empty string
R108:a650e6520f3e: Don't compare string with empty string
Compile && run
Diff Detail
- Repository
- R108 KWin
- Branch
- string-compare (branched from master)
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 27087 Build 27105: arc lint + arc unit
| kcmkwin/kwinrules/package/contents/ui/FileDialogLoader.qml | ||
|---|---|---|
| 39 | Why not just !root.lastFolder? or even root.lastFolder || shortcuts.home | |
| kcmkwin/kwinrules/package/contents/ui/FileDialogLoader.qml | ||
|---|---|---|
| 39 | I didn't know that an empty string in js was returning false. | |
| kcmkwin/kwinrules/package/contents/ui/FileDialogLoader.qml | ||
|---|---|---|
| 39 | It's not, but the operators in JS work a little differently. They don't cast to bool. | |
| kcmkwin/kwinrules/package/contents/ui/FileDialogLoader.qml | ||
|---|---|---|
| 39 | I also didn't know that about JS. Python operators also behave that way. Nice! | |
All the changes seem nice but this one. I've not yet figure out why
| kcmkwin/kwinrules/package/contents/ui/FileDialogLoader.qml | ||
|---|---|---|
| 49 | This seems to break importing files for me. | |
| kcmkwin/kwinrules/package/contents/ui/FileDialogLoader.qml | ||
|---|---|---|
| 39 | There's also ?? operator in Qt 5.15 which is the proper Null coalescing operator | |
| 49 | If fileUrl is a QUrl, then that can lead to funky results as url basic type isn't astring. So fileUrl != "" it is (not the strict operator).. or fileUrl.toString() !== "" | |
No rush, I just wanted to use Requested Changes for the first and last time here at Phab :D