Abdelrazak Younes wrote:
Hello,

As the subject says and as agreed in my latest patch. Will commit soon.

With the patch...
Index: format.C
===================================================================
--- format.C    (revision 15112)
+++ format.C    (working copy)
@@ -16,8 +16,8 @@
 #include "lyxrc.h"
 #include "debug.h"
 #include "gettext.h"
-#include "lyxsocket.h"
 
+#include "frontends/Application.h"
 #include "frontends/Alert.h" //to be removed?
 
 #include "support/filetools.h"
@@ -46,8 +46,6 @@
 namespace fs = boost::filesystem;
 namespace os = lyx::support::os;
 
-extern LyXServerSocket * lyxsocket;
-
 namespace {
 
 string const token_from("$$i");
@@ -311,7 +309,7 @@
 
        command = subst(command, token_from, quoteName(filename));
        command = subst(command, token_path, quoteName(onlyPath(filename)));
-       command = subst(command, token_socket, quoteName(lyxsocket->address()));
+       command = subst(command, token_socket, 
quoteName(theApp->socket().address()));
        lyxerr[Debug::FILES] << "Executing command: " << command << std::endl;
        buffer.message(_("Executing command: ") + lyx::from_utf8(command));
 
@@ -370,7 +368,7 @@
 
        command = subst(command, token_from, quoteName(filename));
        command = subst(command, token_path, quoteName(onlyPath(filename)));
-       command = subst(command, token_socket, quoteName(lyxsocket->address()));
+       command = subst(command, token_socket, 
quoteName(theApp->socket().address()));
        lyxerr[Debug::FILES] << "Executing command: " << command << std::endl;
        buffer.message(_("Executing command: ") + lyx::from_utf8(command));
 
Index: frontends/Application.C
===================================================================
--- frontends/Application.C     (revision 15114)
+++ frontends/Application.C     (working copy)
@@ -25,11 +25,6 @@
 
 using lyx::support::package;
 
-// FIXME: replace all occurence of lyxserver with theApp->server().
-LyXServer * lyxserver;
-// FIXME: replace all occurence of lyxsocket with theApp->socket().
-LyXServerSocket * lyxsocket;
-
 namespace lyx {
 namespace frontend {
 
@@ -87,10 +82,6 @@
        lyx_socket_.reset(new LyXServerSocket(lyxfunc_.get(), 
                lyx::support::os::internal_path(package().temp_dir() + 
"/lyxsocket")));
 
-       // FIXME: these two lines should disappear soon (Abdel 20/09/71)
-       lyxserver = lyx_server_.get();
-       lyxsocket = lyx_socket_.get();
-
        // handle the batch commands the user asked for
        if (!batch.empty()) {
                lyxfunc_->dispatch(lyxaction.lookupFunc(batch));
Index: frontends/qt4/lyx_gui.C
===================================================================
--- frontends/qt4/lyx_gui.C     (revision 15114)
+++ frontends/qt4/lyx_gui.C     (working copy)
@@ -24,8 +24,6 @@
 #include "LyXAction.h"
 #include "lyxfunc.h"
 #include "lyxrc.h"
-#include "lyxserver.h"
-#include "lyxsocket.h"
 
 
 #include "support/lstrings.h"
Index: lyx_main.C
===================================================================
--- lyx_main.C  (revision 15112)
+++ lyx_main.C  (working copy)
@@ -35,12 +35,12 @@
 #include "lyxlex.h"
 #include "lyxrc.h"
 #include "lyxtextclasslist.h"
-#include "lyxserver.h"
 #include "MenuBackend.h"
 #include "mover.h"
 #include "ToolbarBackend.h"
 
 #include "frontends/Alert.h"
+#include "frontends/Application.h"
 #include "frontends/lyx_gui.h"
 #include "frontends/LyXView.h"
 
@@ -89,8 +89,6 @@
 #endif
 
 
-extern LyXServer * lyxserver;
-
 // This is the global bufferlist object
 BufferList bufferlist;
 
@@ -661,8 +659,7 @@
        // a crash
 
        bufferlist.emergencyWriteAll();
-       if (lyxserver)
-               lyxserver->emergencyCleanup();
+       theApp->server().emergencyCleanup();
 }
 
 
Index: lyxfunc.C
===================================================================
--- lyxfunc.C   (revision 15112)
+++ lyxfunc.C   (working copy)
@@ -51,7 +51,6 @@
 #include "lyxlex.h"
 #include "lyxrc.h"
 #include "lyxrow.h"
-#include "lyxserver.h"
 #include "lyxtextclasslist.h"
 #include "lyxvc.h"
 #include "paragraph.h"
@@ -72,6 +71,7 @@
 #include "insets/insetvspace.h"
 #include "insets/insetwrap.h"
 
+#include "frontends/Application.h"
 #include "frontends/Alert.h"
 #include "frontends/Dialogs.h"
 #include "frontends/FileDialog.h"
@@ -139,7 +139,6 @@
 
 
 extern BufferList bufferlist;
-extern LyXServer * lyxserver;
 
 extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
 
@@ -1120,7 +1119,7 @@
 
                case LFUN_SERVER_NOTIFY:
                        dispatch_buffer = lyx::from_utf8(keyseq.print());
-                       lyxserver->notifyClient(lyx::to_utf8(dispatch_buffer));
+                       
theApp->server().notifyClient(lyx::to_utf8(dispatch_buffer));
                        break;
 
                case LFUN_SERVER_GOTO_FILE_ROW: {
Index: lyxserver.C
===================================================================
--- lyxserver.C (revision 15112)
+++ lyxserver.C (working copy)
@@ -39,13 +39,15 @@
 
 #include <config.h>
 
-#include "lyxserver.h"
 #include "debug.h"
 #include "funcrequest.h"
 #include "LyXAction.h"
 #include "lyxfunc.h"
+
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
+
+#include "frontends/Application.h"
 #include "frontends/lyx_gui.h"
 
 #include <boost/bind.hpp>

Reply via email to