summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2009-09-04 11:25:08 (GMT)
committerPrasanth Ullattil <prasanth.ullattil@nokia.com>2009-09-04 11:47:36 (GMT)
commit9706ecab65ebd95b2facd22f5378c6614225b390 (patch)
tree643955a2c75a8d9b4e099ec35fd5ebfc3bad6a1b /demos
parentb576bca55f88ed749a0a2b409be986dbf6b96b0a (diff)
downloadQt-9706ecab65ebd95b2facd22f5378c6614225b390.zip
Qt-9706ecab65ebd95b2facd22f5378c6614225b390.tar.gz
Qt-9706ecab65ebd95b2facd22f5378c6614225b390.tar.bz2
%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
Diffstat (limited to 'demos')
-rw-r--r--demos/qtdemo/menumanager.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp
index 12796dc..88eaeb3 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"){