Commit b30b2e9e authored by Jule Marcoueille's avatar Jule Marcoueille

Modification de la méthode d'ouverture d'une seconde trace de manière à ce...

Modification de la méthode d'ouverture d'une seconde trace de manière à ce qu'elle soit totalement portable (Qt powa).
parent 3f975943
......@@ -26,11 +26,14 @@ Interface_console::Interface_console(int argc, char ** argv){
int state;
bool useGUI;/* if window interface can be displayed */
QDir current_directory;
QString current_path;
_run_env[0] = (char *)malloc(_CURRENT_DIR_SIZE*sizeof(char));
if (getcwd(_run_env[0], _CURRENT_DIR_SIZE) == NULL){
current_path = current_directory.currentPath();
_run_env[0] = (char *)malloc(current_path.length()*sizeof(char));
if (!strcpy(_run_env[0], current_path.toStdString().c_str())) {
cerr << "Error : in " << __FILE__ << " at line " << __LINE__ << "." << endl;
cerr << "Reason : Path length is too long (>" << _CURRENT_DIR_SIZE << "). Try to rise the value of _CURRENT_DIR_SIZE." << endl;
cerr << "Reason : Copy of the current path directory failed." << endl;
exit(EXIT_FAILURE);
}
_run_env[1] = argv[0];
......
......@@ -200,7 +200,8 @@ void Interface_graphic::on_open_triggered(){
QStringList arguments = (QStringList() << filename);
QString program;
char const* const* run_env = _core->get_runenv();
chdir(run_env[0]);
QString start_directory = run_env[0];
QDir::setCurrent(start_directory);
if (run_env[1][0] == '.')
program = QString(run_env[0])+QString(run_env[1]+sizeof(char));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment