| 605 | } |
| 606 | |
| 607 | QString BaseApplication::getProvisioningFilePath() const |
| 608 | { |
| 609 | auto provFilePath = d->m_ProvFile; |
| 610 | |
| 611 | // A null QString means look up a default provisioning file |
| 612 | if (provFilePath.isNull() && nullptr != qApp) |
| 613 | { |
| 614 | QFileInfo appFilePath(QCoreApplication::applicationFilePath()); |
| 615 | QDir basePath(QCoreApplication::applicationDirPath()); |
| 616 | |
| 617 | auto provFileName = appFilePath.baseName() + ".provisioning"; |
| 618 | |
| 619 | QFileInfo provFile(basePath.absoluteFilePath(provFileName)); |
| 620 | |
| 621 | #ifdef Q_OS_MAC |
| 622 | /* |
| 623 | * On macOS, if started from the build directory, the .provisioning file is located at: |
| 624 | * <MITK-build/bin/MitkWorkbench.provisioning> |
| 625 | * The executable path is: |
| 626 | * <MITK-build/bin/MitkWorkbench.app/Contents/MacOS/MitkWorkbench> |
| 627 | * In this case we have to cdUp threetimes. |
| 628 | * |
| 629 | * During packaging the MitkWorkbench.provisioning file is placed at the same |
| 630 | * level like the executable. Nothing has to be done. |
| 631 | */ |
| 632 | |
| 633 | if (!provFile.exists()) |
| 634 | { |
| 635 | basePath.cdUp(); |
| 636 | basePath.cdUp(); |
| 637 | basePath.cdUp(); |
| 638 | provFile.setFile(basePath.absoluteFilePath(provFileName)); |
| 639 | } |
| 640 | #endif |
| 641 | |
| 642 | if (provFile.exists()) |
| 643 | { |
| 644 | provFilePath = provFile.absoluteFilePath(); |
| 645 | } |
| 646 | #ifdef CMAKE_INTDIR |
| 647 | else |
| 648 | { |
| 649 | basePath.cdUp(); |
| 650 | provFile.setFile(basePath.absoluteFilePath(provFileName)); |
| 651 | |
| 652 | if (provFile.exists()) |
| 653 | provFilePath = provFile.absoluteFilePath(); |
| 654 | } |
| 655 | #endif |
| 656 | } |
| 657 | |
| 658 | return provFilePath; |
| 659 | } |
| 660 | |
| 661 | void BaseApplication::initializeQt() |
| 662 | { |