From 9706ecab65ebd95b2facd22f5378c6614225b390 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 4 Sep 2009 13:25:08 +0200 Subject: %SystemDrive% folder created in current directory on Windows 7. This happens only when the standarddialogs demo is run from qtdemo. On Windows 7, calling the GetOpenFileName() caches something in %SystemDrive%\ProgramData\Microsoft\Windows\Caches. qtdemo was removing all environment variables other than PATH for the child processes. This caused the example to dump the cache in current directory instead. Task-number: 260898 Reviewed-by: Jens Bache-Wiig --- demos/qtdemo/menumanager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'demos/qtdemo') diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp index 12796dc882..88eaeb32f1 100644 --- a/demos/qtdemo/menumanager.cpp +++ b/demos/qtdemo/menumanager.cpp @@ -324,9 +324,10 @@ void MenuManager::launchExample(const QString &name) #ifdef Q_OS_WIN //make sure it finds the dlls on windows - QString curpath = QString::fromLocal8Bit(qgetenv("PATH").constData()); - QString newpath = QString("PATH=%1;%2").arg(QLibraryInfo::location(QLibraryInfo::BinariesPath), curpath); - process->setEnvironment(QStringList(newpath)); + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + env.insert(QLatin1String("PATH"), QLibraryInfo::location(QLibraryInfo::BinariesPath) + + QLatin1Char(';') + env.value(QLatin1String("Path"))); + process->setProcessEnvironment(env); #endif if (info[name]["changedirectory"] != "false"){ -- cgit v1.2.3