- misc logs and screenshots now also go in userdata folder

This commit is contained in:
Mark Vejvoda
2011-03-10 17:31:55 +00:00
parent 0e1b8e62e4
commit 819831a287
6 changed files with 60 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
// ==============================================================
// This file is part of Glest Shared Library (www.glest.org)
//
// Copyright (C) 2001-2008 Marti<74>o Figueroa
// Copyright (C) 2001-2008 Marti<74>o Figueroa
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
@@ -75,6 +75,15 @@ Profiler::~Profiler(){
string profileLog = "profiler.log";
if(getGameReadWritePath(GameConstants::path_logs_CacheLookupKey) != "") {
profileLog = getGameReadWritePath(GameConstants::path_logs_CacheLookupKey) + profileLog;
}
else {
string userData = config.getString("UserData_Root","");
if(userData != "") {
if(userData != "" && EndsWith(userData, "/") == false && EndsWith(userData, "\\") == false) {
userData += "/";
}
}
profileLog = userData + profileLog;
}
FILE *f= fopen(profileLog.c_str(), "w");
if(f==NULL)