Salome HOME
Copyright update 2022
[modules/gui.git] / src / SUIT / SUIT_LicenseDlg.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 6a2c7db..9b8a92a
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -25,6 +25,7 @@
 #include <QPushButton>
 #include <QTextStream> 
 #include <QFile>
+#include <QDir>
 #include <QPrinter>
 //#include <QSimpleRichText>
 #include <QTextDocument>
@@ -32,6 +33,8 @@
 
 #include <math.h>
 
+#include <Qtx.h>
+
 #ifdef WIN32
 #include <UserEnv.h>
 #endif
@@ -47,10 +50,7 @@ SUIT_LicenseDlg::SUIT_LicenseDlg( bool firstShow, QWidget* parent, const char* n
 {
   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 ) )
@@ -116,6 +116,7 @@ SUIT_LicenseDlg::~SUIT_LicenseDlg()
 
 void SUIT_LicenseDlg::onAgree()
 {
+  /*
   QString env;
 #ifdef WIN32
   DWORD aLen=1024;
@@ -139,6 +140,11 @@ void SUIT_LicenseDlg::onAgree()
   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;