[Libreoffice-commits] .: Branch 'feature/remote' - sd/CppunitTest_sd_uimpress.mk sd/source

Michael Meeks michael at kemper.freedesktop.org
Mon Jul 9 09:29:11 PDT 2012


 sd/CppunitTest_sd_uimpress.mk         |    2 +-
 sd/source/ui/remotecontrol/Server.cxx |   15 ++++++++++++---
 sd/source/ui/remotecontrol/Server.hxx |    9 +++++----
 3 files changed, 18 insertions(+), 8 deletions(-)

New commits:
commit 38dd252ff1ba6c1f212bde1c4cabe4cb399bcc88
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Mon Jul 9 17:26:27 2012 +0100

    don't create a custom thread to corrupt our stack.
    
    Change-Id: I519d5d1ada7b7a0cc28dba1929edef8d54cec06a

diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk
index 4e45315..d7e7f15 100644
--- a/sd/CppunitTest_sd_uimpress.mk
+++ b/sd/CppunitTest_sd_uimpress.mk
@@ -36,7 +36,7 @@ $(eval $(call gb_CppunitTest_add_defs,sd_uimpress,\
     -DSD_DLLIMPLEMENTATION \
 ))
 
-$(eval $(call gb_CppunitTest_use_sdk_api,sd_uimpress,\
+$(eval $(call gb_CppunitTest_use_api,sd_uimpress,\
     offapi \
     udkapi \
 ))
diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx
index 9ebe555..00ecd2a 100644
--- a/sd/source/ui/remotecontrol/Server.cxx
+++ b/sd/source/ui/remotecontrol/Server.cxx
@@ -88,10 +88,19 @@ void Server::execute()
 
 }
 
+Server *sd::Server::spServer = NULL;
+
+void Server::setup()
+{
+  if (spServer)
+    return;
+
+  spServer = new Server();
+  spServer->launch();
+}
+
 void SdDLL::RegisterRemotes()
 {
   fprintf( stderr, "Register our remote control goodness\n" );
-  Server server;
-  server.launch();
-  // FIXME: create a thread
+  sd::Server::setup();
 }
diff --git a/sd/source/ui/remotecontrol/Server.hxx b/sd/source/ui/remotecontrol/Server.hxx
index 9aa9687..46bac2d 100644
--- a/sd/source/ui/remotecontrol/Server.hxx
+++ b/sd/source/ui/remotecontrol/Server.hxx
@@ -27,18 +27,19 @@ namespace sd
 {
 
     class Server : public salhelper::Thread
-        {
+    {
         public:
+	    static void setup();
+        private:
             Server();
             ~Server();
-        private:
+	    static Server *spServer;
             osl::AcceptorSocket mSocket;
             osl::StreamSocket mStreamSocket;
             void listenThread();
             Receiver mReceiver;
             void execute();
-        };
-
+    };
 }
 
 #endif // _SD_IMPRESSREMOTE_SERVER_HXX


More information about the Libreoffice-commits mailing list