]> git.lyx.org Git - lyx.git/blobdiff - src/support/Package.cpp
InsetArgument: Set ResetsFontEdit to false
[lyx.git] / src / support / Package.cpp
index a158b49d3ae73d7167e672d68ea60ebfd91d6bd5..845553f4b8e09aef2a75acfafc3a490a92517aa9 100644 (file)
@@ -67,7 +67,7 @@ void init_package(string const & command_line_arg0,
 
 Package const & package()
 {
-       LASSERT(initialised_, /**/);
+       LAPPERR(initialised_);
        return package_;
 }
 
@@ -125,7 +125,7 @@ Package::Package(string const & command_line_arg0,
                system_support_dir_ =
                        get_system_support_dir(abs_binary,
                                               command_line_system_support_dir);
-    }
+       }
 
        // Find the LyX executable
        lyx_binary_ = findLyxBinary(abs_binary);
@@ -141,7 +141,7 @@ Package::Package(string const & command_line_arg0,
        FileName const configure_script(addName(system_support().absFileName(), "configure.py"));
        configure_command_ = os::python() + ' ' +
                        quoteName(configure_script.toFilesystemEncoding(), quote_python) +
-                       with_version_suffix();
+                       with_version_suffix() + " --binary-dir=" + binary_dir().absFileName();
 
        LYXERR(Debug::INIT, "<package>\n"
                << "\tbinary_dir " << binary_dir().absFileName() << '\n'
@@ -348,7 +348,14 @@ bool lyxBinaryPath(FileName & lyx_binary, string const & search_dir, string cons
 FileName findLyxBinary(FileName const & abs_binary)
 {
     string ext;
-    if (!abs_binary.extension().empty()) {
+    string checkname = abs_binary.toFilesystemEncoding();
+    int check_len = checkname.length();
+    int prgsuffixlen = string(PROGRAM_SUFFIX).length();
+    if ((prgsuffixlen > 0) && (check_len > prgsuffixlen) &&
+       (checkname.substr(check_len-prgsuffixlen) == string(PROGRAM_SUFFIX))) {
+       ext = "";
+    }
+    else if (!abs_binary.extension().empty()) {
         ext = "." + abs_binary.extension();
     }
     
@@ -374,6 +381,9 @@ FileName const get_document_dir(FileName const & home_dir)
        (void)home_dir; // Silence warning about unused variable.
        os::GetFolderPath win32_folder_path;
        return FileName(win32_folder_path(os::GetFolderPath::PERSONAL));
+#elif defined (USE_MACOSX_PACKAGING) && (QT_VERSION >= 0x050000)
+       (void)home_dir; // Silence warning about unused variable.
+       return FileName(fromqstr(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
 #elif defined (USE_MACOSX_PACKAGING)
        (void)home_dir; // Silence warning about unused variable.
        return FileName(fromqstr(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
@@ -640,6 +650,10 @@ FileName const get_default_user_support_dir(FileName const & home_dir)
        os::GetFolderPath win32_folder_path;
        return FileName(addPath(win32_folder_path(os::GetFolderPath::APPDATA), PACKAGE));
 
+#elif defined (USE_MACOSX_PACKAGING) && (QT_VERSION >= 0x050000)
+       (void)home_dir; // Silence warning about unused variable.
+       return FileName(addPath(fromqstr(QStandardPaths::writableLocation(QStandardPaths::DataLocation)), PACKAGE));
+
 #elif defined (USE_MACOSX_PACKAGING)
        (void)home_dir; // Silence warning about unused variable.
        return FileName(addPath(fromqstr(QDesktopServices::storageLocation(QDesktopServices::DataLocation)), PACKAGE));