Skip to content

Commit 87d2fea

Browse files
author
telwertowski
committed
For Mac OS X, if the QtCore framework is bundled with the application, clear the default library search path and look for Qt plugins only within the application bundle. This prevents loading the wrong plugins if Qt is already installed and someone is using the self-contained qgis bundle.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5529 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f0314f3 commit 87d2fea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/gui/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,14 @@ int main(int argc, char *argv[])
361361
// it must be handled before some other event handler runs and dismisses it as unknown.
362362
// If run at startup, the handler will set either or both of myProjectFileName and myFileList.
363363
AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, openDocumentsAEHandler, 0, false);
364+
365+
// If the QtCore framework is bundled with the application, clear the library search path
366+
// and look for Qt plugins only within the application bundle.
367+
QString bundledQtCore(QCoreApplication::applicationDirPath().append("/lib/QtCore.framework"));
368+
if (QFile::exists(bundledQtCore))
369+
{
370+
QCoreApplication::setLibraryPaths(QStringList(QCoreApplication::applicationDirPath()));
371+
}
364372
#endif
365373

366374
// Check to see if qgis was started from the source directory.

0 commit comments

Comments
 (0)