diff --git a/Applications/Diffusion/MitkDiffusion.cpp b/Applications/Diffusion/MitkDiffusion.cpp index 47ed67b..7e977af 100644 --- a/Applications/Diffusion/MitkDiffusion.cpp +++ b/Applications/Diffusion/MitkDiffusion.cpp @@ -1,65 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include - #include #include #include #include +#if defined __GNUC__ && !defined __clang__ +# include +# include +# include +# include +#endif + int main(int argc, char **argv) { mitk::BaseApplication app(argc, argv); app.setSingleMode(true); - app.setApplicationName("MitkDiffusion"); + app.setApplicationName("MITK Diffusion"); app.setOrganizationName("DKFZ"); /* bool showSplashScreen(true); QPixmap pixmap(":/splash/splashscreen.png"); QSplashScreen splash(pixmap); splash.setMask(pixmap.mask()); splash.setWindowFlags(Qt::SplashScreen | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint); if (showSplashScreen) { splash.show(); app.sendPostedEvents(); app.processEvents(); qSafeApp.flush(); QTimer::singleShot(4000, &splash, SLOT(close())); } */ - // Preload the org.mitk.gui.qt.ext plug-in (and hence also QmitkExt) to speed - // up a clean-cache start. This also works around bugs in older gcc and glibc implementations, - // which have difficulties with multiple dynamic opening and closing of shared libraries with - // many global static initializers. It also helps if dependent libraries have weird static - // initialization methods and/or missing de-initialization code. - QStringList preloadLibs; - preloadLibs << "liborg_mitk_gui_qt_ext"; - app.setPreloadLibraries(preloadLibs); + + #if defined __GNUC__ && !defined __clang__ + auto library = QFileInfo(argv[0]).dir().path() + "/../lib/plugins/liborg_blueberry_core_expressions.so"; + + if (!QFileInfo(library).exists()) + library = "liborg_blueberry_core_expressions"; + + app.setPreloadLibraries(QStringList() << library); + #endif // app.setProperty(mitk::BaseApplication::PROP_APPLICATION, "org.mitk.qt.diffusionimagingapp"); app.setProperty(mitk::BaseApplication::PROP_PRODUCT, "org.mitk.gui.qt.diffusionimagingapp.diffusion"); // Run the workbench. return app.run(); -} \ No newline at end of file +}