KShell::tildeCollapse return a string with homedir (usually /home/$USER) replaced by ~.
Details
- Reviewers
broulik ngraham ervin apol - Group Reviewers
Frameworks - Commits
- R244:94e6927d2f8c: Add utility text function KShell::tildeCollapse
ctest
Diff Detail
- Repository
- R244 KCoreAddons
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
I might be missing something, explaining why it's necessary would be useful for the commit log as well as for lost reviewers like me.
I replaced my first use case by KFilePlacesModel::closestItem.
The use case is to avoid redundant code doing this over and over just like KShell::tildeExpand does :
plasma-desktop/kcms/kfontinst/lib/Misc.cpp:391
plasma-desktop/kcms/baloo/filteredfoldermodel.cpp:50
plasma-workspace/runners/baloo/baloosearchrunner.cpp:176
plasma-workspace/libnotificationmanager/job_p.cpp:120
solid/src/solid/devices/backends/fstab/fstabdevice.cpp:61
To reiterate.
The use case is to avoid redundant code doing this over and over just like KShell::tildeExpand does :
plasma-desktop/kcms/kfontinst/lib/Misc.cpp:391
plasma-desktop/kcms/baloo/filteredfoldermodel.cpp:50
plasma-workspace/runners/baloo/baloosearchrunner.cpp:176
plasma-workspace/libnotificationmanager/job_p.cpp:120
solid/src/solid/devices/backends/fstab/fstabdevice.cpp:61
I thought the header documentation and commit comment would be sufficient to explain the intent and the usefullness.
After all it is just the opposite of tildeExpand.
Now we have a small list of potential users of this :
plasma-desktop/kcms/kfontinst/lib/Misc.cpp:391
plasma-desktop/kcms/baloo/filteredfoldermodel.cpp:50
plasma-workspace/runners/baloo/baloosearchrunner.cpp:176
plasma-workspace/libnotificationmanager/job_p.cpp:120
solid/src/solid/devices/backends/fstab/fstabdevice.cpp:61