Hi,I tried to debug QElectroTech under Windows, using QtCreator and VisualStudio compiler and linker.On function QETApp::configDir() , for instance, the function getenv produced compiler warnings, and latter, while debugging, the char * created with contents from this function refused to be cleanly deleted.
So I found a solution (the original code lines are commented out:
QString QETApp::userName() {
QProcess * process = new QProcess(); // new line
#ifndef Q_OS_WIN32
// return(QString(getenv("USER")));
return ((process->processEnvironment()).value("USER", "UNKNOWN")); // new line
#else
// return(QString(getenv("USERNAME")));
return((process->processEnvironment()).value("USERNAME", "UNKNOWN")); // new line
#endif
delete process;
}
The only other member function in the project is in this same file, and it might look like this:
QString QETApp::configDir() {
#ifdef QET_ALLOW_OVERRIDE_CD_OPTION
if (config_dir != QString()) return(config_dir);
#endif
#ifdef Q_OS_WIN32
// recupere l'emplacement du dossier Application Data
// char *app_data_env = getenv("APPDATA");
// QString app_data_str(app_data_env);
QProcess * process = new QProcess(); // new line
QString app_data_str = (process->processEnvironment()).value("APPDATA"); // new line
// delete app_data_env;
delete process; // new line
if (app_data_str.isEmpty()) {
app_data_str = QDir::homePath() + "/Application Data";
}
return(app_data_str + "/qet/");
#else
return(QDir::homePath() + "/.qet/");
#endif
}
That's it, hope it helps.
Best regards,
Francisco
P.S.: thanks for the good work!!!!!