start trying to figure out where the documentation is
authorDiane Trout <diane@caltech.edu>
Thu, 24 Aug 2006 00:42:02 +0000 (00:42 +0000)
committerDiane Trout <diane@caltech.edu>
Thu, 24 Aug 2006 00:42:02 +0000 (00:42 +0000)
on os x determine the bundle path as a first step to finding where we might
have stored qtassistent and the documentation tree.

currently being ignored as i can more easly just launch a webbrowser to
our website.

alg/parse_options.hpp
qui/MussaWindow.cpp
qui/mussagl.cpp

index bd08ef526cf43be1b0b47acf303e1a6225318015..52445d06a8b40b5456a6160ae87f95ff3db6b442 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _PARSE_OPTIONS_H_
 #define _PARSE_OPTIONS_H_
 
+#include <string>
+
 class Mussa;
 
 //! collect information about runtime options
@@ -11,6 +13,8 @@ struct MussaOptions
 
   //! pointer to our analysis, if its null, feel free to die
   Mussa *analysis;
+  //! Location of documentation
+  std::string doc_dir;
   //! should we use the gui?
   bool useGUI;
   //! launch as python
index 6759567ef468b64a7b6d05bf4099ab07b69ee800..b0d5dbde2e4962d9765305e7fd6546d4021088fa 100644 (file)
@@ -239,17 +239,7 @@ void MussaWindow::setupMainMenu()
 
 void MussaWindow::setupAssistant()
 {
-#if 0 && defined(Q_WS_MAC)
-    CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
-    CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef,
-                                           kCFURLPOSIXPathStyle);
-    const char *pathPtr = CFStringGetCStringPtr(macPath,
-                                           CFStringGetSystemEncoding());
-    qDebug("Path = %s", pathPtr);
-    CFRelease(pluginRef);
-    CFRelease(macPath);
-#endif
-#if defined(QT_ASSISTANT_LIB)
+#if defined(QT_ASSISTANT_FOUND)
   QStringList manualAssistantArgs;
   manualAssistantArgs = QStringList();
   manualAssistantArgs << "-profile" << "./doc/manual/mussagl_manual.adp";
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);