-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <QPushButton>
#include <QTextStream>
#include <QFile>
+#include <QDir>
#include <QPrinter>
//#include <QSimpleRichText>
#include <QTextDocument>
#include <math.h>
+#include <Qtx.h>
+
#ifdef WIN32
#include <UserEnv.h>
#endif
{
setObjectName( name );
setModal( modal );
- QString env;
- if ( ::getenv( "SALOME_LICENSE_FILE" ) )
- env = ::getenv( "SALOME_LICENSE_FILE" );
-
+ QString env = Qtx::getenv( "SALOME_LICENSE_FILE" );
QFile file( env ); // Read the text from a file
if ( !file.exists() || !file.open( QIODevice::ReadOnly ) )
void SUIT_LicenseDlg::onAgree()
{
+ /*
QString env;
#ifdef WIN32
- DWORD aLen=1024;
- char aStr[1024];
+ DWORD aLen=1024;
+ TCHAR aStr[1024];
HANDLE aToken=0;
HANDLE hProcess = GetCurrentProcess();
OpenProcessToken(hProcess,TOKEN_QUERY,&aToken);
if( ! GetUserProfileDirectory( aToken, aStr, &aLen ) )
reject();
-
+#ifdef UNICODE
+ env = QString::fromWCharArray(aStr);
+#else
env = aStr;
+#endif
#else
if( ! ::getenv( "HOME" ) )
reject();
QFile file( env + "/ReadLicense.log" ); // Read the text from a file
file.open( QIODevice::WriteOnly );
+ */
+ QString env = QDir::homePath();
+ QFile file( env + "/ReadLicense.log" );
+ if (!file.open( QIODevice::WriteOnly ))
+ reject();
QTextStream ts( &file );
ts << "OK" << endl;