lyx::frontend::Application * createApplication(int & argc, char * argv[])
{
- // FIXME: it would be great if we could just do:
- //return new lyx::frontend::GuiApplication(argc, argv);
-
-#if defined(Q_WS_WIN) && !defined(Q_CYGWIN_WIN)
- static lyx::frontend::GuiApplication app(argc, argv);
- return &app;
-#else
return new lyx::frontend::GuiApplication(argc, argv);
-#endif
}
if (lyx::use_gui) {
// Force adding of font path _before_ Application is initialized
lyx::support::addFontResources();
- theApp = lyx::createApplication(argc, argv);
+ application_.reset(lyx::createApplication(argc, argv));
+ theApp = application_.get();
}
else {
// FIXME: create a ConsoleApplication
theApp = 0;
}
-
+
return exec2(argc, argv);
}
height = 0;
}
// create the main window
- LyXView * view = &theApp->createView(width, height, posx, posy, maximize);
+ LyXView * view = &application_->createView(width, height, posx, posy, maximize);
ref().addLyXView(view);
// load files
// clear this list to save a few bytes of RAM
session_->clearLastOpenedFiles();
- return theApp->start(batch_command);
+ return application_->start(batch_command);
} else {
// Something went wrong above
quitLyX(false);
if (lyxrc.roman_font_name.empty())
lyxrc.roman_font_name =
- lyx::use_gui? theApp->romanFontName(): "serif";
+ lyx::use_gui? application_->romanFontName(): "serif";
if (lyxrc.sans_font_name.empty())
lyxrc.sans_font_name =
- lyx::use_gui? theApp->sansFontName(): "sans";
+ lyx::use_gui? application_->sansFontName(): "sans";
if (lyxrc.typewriter_font_name.empty())
lyxrc.typewriter_font_name =
- lyx::use_gui? theApp->typewriterFontName(): "monospace";
+ lyx::use_gui? application_->typewriterFontName(): "monospace";
//
// Read configuration files
// a crash
theBufferList().emergencyWriteAll();
- theApp->server().emergencyCleanup();
+ application_->server().emergencyCleanup();
}