]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 28 Jun 2016 21:37:55 +0000 (16:37 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 28 Jun 2016 21:37:55 +0000 (16:37 -0500)
lib/cpBaseQtApplication/MainWindow.cxx
lib/cpBaseQtApplication/MainWindow.h

index 46312b14d025fbe67c58282a4707c84c953b4ea9..830508fb18d58a60ef0f14106d746735ff2314e0 100644 (file)
@@ -48,19 +48,21 @@ MainWindow(
     m_Editor( NULL ),
     m_MPR( NULL )
 {
-  QFileInfo i( argv[ 0 ] );
-  if( i.exists( ) )
-  {
-    this->m_ExecutionPath = i.canonicalPath( ).toStdString( );
-    try { this->m_Interface.AddEnvironments( this->m_ExecutionPath ); }
-    catch( ... ) { }
-    try { this->m_Interface.OpenEnvironments( this->m_ExecutionPath ); }
-    catch( ... ) { }
-    try { this->m_Interface.SaveEnvironments( this->m_ExecutionPath ); }
-    catch( ... ) { }
-  }
-  else
-    this->m_ExecutionPath = "";
+  QFileInfo e_path( argv[ 0 ] );
+  QDir r_path( "." );
+  this->m_RunPath = r_path.canonicalPath( ).toStdString( );
+  std::stringstream paths;
+  paths
+    << e_path.canonicalPath( ).toStdString( )
+    << cpPlugins_SEPARATOR
+    << this->m_RunPath;
+
+  try { this->m_Interface.AddEnvironments( this->m_RunPath ); }
+  catch( ... ) { }
+  try { this->m_Interface.OpenEnvironments( this->m_RunPath ); }
+  catch( ... ) { }
+  try { this->m_Interface.SaveEnvironments( this->m_RunPath ); }
+  catch( ... ) { }
   this->UpdateEnvironment( );
   this->m_Workspace.SetInterface( &( this->m_Interface ) );
 }
@@ -155,7 +157,7 @@ _AddEnvironments( const std::string& environments )
 {
   try { this->m_Interface.AddEnvironments( environments ); }
   catch( ... ) { }
-  try { this->m_Interface.SaveEnvironments( this->m_ExecutionPath ); }
+  try { this->m_Interface.SaveEnvironments( this->m_RunPath ); }
   catch( ... ) { }
   this->UpdateEnvironment( );
 }
@@ -540,12 +542,10 @@ _InteractiveAddEnviromentPaths( )
   if( dlg.exec( ) )
   {
     auto paths = dlg.getPaths( );
+    std::stringstream envs;
     for( auto p = paths.begin( ); p != paths.end( ); ++p )
-    {
-      try { this->m_Interface.AddEnvironments( *p ); }
-      catch( ... ) { }
-
-    } // rof
+      envs << *p << cpPlugins_SEPARATOR;
+    this->_AddEnvironments( envs.str( ) );
     this->UpdateEnvironment( );
 
   } // fi
index c68aac9267eb7f56074322e0ac59a65f358ce504..6a7190ea653bc1b73fffa03f0c9bf3945b9b1a3e 100644 (file)
@@ -92,7 +92,7 @@ namespace cpBaseQtApplication
     _TBlocker     m_Blocker;
     std::string   m_PluginsPath;
 
-    std::string m_ExecutionPath;
+    std::string m_RunPath;
     cpPlugins::Interface m_Interface;
     cpPlugins::Workspace m_Workspace;