diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-06-03 18:02:31 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-06-03 18:02:31 (GMT) |
commit | ff2981a586c5ec3cb6fc1925f5d58e38302d1fed (patch) | |
tree | 8c6592620c1c3a36be5764237088f113ba940d45 /Swift | |
parent | 5e9fdddc3bde73b5eb3b763d01e5b03ec02acae3 (diff) | |
download | swift-contrib-ff2981a586c5ec3cb6fc1925f5d58e38302d1fed.zip swift-contrib-ff2981a586c5ec3cb6fc1925f5d58e38302d1fed.tar.bz2 |
Always generate DefaultThemeQRC if the default thheme changed.
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/QtUI/SConscript | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index ffafcb8..8a58f5e 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -1,20 +1,21 @@ import os, shutil, datetime import Version -def generateDefaultTheme(env, target, source) : - sourceDir = source[0].abspath - output = open(target[0].abspath, "w") - output.write("<RCC version =\"1.0\">") - output.write("<qresource prefix=\"/themes/Default\">") +def generateDefaultTheme(dir) : + sourceDir = dir.abspath + result = "<!-- WARNING: This file is automatically generated. Any changes will be overwritten. -->\n" + result += "<RCC version =\"1.0\">" + result += "<qresource prefix=\"/themes/Default\">" for (path, dirs, files) in os.walk(sourceDir) : for file in files : filePath = os.path.join(path,file) - output.write("<file alias=\"%(alias)s\">%(path)s</file>" % { + result += "<file alias=\"%(alias)s\">%(path)s</file>" % { "alias": filePath[len(sourceDir)+1:], "path": filePath - }) - output.write("</qresource>") - output.write("</RCC>") + } + result += "</qresource>" + result += "</RCC>" + return result Import("env") @@ -46,7 +47,7 @@ if env["PLATFORM"] == "win32" : myenv.Append(LINKFLAGS = ["/SUBSYSTEM:WINDOWS"]) myenv.Append(LIBS = "qtmain") -myenv.Command("DefaultTheme.qrc", "../resources/themes/Default", Action(generateDefaultTheme, cmdstr = "$GENCOMSTR")) +myenv.WriteVal("DefaultTheme.qrc", myenv.Value(generateDefaultTheme(myenv.Dir("../resources/themes/Default")))) sources = [ "main.cpp", |