Support for overriding automatic path configuration
Bug #538478 reported by
Razzloss
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DC++ |
Fix Released
|
Low
|
Steven Sheehy | ||
LinuxDC++ |
Confirmed
|
Medium
|
Unassigned |
Bug Description
There's at least one case where the automatic path setting done by Util::initialize isn't desirable. That is when user want's to run multiple instances of (Linux)DC++ or temporarily wants a different config for testing etc.
The patch adds optional map parameter for Util::initialize from which the non-empty paths are used instead of autodetected ones. Also provides protection against dcpp::startup for resetting explicitly given values (which apparently isn't really needed with 7.60 core since startup isn't doing it anymore).
Patch only affects non-_WIN32 and common blocks.
--RZ
Related branches
Changed in linuxdcpp: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
tags: | added: core |
To post a comment you must log in.
Besides wanting to allow multiple config dirs, another reason for overriding default paths is that some of the paths in the core for *nix are non-standard nowadays (e.g. $HOME/.dc++) as seen in bug #329805 and bug #316358. But to change them would require calling a linux library that differs between distros, which is not feasible from within the core.
In addition to the overrides map Razzloss suggests, two alternative approaches that I can also suggest:
1) Add setPath(Paths type, string path) to Util so the UI can manually override the defaults of the core when needed.
2) Store all paths inside SettingsManager instead of inside Util. This would allow the UI to override them and even allow the user to override some of them, if that is desired. It also would remove the awkwardness of storing some paths both in Util and in SettingsManager like the download directories.
With either of these approaches, some mechanism would be needed to "refresh" the core to make use of the updated paths (i.e. reload config xmls, etc).