mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 09:40:52 +01:00
fix some memory leaks
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3012 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -433,14 +433,18 @@ TitleBlockTemplatesCollection *QETApp::titleBlockTemplatesCollection(const QStri
|
||||
*/
|
||||
QString QETApp::userName() {
|
||||
QProcess * process = new QProcess();
|
||||
QString str;
|
||||
#ifndef Q_OS_WIN32
|
||||
// return(QString(getenv("USER")));
|
||||
return((process->processEnvironment()).value("USER", "UNKNOWN"));
|
||||
str = (process->processEnvironment()).value("USER", "UNKNOWN");
|
||||
delete process;
|
||||
return(str);
|
||||
#else
|
||||
// return(QString(getenv("USERNAME")));
|
||||
return((process->processEnvironment()).value("USERNAME", "UNKNOWN"));
|
||||
#endif
|
||||
str = (process->processEnvironment()).value("USERNAME", "UNKNOWN");
|
||||
delete process;
|
||||
return(str);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user