Added ifdef's for OSX compilation (per J.Collord)

git-svn-id: http://svn.osgeo.org/qgis/trunk@1565 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
gsherman 2004-06-12 19:54:43 +00:00
parent 5366915385
commit a6a2f975d6

View File

@ -21,6 +21,11 @@
#ifndef WIN32
#include <dlfcn.h>
#endif
#ifdef Q_OS_MACX
#import <Carbon/Carbon.h>
#endif
#include <qaction.h>
#include <qapplication.h>
#include <qbitmap.h>
@ -363,8 +368,24 @@ QgisApp::QgisApp(QWidget * parent, const char *name, WFlags fl):QgisAppBase(pare
#else
mAppDir = PREFIX;
#endif
// Get pointer to the provider registry singleton
#ifdef Q_OS_MACX
// we do different things for OSX - set both application dir and plugin lib
// location here:
CFURLRef pprefixRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFStringRef mmacPath = CFURLCopyFileSystemPath(pprefixRef, kCFURLPOSIXPathStyle);
// store application dir
mAppDir = CFStringGetCStringPtr(macPath, CFStringGetSystemEncoding());
mAppDir = mAppDir + "/Contents/Resources";
// store location of plugins
plib = CFStringGetCStringPtr(mmacPath, CFStringGetSystemEncoding());
plib = plib + "/Contents/Resources/lib";
#else
// win32 and posix plugin path:
QString plib = PLUGINPATH;
#endif
mProviderRegistry = QgsProviderRegistry::instance(plib);
#ifdef QGISDEBUG