multiple / in settings files path

Bug #1464975 reported by Sébastien BLAISOT
6
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/daniel/.mixxx//mixxx.cfg"

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
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

I've seen many occurrences of manual file path construction in the Mixxx code base. Instead QDir::filePath()/absoluteFilePath() should be used that eliminates all redundant path separators.

One example from cmdlineargs.h:
   QDir::homePath().append("/").append(SETTINGS_PATH)
should be replaced by
   QDir::home().absoluteFilePath(SETTINGS_PATH)
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.

Revision history for this message
Sébastien BLAISOT (sblaisot) wrote :
Revision history for this message
Sébastien BLAISOT (sblaisot) wrote :

can someone change milestone to 1.12 in this bug please. thx.

Changed in mixxx:
status: In Progress → Fix Committed
Changed in mixxx:
milestone: none → 1.12.0
importance: Undecided → Low
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/8099

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.