forked from qt-creator/qt-creator
		
	Utils: Add user name accessor to the Environnment class.
Change-Id: Ic67381ab185525552eef948af602d00d3800b653 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
		@@ -39,7 +39,7 @@
 | 
			
		||||
 | 
			
		||||
#include <extensionsystem/pluginmanager.h>
 | 
			
		||||
 | 
			
		||||
#include <utils/hostosinfo.h>
 | 
			
		||||
#include <utils/environment.h>
 | 
			
		||||
#include <utils/fileutils.h>
 | 
			
		||||
 | 
			
		||||
#include <QSettings>
 | 
			
		||||
@@ -151,8 +151,7 @@ static bool keyWordReplacement(const QString &keyWord,
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    if (keyWord == QLatin1String("%USER%")) {
 | 
			
		||||
        const char * const envKey = Utils::HostOsInfo::isWindowsHost() ? "USERNAME" : "USER";
 | 
			
		||||
        *value = QString::fromLocal8Bit(qgetenv(envKey));
 | 
			
		||||
        *value = Utils::Environment::systemEnvironment().userName();
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    // Environment variables (for example '%$EMAIL%').
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user