Being able to specify directory for settings

Use this forum to flesh out your feature request before you enter it in <a href="http://dcpp.net/bugzilla/">Bugzilla</a>.

Moderator: Moderators

Locked
MrFuji
Posts: 2
Joined: 2006-03-30 18:09

Being able to specify directory for settings

Post by MrFuji » 2006-03-30 18:28

It would be really nice to be able to specifiy where all files for settings and such like Favorites.xml, DCPlusPlus.xml, notepad.txt, HashData.dat and HashIndex.xml are being stored.

This would make it easier if you do backups of files (which everyone should) or if you like to ghost your system.

This could be done either with a xml file where this can be specified or even better if the program would take an argument where to look for the files (like Firefox's "C:\Program Files\Mozilla Firefox\firefox.exe" -profile "T:\Firefox").

Anyone else thinks this would be a good idea?

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2006-03-31 08:24

This has been requested, in a way: Bug 723: Store configuration in Windows user profile (per-user settings).

I'm not sure I see the utility in storing settings in an arbitrary path - there are too many directory locations in the file, and none of them are relative. So even making a "thumb drive" version of DC++ wouldn't make much sense.

MrFuji
Posts: 2
Joined: 2006-03-30 18:09

Post by MrFuji » 2006-03-31 13:23

I don't think I agree on
there are too many directory locations in the file, and none of them are relative
It seems like they are all related to Util::getConfigPath().

A simple and quick fix (I guess there are a lot of better and nicer ways to do it) to implement the feature I'm interested in

From util.cpp

Code: Select all

string Util::getConfigPath() {
#ifdef _WIN32
		return getAppPath();
#else
		char* home = getenv("HOME");
		if (home) {
#ifdef __APPLE__
/// @todo Verify this for apple?
			return string(home) + "/Library/Application Support/Mac DC++/";
#else
			return string(home) + "/.dc++/";
#endif // __APPLE__
		}
		return emptyString;
#endif // _WIN32
}
if this

Code: Select all

#ifdef _WIN32
		return getAppPath();
#else
got changed to this

Code: Select all

#ifdef _WIN32
   char* dcconfighome = getenv("DCCONFIGHOME");

   if (dcconfighome){
      return dcconfighome; 
   }
   else{
     return getAppPath();
   }
#else
Then any windows user who would like to store the settings files from DC++ anywhere else than where the program is installed would only have to set an enviromental variable.

While I could probably do this myself for my own copy, I'm not sure my own version would get accepted in any hub...

ivulfusbar
Posts: 506
Joined: 2003-01-03 07:33

Post by ivulfusbar » 2006-03-31 15:14

Your changes in the code can't be detected remotely. So you don't need to care about that.
Everyone is supposed to download from the hubs, - I don´t know why, but I never do anymore.

Locked