multiple / in settings files path
Bug #1464975 reported by
Sébastien BLAISOT
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Fix Released
|
Low
|
Sébastien BLAISOT |
Bug Description
To access files that reside in preference folder settingsPath, we usually append "/filename" to settingsPath.
settingsPath ends with a trailing "/" so this results in double "/" in the file's pathname.
this ends up with messages like this one in the logs: Main]: ConfigObject: Could not read "/home/
we should get rid of double "/"
Changed in mixxx: | |
assignee: | nobody → Sébastien BLAISOT (sblaisot) |
status: | New → Confirmed |
Changed in mixxx: | |
status: | Confirmed → In Progress |
Changed in mixxx: | |
milestone: | none → 1.12.0 |
importance: | Undecided → Low |
Changed in mixxx: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I've seen many occurrences of manual file path construction in the Mixxx code base. Instead QDir::filePath( )/absoluteFileP ath() should be used that eliminates all redundant path separators.
One example from cmdlineargs.h: :homePath( ).append( "/").append( SETTINGS_ PATH) :home() .absoluteFilePa th(SETTINGS_ PATH)
QDir:
should be replaced by
QDir:
which is safer and simpler.
Looks like no one is reading their Qt API docs thoroughly ;) Composition of file paths should never be done using low-level string concatenation.