]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/lyx_gui.C
load files from lyx_main.C instead of lyx_gui.C, do not add session-restored files...
[features.git] / src / frontends / qt4 / lyx_gui.C
index cdf6e9a292849c022067800e06fe823965420ad4..9f5aded103c73b0ee6a8b22c4b4d3ea2e0b264ac 100644 (file)
@@ -194,8 +194,7 @@ void parse_lyxrc()
 {}
 
 
-int start(string const & batch, vector<string> const & files,
-          unsigned int width, unsigned int height, int posx, int posy,
+LyXView * create_view(unsigned int width, unsigned int height, int posx, int posy,
           bool maximize)
 {
        // this can't be done before because it needs the Languages object
@@ -233,18 +232,21 @@ int start(string const & batch, vector<string> const & files,
 
        view.show();
 
+       return &view;
+}
+
+
+int start(LyXView * view, string const & batch)
+{
        // FIXME: some code below needs moving
 
-       lyxserver = new LyXServer(&view.getLyXFunc(), lyxrc.lyxpipes);
-       lyxsocket = new LyXServerSocket(&view.getLyXFunc(),
+       lyxserver = new LyXServer(&view->getLyXFunc(), lyxrc.lyxpipes);
+       lyxsocket = new LyXServerSocket(&view->getLyXFunc(),
                          os::internal_path(package().temp_dir() + "/lyxsocket"));
 
-       for_each(files.begin(), files.end(),
-                bind(&LyXView::loadLyXFile, &view, _1, true));
-
        // handle the batch commands the user asked for
        if (!batch.empty()) {
-               view.getLyXFunc().dispatch(lyxaction.lookupFunc(batch));
+               view->getLyXFunc().dispatch(lyxaction.lookupFunc(batch));
        }
 
        int const status = qApp->exec();