From d3c10ca745baf1536b863a6bbeedec7d1fd5e525 Mon Sep 17 00:00:00 2001 From: Phil Olynyk Date: Sat, 8 Jun 2019 17:48:36 -0400 Subject: [PATCH] Add shell file to fix UI files for old QT versions - uses sed (Linux only) --- oscar/fix_5-12_UI_files.sh | 8 +++++ oscar/oscar.pro | 66 +++++++++++++++++++++++--------------- 2 files changed, 49 insertions(+), 25 deletions(-) create mode 100755 oscar/fix_5-12_UI_files.sh diff --git a/oscar/fix_5-12_UI_files.sh b/oscar/fix_5-12_UI_files.sh new file mode 100755 index 00000000..b3e415af --- /dev/null +++ b/oscar/fix_5-12_UI_files.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR + +sed -i s/PlaceholderText/Text/ mainwindow.ui +# diff --git a/oscar/oscar.pro b/oscar/oscar.pro index a881bbaa..b749d9d0 100644 --- a/oscar/oscar.pro +++ b/oscar/oscar.pro @@ -160,56 +160,72 @@ HTML_FILES = $$files($$PWD/../Htmldocs/*.html) #copy the Translation and Help files to where the test binary wants them message("Setting up Translations & Help Transfers") macx { - HelpFiles.files = $$files($$PWD/help/*.qch) - HelpFiles.path = Contents/Resources/Help + !contains(DEFINES, helpless) { + HelpFiles.files = $$files($$PWD/help/*.qch) + HelpFiles.path = Contents/Resources/Help + QMAKE_BUNDLE_DATA += HelpFiles + } QMAKE_BUNDLE_DATA += TransFiles - QMAKE_BUNDLE_DATA += HelpFiles } else { + !contains(DEFINES, helpless) { + HELPDIR = $$OUT_PWD/Help + HELP_FILES += $$PWD/help/*.qch + } DDIR = $$OUT_PWD/Translations - HELPDIR = $$OUT_PWD/Help HTMLDIR = $$OUT_PWD/Html TRANS_FILES += $$PWD/translations/*.qm - HELP_FILES += $$PWD/help/*.qch win32 { TRANS_FILES_WIN = $${TRANS_FILES} - HELP_FILES_WIN = $${HELP_FILES} - HTML_FILES_WIN = $${HTML_FILES} TRANS_FILES_WIN ~= s,/,\\,g - HELP_FILES_WIN ~= s,/,\\,g - HTML_FILES_WIN ~= s,/,\\,g DDIR ~= s,/,\\,g - HELPDIR ~= s,/,\\,g - HTMLDIR ~= s,/,\\,g - - !exists($$quote($$HELPDIR)): system(mkdir $$quote($$HELPDIR)) !exists($$quote($$DDIR)): system(mkdir $$quote($$DDIR)) - !exists($$quote($$HTMLDIR)): system(mkdir $$quote($$HTMLDIR)) - for(FILE,TRANS_FILES_WIN) { system(xcopy /y $$quote($$FILE) $$quote($$DDIR)) } - for(FILE,HELP_FILES_WIN) { - system(xcopy /y $$quote($$FILE) $$quote($$HELPDIR)) - } + + HTML_FILES_WIN = $${HTML_FILES} + HTML_FILES_WIN ~= s,/,\\,g + HTMLDIR ~= s,/,\\,g + !exists($$quote($$HTMLDIR)): system(mkdir $$quote($$HTMLDIR)) for(FILE,HTML_FILES_WIN) { system(xcopy /y $$quote($$FILE) $$quote($$HTMLDIR)) } - } else { - system(mkdir -p $$quote($$HELPDIR)) - system(mkdir -p $$quote($$DDIR)) - system(mkdir -p $$quote($$HTMLDIR)) + !contains(DEFINES, helpless) { + HELP_FILES_WIN = $${HELP_FILES} + HELP_FILES_WIN ~= s,/,\\,g + HELPDIR ~= s,/,\\,g + !exists($$quote($$HELPDIR)): system(mkdir $$quote($$HELPDIR)) + for(FILE,HELP_FILES_WIN) { + system(xcopy /y $$quote($$FILE) $$quote($$HELPDIR)) + } + } + } else { + system(mkdir -p $$quote($$DDIR)) for(FILE,TRANS_FILES) { system(cp $$quote($$FILE) $$quote($$DDIR)) } - for(FILE,HELP_FILES) { - system(cp $$quote($$FILE) $$quote($$HELPDIR)) - } + + system(mkdir -p $$quote($$HTMLDIR)) for(FILE,HTML_FILES) { system(cp $$quote($$FILE) $$quote($$HTMLDIR)) } + + !contains(DEFINES, helpless) { + system(mkdir -p $$quote($$HELPDIR)) + for(FILE,HELP_FILES) { + system(cp $$quote($$FILE) $$quote($$HELPDIR)) + } + } + } +} + +lessThan(QT_MAJOR_VERSION,5)|lessThan(QT_MINOR_VERSION,12) { + unix { + system("/bin/bash $$_PRO_FILE_PWD_/fix_5-12_UI_files.sh"); + message("Fixing UI files for old QT versions") } }