diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2009-04-21 06:52:53 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-04-21 06:52:53 (GMT) |
commit | 7d572f0b4adf33db00352d8183b1e934cee85c39 (patch) | |
tree | fae73b9c4b3b2c1c41eac634ad7c6c6f299c1ce0 /qmake/generators/win32/winmakefile.cpp | |
parent | b2112b17e427274ac0610416b2941b091314f5ad (diff) | |
parent | f8c7de54eaf3e9165e41f212a13dd794ce7063a9 (diff) | |
download | Qt-7d572f0b4adf33db00352d8183b1e934cee85c39.zip Qt-7d572f0b4adf33db00352d8183b1e934cee85c39.tar.gz Qt-7d572f0b4adf33db00352d8183b1e934cee85c39.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
Diffstat (limited to 'qmake/generators/win32/winmakefile.cpp')
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 60a27be..87f55cf 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -432,9 +432,21 @@ void Win32MakefileGenerator::processRcFileVar() writeRcFile = rcFile.readAll() != rcString; rcFile.close(); } - if (writeRcFile && rcFile.open(QFile::WriteOnly)) { - rcFile.write(rcString); - rcFile.close(); + if (writeRcFile) { + bool ok; + ok = rcFile.open(QFile::WriteOnly); + if (!ok) { + // The file can't be opened... try creating the containing + // directory first (needed for clean shadow builds) + QDir().mkpath(QFileInfo(rcFile).path()); + ok = rcFile.open(QFile::WriteOnly); + } + if (!ok) { + ::fprintf(stderr, "Cannot open for writing: %s", rcFile.fileName().toLatin1().constData()); + ::exit(1); + } + rcFile.write(rcString); + rcFile.close(); } if (project->values("QMAKE_WRITE_DEFAULT_RC").isEmpty()) project->values("RC_FILE").insert(0, rcFile.fileName()); |