start trying to figure out where the documentation is
[mussa.git] / qui / mussagl.cpp
index da238ee433c8acb78397522fe7e97078cab4a959..92522de7a27cf015e7002523d7a2000adb5c3583 100644 (file)
@@ -10,9 +10,26 @@ using namespace boost::filesystem;
 #include <iostream>
 #include <QApplication>
 
-#include "qui/MussaWindow.hpp"
-#include "alg/parse_options.hpp"
-#include "mussa_exceptions.hpp"
+#if defined(Q_WS_MAC)
+#include <CoreFoundation/CoreFoundation.h>
+#endif 
+
+std::string get_doc_dir()
+{
+#if defined(Q_WS_MAC)
+  CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+  CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef,
+                                         kCFURLPOSIXPathStyle);
+  const char *pathPtr = CFStringGetCStringPtr(macPath,
+                                         CFStringGetSystemEncoding());
+  std::string doc_dir(pathPtr);
+  qDebug("Path = %s", pathPtr);
+  CFRelease(pluginRef);
+  CFRelease(macPath);
+#else
+  return string(".");
+#endif
+}
 
 int main(int argc, char **argv)
 {
@@ -25,6 +42,7 @@ int main(int argc, char **argv)
     std::clog << "DISPLAY not set, running in console mode only" << std::endl;
   }
 #endif
+  //opts.doc_dir = get_doc_dir();
 
   QApplication app(argc, argv, opts.useGUI);
   Q_INIT_RESOURCE(icons);