Compare commits

...

10 commits

Author SHA1 Message Date
Roman Telezhynskyi fc13414011 Specify working directory when call cmake. 2023-09-21 19:00:45 +03:00
Roman Telezhynskyi 69fc2ee343 Specify path when unzip macdeployqt source. 2023-09-21 18:48:16 +03:00
Roman Telezhynskyi c9084d2039 Fix deprecation warning.
'start' is deprecated: Use QProcess::start(const QString &program, const QStringList &arguments,OpenMode mode = ReadWrite) instead.
2023-09-21 18:47:40 +03:00
Roman Telezhynskyi b12124603e Use custom macdeployqt with better compatibility with brew. 2023-09-21 18:20:22 +03:00
Roman Telezhynskyi 9dad93dcc3 Bug fixes for macdeployqt module. 2023-09-21 17:45:30 +03:00
Roman Telezhynskyi 792817313a New property macdeployqtProgramBinPath to control path to macdeployqt. 2023-09-21 17:44:59 +03:00
Roman Telezhynskyi b9f5b06fbb Copy signed executable inside app bundle when build single bundle build. 2023-09-21 17:39:56 +03:00
Roman Telezhynskyi f2596591e5 New module pdftops.
With Qt 6 copy and sign pdftops from brew.
2023-09-21 17:37:49 +03:00
Roman Telezhynskyi 5876813056 Revert "Switch to using external pdftops utility to convert pdf to ps on mac."
This reverts commit 4eba1fa673.
2023-09-21 16:31:41 +03:00
Roman Telezhynskyi 6a86463fde Append to PATH instead of perpend. 2023-09-15 09:44:17 +03:00
13 changed files with 230 additions and 33 deletions

View file

@ -229,14 +229,13 @@ macos_task_template: &MACOS_TASK_TEMPLATE
# This won't display anything secret.
- security find-identity -v -p codesigning
- brew update > /dev/null
- brew outdated
- brew install --force qt6 coreutils ccache qbs cmake git openssl@1.1 pkg-config
- brew upgrade qt6 coreutils ccache qbs cmake git openssl@1.1 pkg-config
- brew install qt6 coreutils ccache qbs cmake ninja git openssl@1.1 pkg-config poppler
- echo $PATH
- export PATH="${HOME}/.local/bin:`python3 -m site --user-base`/bin:$PATH"
- echo $PATH
- chmod -R 755 /opt/homebrew/opt/qt6/*
- chmod -R 755 /opt/homebrew/opt/openssl@1.1/*
- chmod -R 755 /opt/homebrew/opt/poppler/*
- python3 --version
- pip3 install --user --upgrade pip dropbox conan==1.60
- ccache --set-config sloppiness=pch_defines,time_macros max_size="$CCACHE_SIZE"
@ -257,6 +256,10 @@ macos_task_template: &MACOS_TASK_TEMPLATE
- sudo ln -s /Library/Developer/CommandLineTools/usr/bin/python3 /Library/Developer/CommandLineTools/usr/bin/python
- whereis python
- pwd
- curl -LJ https://github.com/dismine/macdeployqt/archive/refs/heads/main.zip --output ${HOME}/macdeployqt-main.zip --silent
- unzip ${HOME}/macdeployqt-main.zip -d ${HOME}/macdeployqt-main
- cmake ${HOME}/macdeployqt-main -GNinja -S ${HOME}/macdeployqt-main -B ${HOME}/macdeployqt-build-dir -DCMAKE_INSTALL_PREFIX=${HOME}/macdeployqt-install-dir -DCMAKE_BUILD_TYPE=Release
- cmake ${HOME}/macdeployqt-main --build ${HOME}/macdeployqt-build-dir --target install
- conan profile new valentina
- conan profile update settings.build_type=Release valentina
- conan profile update settings.os=Macos valentina
@ -271,8 +274,8 @@ macos_task_template: &MACOS_TASK_TEMPLATE
- qbs setup-qt /opt/homebrew/opt/qt6/bin/qmake qt6
- qbs-config defaultProfile qt6
- qbs config profiles.qt6.baseProfile clang
- qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build --command-echo-mode command-line --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:${ENABLE_CCACHE} project.conanProfiles:valentina moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME"
- qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:${ENABLE_CCACHE} project.conanProfiles:valentina moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME"
- qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build --command-echo-mode command-line --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:${ENABLE_CCACHE} project.conanProfiles:valentina moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:$(brew --prefix qt6)/lib,$(brew --prefix poppler)/lib modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir
- qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:${ENABLE_CCACHE} project.conanProfiles:valentina moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:$(brew --prefix qt6)/lib,$(brew --prefix poppler)/lib modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir
# Store the notarization credentials so that we can prevent a UI password dialog
# from blocking the CI
- echo "Create keychain profile"

View file

@ -39,7 +39,6 @@
- New option: Pointer mode.
- Fix GUI freezing while nesting.
- New option: Use Tool Groups.
- Switch to using external pdftops utility to convert pdf to ps on mac.
# Valentina 0.7.52 September 12, 2022
- Fix crash when default locale is ru.

View file

@ -693,7 +693,7 @@ for:
python3 ./scripts/treestate.py scan /usr/local usrlocal.json
brew update
brew install coreutils ccache git openssl@1.1 pkg-config qbs
brew install coreutils ccache git openssl@1.1 pkg-config qbs curl cmake ninja poppler
# The build environment is now ready for use. We can complete
# the rest of the process of creating the Homebrew archive
@ -717,18 +717,23 @@ for:
fi
- sudo python3 -m pip install --upgrade pip
- pip3 install --user --upgrade pip dropbox conan==1.60
- export PATH="`python3 -m site --user-base`/bin:$PATH"
- export PATH="$PATH:`python3 -m site --user-base`/bin"
- echo $PATH
- python3 --version
- conan --version
- clang --version
- qmake --version
- which qmake
- which qbs
- qbs --version
# Patch Qbs. Remove after Qbs 2.1.2+.
- curl https://gist.githubusercontent.com/dismine/43a20f66f563232e54e02f2e85732e7a/raw/e80a0c827348da3e99310ba4a648c1860bb3a8a6/BundleModule.qbs --output $HOME/BundleModule.qbs --silent
- cp -f $HOME/BundleModule.qbs $(brew --prefix qbs)/share/qbs/modules/bundle/BundleModule.qbs
- rm $HOME/BundleModule.qbs
- curl -LJ https://github.com/dismine/macdeployqt/archive/refs/heads/main.zip --output ${HOME}/macdeployqt-main.zip --silent
- unzip ${HOME}/macdeployqt-main.zip -d ${HOME}/macdeployqt-main
- cmake ${HOME}/macdeployqt-main -GNinja -S ${HOME}/macdeployqt-main -B ${HOME}/macdeployqt-build-dir -DCMAKE_INSTALL_PREFIX=${HOME}/macdeployqt-install-dir -DCMAKE_BUILD_TYPE=Release
- cmake ${HOME}/macdeployqt-main --build ${HOME}/macdeployqt-build-dir --target install
- cd ${APPVEYOR_BUILD_FOLDER}
build_script:
@ -739,8 +744,8 @@ for:
- qbs setup-qt ${QTDIR}/bin/qmake qt6
- qbs config defaultProfile qt6
- qbs config profiles.qt6.baseProfile clang
- qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME"
- qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME"
- qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:$(brew --prefix poppler)/lib modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir
- qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.enableConan:true project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:false moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:$(brew --prefix poppler)/lib modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir
# Store the notarization credentials so that we can prevent a UI password dialog
# from blocking the CI
- echo "Create keychain profile"

BIN
dist/macx/bin64/pdftops vendored Executable file

Binary file not shown.

View file

@ -123,4 +123,9 @@ CppApplication {
}
fileTags: ["cpp_pch_src"]
}
Export {
Depends { name: "bundle"; condition: qbs.targetOS.contains("macos") }
Depends { name: "macdeployqt"; condition: qbs.targetOS.contains("macos") }
}
}

View file

@ -8,7 +8,6 @@ VApp {
Depends { name: "i18nconfig"; }
Depends { name: "i18n"; }
Depends { name: "ib"; condition: qbs.targetOS.contains("macos") }
Depends { name: "macdeployqt"; condition: qbs.targetOS.contains("macos") }
version: buildconfig.projectVersion
install: true
@ -204,7 +203,6 @@ VApp {
Properties {
condition: qbs.targetOS.contains("macos")
ib.appIconName: targetName
macdeployqt.targetApps: ["Tape", "Puzzle"]
}
Properties {

View file

@ -14,6 +14,8 @@ Module {
property string macdeployqtArtifact: artifacts ? "maceployqt.txt" : undefined
property string macdeployqtProgramBinPath : undefined
property string macdeployqtProgram: "macdeployqt"
property bool noPlugins: false
@ -26,9 +28,9 @@ Module {
property bool alwaysOverwrite: false
property bool appstoreCompliant: false
property bool appstoreCompliant: false
property string libpath: undefined
property stringList libpath: undefined
property stringList targetApps: undefined
@ -63,7 +65,7 @@ Module {
cmdArgs.push("-no-plugins");
if (product.macdeployqt.verbose !== undefined)
cmdArgs.push("-verbose", product.macdeployqt.verbose);
cmdArgs.push("-verbose=" + product.macdeployqt.verbose);
if (product.macdeployqt.noStrip)
cmdArgs.push("-no-strip");
@ -78,7 +80,9 @@ Module {
cmdArgs.push("-appstore-compliant");
if (product.macdeployqt.libpath !== undefined)
cmdArgs.push("-libpath", product.macdeployqt.libpath);
product.macdeployqt.libpath.forEach(function(libpath) {
cmdArgs.push("-libpath=" + libpath);
});
if (product.buildconfig.enableCodeSigning) {
if (product.macdeployqt.signForNotarization)
@ -87,14 +91,18 @@ Module {
cmdArgs.push("-codesign=" + product.macdeployqt.signingIdentity);
}
if (product.macdeployqt.targetApps !== undefined && !product.buildconfig.enableMultiBundle && product.primaryApp)
if (product.macdeployqt.targetApps !== undefined)
{
product.macdeployqt.targetApps.forEach(function(targetApp) {
cmdArgs.push("-executable=\"" + installRoot + "/" + product.targetName + ".app/Contents/MacOS/" + targetApp + "\"");
cmdArgs.push("-executable=" + FileInfo.joinPaths(installRoot, product.targetName + ".app", "Contents", "MacOS", targetApp));
});
}
var cmd = new Command(product.Qt.core.binPath + "/" + macdeployqtProgram, cmdArgs);
var macdeployqtProgramBinPath = product.Qt.core.binPath;
if (product.macdeployqt.macdeployqtProgramBinPath !== undefined)
macdeployqtProgramBinPath = product.macdeployqt.macdeployqtProgramBinPath;
var cmd = new Command(macdeployqtProgramBinPath + "/" + macdeployqtProgram, cmdArgs);
cmd.jobPool = "macdeployqt";
cmd.description = "invoking '" + macdeployqtProgram;
cmd.stdoutFilePath = product.buildDirectory + "/" + product.macdeployqt.macdeployqtArtifact;

View file

@ -70,7 +70,7 @@ Module {
Rule {
// alwaysRun: true
condition: product.qbs.targetOS.contains("macos") && !product.buildconfig.enableMultiBundle && product.type.contains("application")
inputs: ["application"]
inputs: ["bundle.application-executable"]
outputFileTags: ["multibundle"]
outputArtifacts: {
var artifactNames = [];

View file

@ -0,0 +1,106 @@
import qbs.Process
import qbs.File
import qbs.FileInfo
import qbs.Utilities
Module {
additionalProductTypes: ["pdftops.bundled"]
readonly property string pdftopsPath: pdftopsProbe.path
readonly property bool pdftopsPresent: pdftopsProbe.found
Probe {
id: pdftopsProbe
property string path
property string sourceDirectory: project.sourceDirectory
property string qtVersion: product.Qt.core.version
configure: {
if (Utilities.versionCompare(qtVersion, "6") >= 0) {
var detector = new Process();
try {
if (detector.exec("which", ["pdftops"]) === 0) {
var binPath = detector.readStdOut().trim(); // we can read only one time
if (detector.exec("realpath", [binPath]) === 0) {
path = detector.readStdOut().trim();
console.info("Found pdftops at '" + path + "'.");
found = true;
}
}
} finally {
detector.close();
}
} else {
var binPath = sourceDirectory + "/dist/macx/bin64/pdftops";
if (product.qbs.architecture.contains("x86_64") && File.exists(binPath)) {
path = binPath;
found = true;
}
}
}
}
Rule {
multiplex: true
inputs: ["pdftops.in"]
prepare: {
var cmds = [];
var src = input.filePath;
var dst = output.filePath;
var copyCmd = new Command("cp", [src, dst]);
copyCmd.highlight = 'filegen';
copyCmd.description = "copying " + input.fileName;
cmds.push(copyCmd);
if (!product.codesign.enableCodeSigning)
return cmds;
var actualSigningIdentity = product.codesign._actualSigningIdentity;
if (!actualSigningIdentity) {
throw "No codesigning identities (i.e. certificate and private key pairs) matching “"
+ product.codesign.signingIdentity + "” were found.";
}
var args = ["--force", "--sign", actualSigningIdentity.SHA1];
// If signingTimestamp is undefined or empty, do not specify the flag at all -
// this uses the system-specific default behavior
var signingTimestamp = product.codesign.signingTimestamp;
if (signingTimestamp) {
// If signingTimestamp is an empty string, specify the flag but do
// not specify a value - this uses a default Apple-provided server
var flag = "--timestamp";
if (signingTimestamp)
flag += "=" + signingTimestamp;
args.push(flag);
}
args = args.concat(product.codesign.codesignFlags || []);
args.push(output.filePath);
console.warn(args);
var cmdSign = new Command(product.codesign.codesignPath, args);
cmdSign.description = "codesign " + output.fileName
+ " (" + actualSigningIdentity.subjectInfo.CN + ")";
cmdSign.outputFilePath = output.filePath;
cmdSign.stderrFilterFunction = function(stderr) {
return stderr.replace(outputFilePath + ": replacing existing signature\n", "");
};
cmds.push(cmdSign);
return cmds;
}
Artifact {
filePath: FileInfo.joinPaths(product.qbs.installRoot, product.qbs.installPrefix,
product.buildconfig.installAppPath,
product.targetName + ".app", "Contents", "MacOS", "pdftops")
fileTags: ["pdftops.bundled"]
}
}
}

View file

@ -14,6 +14,7 @@ VToolApp {
Depends { name: "FervorLib" }
Depends { name: "multibundle"; }
Depends { name: "VGAnalyticsLib" }
Depends { name: "pdftops"; condition: qbs.targetOS.contains("macos") }
// Explicitly link to libcrypto and libssl to avoid error: Failed to load libssl/libcrypto.
// Use moduleProviders.qbspkgconfig.extraPaths to define the missing dependency.
@ -201,6 +202,25 @@ VToolApp {
qbs.installDir: buildconfig.installBinaryPath
}
Properties {
condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle
macdeployqt.targetApps: {
var apps = [];
if (pdftops.pdftopsPresent)
apps.push("pdftops");
return apps;
}
}
Group {
condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle && pdftops.pdftopsPresent
name: "pdftops MacOS"
files: [pdftops.pdftopsPath]
fileTags: ["pdftops.in"]
}
Group {
name: "48x48/apps"
prefix: project.sourceDirectory + "/share/icons/48x48/apps/"

View file

@ -304,6 +304,10 @@ unix{
puzzle.path = $$MACOS_DIR
puzzle.files += $${OUT_PWD}/../puzzle/$${DESTDIR}/puzzle.app/$$MACOS_DIR/puzzle
# Utility pdftops need for saving a layout image to PS and EPS formates.
xpdf.path = $$MACOS_DIR
xpdf.files += $${PWD}/../../../dist/macx/bin64/pdftops
# logo on macx.
ICON = ../../../dist/Valentina.icns
@ -342,6 +346,7 @@ unix{
libraries \
tape \
puzzle \
xpdf \
icns_resources
}
}

View file

@ -15,6 +15,7 @@ VToolApp {
Depends { name: "VFormatLib"; }
Depends { name: "VMiscLib"; }
Depends { name: "VGAnalyticsLib" }
Depends { name: "pdftops"; condition: qbs.targetOS.contains("macos") }
Depends { name: "Tape"; condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle }
Depends { name: "Puzzle"; condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle }
@ -44,7 +45,6 @@ VToolApp {
}
primaryApp: true
name: "Valentina"
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Valentina" : "valentina"
targetName: buildconfig.appTarget
@ -258,6 +258,20 @@ VToolApp {
}
}
Properties {
condition: qbs.targetOS.contains("macos")
macdeployqt.targetApps: {
var apps = [];
if (!buildconfig.enableMultiBundle)
apps.push("Tape", "Puzzle");
if (pdftops.pdftopsPresent)
apps.push("pdftops");
return apps;
}
}
Group {
condition: qbs.targetOS.contains("windows") && (qbs.architecture.contains("x86_64") || qbs.architecture.contains("x86"))
name: "pdftops Windows"
@ -267,6 +281,13 @@ VToolApp {
qbs.installDir: buildconfig.installBinaryPath
}
Group {
name: "pdftops MacOS"
condition: qbs.targetOS.contains("macos") && pdftops.pdftopsPresent
files: [pdftops.pdftopsPath]
fileTags: ["pdftops.in"]
}
Group {
name: "freedesktop"
prefix: project.sourceDirectory + "/dist/"

View file

@ -404,22 +404,38 @@ void VLayoutExporter::ExportToHPGL2(const QVector<VLayoutPiece> &details) const
//---------------------------------------------------------------------------------------------------------------------
auto VLayoutExporter::SupportPDFConversion() -> bool
{
QProcess proc;
#if defined(Q_OS_WIN)
// Seek pdftops in app bundle or near valentina.exe
proc.start(qApp->applicationDirPath() + QLatin1String("/") + *PDFTOPS, QStringList());
auto Test = [](const QString &program)
{
QProcess proc;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
proc.start(program);
#else
proc.start(*PDFTOPS, QStringList()); // Seek pdftops in standard path
proc.start(program, QStringList());
#endif
const int timeout = 15000;
if (proc.waitForStarted(timeout) && (proc.waitForFinished(timeout) || proc.state() == QProcess::NotRunning))
{
return true;
}
const int timeout = 15000;
if (proc.waitForStarted(timeout) && (proc.waitForFinished(timeout) || proc.state() == QProcess::NotRunning))
{
return true;
}
qDebug() << *PDFTOPS << "error" << proc.error() << proc.errorString();
return false;
qDebug() << program << "error" << proc.error() << proc.errorString();
return false;
};
#if defined(Q_OS_OSX)
// Seek pdftops in app bundle
bool found = Test(qApp->applicationDirPath() + QLatin1String("/") + *PDFTOPS);
if (not found)
{
found = Test(*PDFTOPS);
}
return found;
#elif defined(Q_OS_WIN)
return Test(qApp->applicationDirPath() + QLatin1String("/") + *PDFTOPS);
#else
return Test(*PDFTOPS);
#endif
}
//---------------------------------------------------------------------------------------------------------------------
@ -435,7 +451,18 @@ void VLayoutExporter::PdfToPs(const QStringList &params)
#endif
QProcess proc;
#if defined(Q_OS_MAC)
if (QFileInfo::exists(qApp->applicationDirPath() + QLatin1String("/") + *PDFTOPS))
{
proc.start(QLatin1String(qApp->applicationDirPath() + QLatin1String("/") + *PDFTOPS, params);
}
else
{
proc.start(*PDFTOPS, params);
}
#else
proc.start(*PDFTOPS, params);
#endif
const int timeout = 15000;
if (proc.waitForStarted(timeout))