Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 8de1af27 authored by promayon's avatar promayon
Browse files

FIXED better way to access environment variable (using Qt)


git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@546 ec899d31-69d1-42ba-9299-647d76f65fb3
parent dc93d605
......@@ -31,6 +31,8 @@
#include <fstream>
#include <sstream>
#include <QProcessEnvironment>
namespace camitk
{
// global static logfile
......@@ -63,16 +65,10 @@ bool Log::getShowUser() {
//--------------- getUserInformation ------------------
std::string Log::getUserInformation() {
static std::string user = "";
if (user == "") {
if (NULL != getenv("USERNAME"))
user = getenv("USERNAME");
else if (NULL != getenv("USER"))
user = getenv("USER");
else
user = "unidentified user";
}
return user;
std::string username= QProcessEnvironment::systemEnvironment().value("USERNAME","").toStdString();
if (username == "")
username= QProcessEnvironment::systemEnvironment().value("LOGNAME","Unknown User Name").toStdString();
return username;
}
//---------------openLogFile------------------//
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment