#include "encoding.h"
#include "converter.h"
#include "language.h"
+#include "support/os.h"
using std::endl;
// Initialization of LyX (reads lyxrc and more)
lyxerr[Debug::INIT] << "Initializing LyX::init..." << endl;
- init(argc, argv, gui);
+ init(gui);
lyxerr[Debug::INIT] << "Initializing LyX::init...done" << endl;
lyxGUI->init();
extern "C" void error_handler(int err_sig);
-void LyX::init(int */*argc*/, char **argv, bool gui)
+void LyX::init(bool gui)
{
// Install the signal handlers
signal(SIGHUP, error_handler);
//
string fullbinpath;
- string binpath = subst(argv[0], '\\', '/');
- string binname = OnlyFilename(argv[0]);
- // Sorry for system specific code. (SMiyata)
- if (suffixIs(binname, ".exe"))
- binname.erase(binname.length()-4, string::npos);
-
- binpath = ExpandPath(binpath); // This expands ./ and ~/
-
- if (!AbsolutePath(binpath)) {
- string binsearchpath = GetEnvPath("PATH");
- // This will make "src/lyx" work always :-)
- binsearchpath += ";.";
- binpath = FileOpenSearch(binsearchpath, argv[0]);
- }
-
+ string binpath = os::binpath();
+ string binname = os::binname();
fullbinpath = binpath;
- binpath = MakeAbsPath(OnlyPath(binpath));
-
- // In case we are running in place and compiled with shared libraries
- if (suffixIs(binpath, "/.libs/"))
- binpath.erase(binpath.length()-6, string::npos);
if (binpath.empty()) {
lyxerr << _("Warning: could not determine path of binary.")
}
// Create temp directory
- system_tempdir = CreateLyXTmpDir(lyxrc.tempdir_path);
+ os::setTmpDir(CreateLyXTmpDir(lyxrc.tempdir_path));
+ system_tempdir = os::getTmpDir();
if (lyxerr.debugging(Debug::INIT)) {
lyxerr << "LyX tmp dir: `" << system_tempdir << '\'' << endl;
}
// e.g. Num Lock set
kbmap->bind("KP_0", LFUN_SELFINSERT);
kbmap->bind("KP_Decimal", LFUN_SELFINSERT);
- kbmap->bind("KP_Enter", LFUN_SELFINSERT);
+ kbmap->bind("KP_Enter", LFUN_BREAKPARAGRAPH);
kbmap->bind("KP_1", LFUN_SELFINSERT);
kbmap->bind("KP_2", LFUN_SELFINSERT);
kbmap->bind("KP_3", LFUN_SELFINSERT);