File tree Expand file tree Collapse file tree 4 files changed +17
-14
lines changed Expand file tree Collapse file tree 4 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ QgsContextHelp::QgsContextHelp(int contextId)
52
52
#ifdef QGSCONTEXTHELP_REUSE
53
53
// Create socket to communicate with process
54
54
mSocket = new QTcpSocket (this );
55
- connect (mProcess , SIGNAL (readyReadStandardoutput ()), SLOT (readPort ()));
55
+ connect (mProcess , SIGNAL (readyReadStandardOutput ()), SLOT (readPort ()));
56
56
#else
57
57
// Placeholder for new process if terminating and restarting
58
58
mNextProcess = NULL ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ int main( int argc, char ** argv )
34
34
{
35
35
context = argv[1 ];
36
36
}
37
- #ifdef Q_OS_MACX
37
+ #ifdef Q_WS_MAC
38
38
// If we're on Mac, we have the resource library way above us...
39
39
a.setPkgDataPath (QgsApplication::prefixPath ()+" /../../../../share/qgis" );
40
40
#endif
@@ -78,7 +78,7 @@ int main( int argc, char ** argv )
78
78
// an additional viewer if one is already running.
79
79
QgsHelpContextServer *helpServer = new QgsHelpContextServer ();
80
80
// Make port number available to client
81
- std::cout << helpServer->port () << std::endl;
81
+ std::cout << helpServer->serverPort () << std::endl;
82
82
// Pass context request from socket to viewer widget
83
83
QObject::connect (helpServer, SIGNAL (setContext (const QString&)),
84
84
&w, SLOT (setContext (const QString&)));
Original file line number Diff line number Diff line change 22
22
// See qt/tools/assistant/ main.cpp and lib/qassistantclient.cpp (Qt 3.3.4).
23
23
24
24
QgsHelpContextServer::QgsHelpContextServer (QObject *parent) :
25
- Q3ServerSocket( 0x7f01 , 0 , parent)
25
+ QTcpServer( parent)
26
26
{
27
- // Superclass listens for localhost connection
27
+ listen (QHostAddress::LocalHost, 0 );
28
28
}
29
29
30
30
QgsHelpContextServer::~QgsHelpContextServer ()
31
31
{
32
32
// Socket is automatically deleted here because it is a QQbject child
33
33
}
34
34
35
- void QgsHelpContextServer::newConnection (int socket)
35
+ void QgsHelpContextServer::incomingConnection (int socket)
36
36
{
37
37
// Create socket in response to new connection
38
38
QgsHelpContextSocket *helpSocket = new QgsHelpContextSocket (socket, this );
39
39
// Pass context from socket upwards
40
40
connect (helpSocket, SIGNAL (setContext (const QString&)),
41
41
SIGNAL (setContext (const QString&)));
42
+ emit newConnection ();
42
43
}
43
44
44
45
QgsHelpContextSocket::QgsHelpContextSocket (int socket, QObject *parent) :
45
- Q3Socket (parent, 0 )
46
+ QTcpSocket (parent)
46
47
{
47
48
connect (this , SIGNAL (readyRead ()), SLOT (readClient ()));
48
- setSocket (socket);
49
+ setSocketDescriptor (socket);
49
50
}
50
51
51
52
QgsHelpContextSocket::~QgsHelpContextSocket ()
Original file line number Diff line number Diff line change 18
18
/* $Id$ */
19
19
#ifndef QGSHELPSERVER_H
20
20
#define QGSHELPSERVER_H
21
- #include < q3serversocket.h >
22
- #include < q3socket.h >
21
+ #include < QTcpServer >
22
+ #include < QTcpSocket >
23
23
24
24
/* !
25
25
* \class QgsHelpContextServer
26
26
* \brief Listens for localhost connection and creates socket.
27
27
*/
28
- class QgsHelpContextServer : public Q3ServerSocket
28
+ class QgsHelpContextServer : public QTcpServer
29
29
{
30
30
Q_OBJECT
31
31
public:
32
- QgsHelpContextServer (QObject* parent = 0 );
32
+ QgsHelpContextServer (QObject * parent = 0 );
33
33
~QgsHelpContextServer ();
34
- virtual void newConnection (int socket);
34
+
35
+ public slots:
36
+ void incomingConnection (int socket);
35
37
36
38
signals:
37
39
void setContext (const QString&);
@@ -41,7 +43,7 @@ class QgsHelpContextServer : public Q3ServerSocket
41
43
* \class QgsHelpContextSocket
42
44
* \brief Receives and passes context numbers to viewer.
43
45
*/
44
- class QgsHelpContextSocket : public Q3Socket
46
+ class QgsHelpContextSocket : public QTcpSocket
45
47
{
46
48
Q_OBJECT
47
49
public:
You can’t perform that action at this time.
0 commit comments