-rw-r--r-- | x11/ipc/client/ocopclient.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/x11/ipc/client/ocopclient.cpp b/x11/ipc/client/ocopclient.cpp index c1def73..6085481 100644 --- a/x11/ipc/client/ocopclient.cpp +++ b/x11/ipc/client/ocopclient.cpp | |||
@@ -5,24 +5,33 @@ | |||
5 | #include <sys/socket.h> | 5 | #include <sys/socket.h> |
6 | #include <sys/types.h> | 6 | #include <sys/types.h> |
7 | #include <sys/un.h> | 7 | #include <sys/un.h> |
8 | 8 | ||
9 | 9 | ||
10 | #include <qfile.h> | 10 | #include <qfile.h> |
11 | #include <qtimer.h> | 11 | #include <qtimer.h> |
12 | 12 | ||
13 | #include "../common/ocoppacket.h" | 13 | #include "../common/ocoppacket.h" |
14 | 14 | ||
15 | #include "ocopclient.h" | 15 | #include "ocopclient.h" |
16 | 16 | ||
17 | OCOPClient* OCOPClient::m_self = 0; | ||
18 | |||
19 | OCOPClient* OCOPClient::self() { | ||
20 | if (!m_self ) { | ||
21 | m_self = new OCOPClient(); | ||
22 | } | ||
23 | return m_self; | ||
24 | } | ||
25 | |||
17 | OCOPClient::OCOPClient( const QString& path, QObject* obj ) | 26 | OCOPClient::OCOPClient( const QString& path, QObject* obj ) |
18 | : QObject( obj ) | 27 | : QObject( obj ) |
19 | { | 28 | { |
20 | m_tries = 0; | 29 | m_tries = 0; |
21 | init(QFile::encodeName(path) ); | 30 | init(QFile::encodeName(path) ); |
22 | } | 31 | } |
23 | OCOPClient::~OCOPClient() { | 32 | OCOPClient::~OCOPClient() { |
24 | delete m_notify; | 33 | delete m_notify; |
25 | close( m_socket ); | 34 | close( m_socket ); |
26 | } | 35 | } |
27 | void OCOPClient::init() { | 36 | void OCOPClient::init() { |
28 | // failed start ther server NOW!!! | 37 | // failed start ther server NOW!!! |