#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)
{
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);