Changeset View
Changeset View
Standalone View
Standalone View
debugsession.cpp
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | |||||
68 | 68 | | |||
69 | bool DebugSession::listenForConnection(QString& error) | 69 | bool DebugSession::listenForConnection(QString& error) | ||
70 | { | 70 | { | ||
71 | Q_ASSERT(!m_server); | 71 | Q_ASSERT(!m_server); | ||
72 | m_server = new QTcpServer(this); | 72 | m_server = new QTcpServer(this); | ||
73 | qDebug(); | 73 | qDebug(); | ||
74 | int remotePortSetting = m_launchConfiguration->config().readEntry("RemotePort", 9000); | 74 | int remotePortSetting = m_launchConfiguration->config().readEntry("RemotePort", 9000); | ||
75 | if (m_server->listen(QHostAddress::Any, remotePortSetting)) { | 75 | if (m_server->listen(QHostAddress::Any, remotePortSetting)) { | ||
76 | connect(m_server, SIGNAL(newConnection()), this, SLOT(incomingConnection())); | 76 | connect(m_server, &QTcpServer::newConnection, this, &DebugSession::incomingConnection); | ||
77 | } else { | 77 | } else { | ||
78 | error = i18n("Opening port %1 failed: %2.", remotePortSetting, m_server->errorString()); | 78 | error = i18n("Opening port %1 failed: %2.", remotePortSetting, m_server->errorString()); | ||
79 | qWarning() << "Error" << m_server->errorString(); | 79 | qWarning() << "Error" << m_server->errorString(); | ||
80 | delete m_server; | 80 | delete m_server; | ||
81 | m_server = nullptr; | 81 | m_server = nullptr; | ||
82 | return false; | 82 | return false; | ||
83 | } | 83 | } | ||
84 | return m_server->isListening(); | 84 | return m_server->isListening(); | ||
Show All 15 Lines | 97 | { | |||
100 | 100 | | |||
101 | if (m_connection) { | 101 | if (m_connection) { | ||
102 | m_connection->disconnect(); | 102 | m_connection->disconnect(); | ||
103 | m_connection->deleteLater(); | 103 | m_connection->deleteLater(); | ||
104 | m_connection = nullptr; | 104 | m_connection = nullptr; | ||
105 | } | 105 | } | ||
106 | 106 | | |||
107 | m_connection = new Connection(client, this); | 107 | m_connection = new Connection(client, this); | ||
108 | connect(m_connection, SIGNAL(output(QString)), SIGNAL(output(QString))); | 108 | connect(m_connection, &Connection::output, this, &DebugSession::output); | ||
109 | connect(m_connection, SIGNAL(outputLine(QString)), SIGNAL(outputLine(QString))); | 109 | connect(m_connection, &Connection::outputLine, this, &DebugSession::outputLine); | ||
110 | connect(m_connection, SIGNAL(stateChanged(KDevelop::IDebugSession::DebuggerState)), SIGNAL(stateChanged(KDevelop::IDebugSession::DebuggerState))); | 110 | connect(m_connection, &Connection::stateChanged, this, &DebugSession::stateChanged); | ||
111 | connect(m_connection, SIGNAL(stateChanged(KDevelop::IDebugSession::DebuggerState)), SLOT(_stateChanged(KDevelop::IDebugSession::DebuggerState))); | 111 | connect(m_connection, &Connection::stateChanged, this, &DebugSession::_stateChanged); | ||
112 | connect(m_connection, SIGNAL(currentPositionChanged(QUrl,int)), SLOT(currentPositionChanged(QUrl,int))); | 112 | connect(m_connection, &Connection::currentPositionChanged,this, &DebugSession::currentPositionChanged); | ||
113 | connect(m_connection, SIGNAL(closed()), SLOT(connectionClosed())); | 113 | connect(m_connection, &Connection::closed, this, &DebugSession::connectionClosed); | ||
114 | 114 | | |||
115 | if (!m_acceptMultipleConnections) { | 115 | if (!m_acceptMultipleConnections) { | ||
116 | closeServer(); | 116 | closeServer(); | ||
117 | } | 117 | } | ||
118 | } | 118 | } | ||
119 | 119 | | |||
120 | void DebugSession::connectionClosed() | 120 | void DebugSession::connectionClosed() | ||
121 | { | 121 | { | ||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |