]> git.lyx.org Git - lyx.git/blobdiff - src/client/client.cpp
Fix bug #12561
[lyx.git] / src / client / client.cpp
index 023e73e96b44e45facfb9af06232bd0164a0287b..0a80107009020a7a8e1d6dba4392cc23d4583817 100644 (file)
@@ -12,6 +12,8 @@
 
 #include <config.h>
 
+#include "LyXRC.h"
+
 #include "support/ConsoleApplication.h"
 #include "support/debug.h"
 #include "support/FileName.h"
@@ -66,13 +68,9 @@ using namespace lyx::support;
 
 namespace lyx {
 
-// Dummy verbose support
+// Required global variables
 bool verbose = false;
-
-// Dummy LyXRC support
-struct LyXRC {
-       string icon_set;
-} lyxrc;
+LyXRC lyxrc;
 
 // Keep the linker happy on Windows
 void lyx_exit(int)
@@ -95,14 +93,6 @@ Messages const & getMessages(string const &)
 
 namespace support {
 
-string itoa(unsigned int i)
-{
-       char buf[20];
-       sprintf(buf, "%d", i);
-       return buf;
-}
-
-
 /// Returns the absolute pathnames of all lyx local sockets in
 /// file system encoding.
 /// Parts stolen from lyx::support::DirList().
@@ -350,10 +340,10 @@ void LyXDataSocket::writeln(string const & line)
        string linen(line + '\n');
        int size = linen.size();
        int written = ::write(fd_, linen.c_str(), size);
-       if (written < size) { // Allways mean end of connection.
+       if (written < size) { // Always mean end of connection.
                if ((written == -1) && (errno == EPIPE)) {
                        // The program will also receive a SIGPIPE
-                       // that must be catched
+                       // that must be caught
                        cerr << "lyxclient: connection closed while writing."
                             << endl;
                } else {
@@ -471,7 +461,7 @@ int h(vector<docstring> const &)
 
 
 docstring clientName =
-       from_ascii(itoa(::getppid()) + ">" + itoa(::getpid()));
+       from_ascii(to_string(::getppid()) + ">" + to_string(::getpid()));
 
 int n(vector<docstring> const & arg)
 {
@@ -527,7 +517,7 @@ int a(vector<docstring> const & arg)
                     << endl;
                return -1;
        }
-       // -a supercedes LYXSOCKET environment variable
+       // -a supersedes LYXSOCKET environment variable
        serverAddress = arg[0];
        return 1;
 }
@@ -726,13 +716,3 @@ int main(int argc, char * argv[])
        return app.exec();
 }
 
-
-namespace boost {
-
-void assertion_failed(char const* a, char const* b, char const* c, long d)
-{
-       lyx::lyxerr << "Assertion failed: " << a << ' ' << b << ' ' << c << ' '
-               << d << '\n';
-}
-
-} // namespace boost