]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_main.C
Implement os::current_root for native Win32 builds.
[lyx.git] / src / lyx_main.C
index c3c1edf9338a5c6343908c42a70ff400ea7dc2ea..f76a5f4531f8ce9e682899df10ea3a6c6f5c0ac7 100644 (file)
 #include "lyxtextclasslist.h"
 #include "lyxserver.h"
 #include "MenuBackend.h"
+#include "mover.h"
 #include "ToolbarBackend.h"
 
+#include "mathed/math_inset.h"
+
 #include "frontends/Alert.h"
 #include "frontends/lyx_gui.h"
 #include "frontends/LyXView.h"
@@ -62,7 +65,6 @@ using lyx::support::createLyXTmpDir;
 using lyx::support::FileInfo;
 using lyx::support::FileSearch;
 using lyx::support::GetEnv;
-using lyx::support::GetEnvPath;
 using lyx::support::i18nLibFileSearch;
 using lyx::support::LibFileSearch;
 using lyx::support::Path;
@@ -71,6 +73,9 @@ using lyx::support::setLyxPaths;
 using lyx::support::system_lyxdir;
 using lyx::support::user_lyxdir;
 
+using lyx::support::os::getTmpDir;
+using lyx::support::os::setTmpDir;
+
 namespace os = lyx::support::os;
 
 using std::endl;
@@ -160,7 +165,7 @@ void LyX::addLyXView(boost::shared_ptr<LyXView> const & lyxview)
 }
 
 
-Buffer const * const LyX::updateInset(InsetOld const * inset) const
+Buffer const * const LyX::updateInset(InsetBase const * inset) const
 {
        if (!inset)
                return 0;
@@ -204,6 +209,8 @@ void LyX::priv_exec(int & argc, char * argv[])
        if (want_gui)
                lyx_gui::parse_lyxrc();
 
+       initMath();
+
        vector<string> files;
 
        for (int argi = argc - 1; argi >= 1; --argi)
@@ -368,6 +375,7 @@ void LyX::init(bool gui)
        system_lyxrc = lyxrc;
        system_formats = formats;
        system_converters = converters;
+       system_movers = movers;
        system_lcolor = lcolor;
 
        string prefsfile = "preferences";
@@ -397,8 +405,8 @@ void LyX::init(bool gui)
        if (lyxerr.debugging(Debug::LYXRC))
                lyxrc.print();
 
-       os::setTmpDir(createLyXTmpDir(lyxrc.tempdir_path));
-       if (os::getTmpDir().empty()) {
+       setTmpDir(createLyXTmpDir(lyxrc.tempdir_path));
+       if (getTmpDir().empty()) {
                Alert::error(_("Could not create temporary directory"),
                             bformat(_("Could not create a temporary directory in\n"
                                       "%1$s. Make sure that this\n"
@@ -413,7 +421,7 @@ void LyX::init(bool gui)
        }
 
        if (lyxerr.debugging(Debug::INIT)) {
-               lyxerr << "LyX tmp dir: `" << os::getTmpDir() << '\'' << endl;
+               lyxerr << "LyX tmp dir: `" << getTmpDir() << '\'' << endl;
        }
 
        lyxerr[Debug::INIT] << "Reading lastfiles `"
@@ -545,7 +553,7 @@ void LyX::queryUserLyXDir(bool explicit_userdir)
 
        if (!createDirectory(user_lyxdir(), 0755)) {
                // Failed, let's use $HOME instead.
-               user_lyxdir(GetEnvPath("HOME"));
+               user_lyxdir(os::homepath());
                lyxerr << bformat(_("Failed. Will use %1$s instead."),
                        user_lyxdir()) << endl;
                return;