Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
31c8b444
Commit
31c8b444
authored
Aug 27, 2010
by
Lasse Holmstedt
Browse files
QML Debugger: Show error messages when connection is lost
Related to Qt commit bd521ed56f8e4be7117dc3534c6fded68f7a70c5
parent
1f1dcfde
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/qml/qmladapter.cpp
View file @
31c8b444
...
...
@@ -99,7 +99,7 @@ bool QmlAdapter::connectToViewer()
connect
(
m_conn
,
SIGNAL
(
stateChanged
(
QAbstractSocket
::
SocketState
)),
SLOT
(
connectionStateChanged
()));
connect
(
m_conn
,
SIGNAL
(
error
(
QAbstractSocket
::
SocketError
)),
SLOT
(
connectionErrorOccurred
()));
SLOT
(
connectionErrorOccurred
(
QAbstractSocket
::
SocketError
)));
QString
address
=
m_engine
.
data
()
->
startParameters
().
qmlServerAddress
;
QString
port
=
QString
::
number
(
m_engine
.
data
()
->
startParameters
().
qmlServerPort
);
...
...
@@ -114,14 +114,14 @@ bool QmlAdapter::connectToViewer()
return
true
;
}
void
QmlAdapter
::
connectionErrorOccurred
()
void
QmlAdapter
::
connectionErrorOccurred
(
QAbstractSocket
::
SocketError
socketError
)
{
showConnectionErrorMessage
(
tr
(
"Error: (%1) %2"
,
"%1=error code, %2=error message"
)
.
arg
(
m_conn
->
error
()).
arg
(
m_conn
->
errorString
()));
// this is only an error if we are already connected and something goes wrong.
if
(
isConnected
())
emit
connectionError
();
emit
connectionError
(
socketError
);
}
void
QmlAdapter
::
connectionStateChanged
()
...
...
src/plugins/debugger/qml/qmladapter.h
View file @
31c8b444
...
...
@@ -67,10 +67,10 @@ signals:
void
connected
();
void
disconnected
();
void
connectionStartupFailed
();
void
connectionError
();
void
connectionError
(
QAbstractSocket
::
SocketError
socketError
);
private
slots
:
void
connectionErrorOccurred
();
void
connectionErrorOccurred
(
QAbstractSocket
::
SocketError
socketError
);
void
connectionStateChanged
();
void
pollInferior
();
...
...
src/plugins/debugger/qml/qmlengine.cpp
View file @
31c8b444
...
...
@@ -166,9 +166,10 @@ void QmlEngine::connectionStartupFailed()
notifyEngineRunFailed
();
}
void
QmlEngine
::
connectionError
()
void
QmlEngine
::
connectionError
(
QAbstractSocket
::
SocketError
socketError
)
{
// do nothing for now - only exit the debugger when inferior exits.
if
(
socketError
==
QAbstractSocket
::
RemoteHostClosedError
)
plugin
()
->
showMessage
(
tr
(
"QML Debugger: Remote host closed connection."
),
StatusBar
);
}
void
QmlEngine
::
runEngine
()
...
...
@@ -251,13 +252,15 @@ void QmlEngine::shutdownEngine()
shutdownEngineAsSlave
();
notifyEngineShutdownOk
();
plugin
()
->
showMessage
(
QString
(),
StatusBar
);
}
void
QmlEngine
::
setupEngine
()
{
m_adapter
->
setMaxConnectionAttempts
(
MaxConnectionAttempts
);
m_adapter
->
setConnectionAttemptInterval
(
ConnectionAttemptDefaultInterval
);
connect
(
m_adapter
,
SIGNAL
(
connectionError
()),
SLOT
(
connectionError
()));
connect
(
m_adapter
,
SIGNAL
(
connectionError
(
QAbstractSocket
::
SocketError
)),
SLOT
(
connectionError
(
QAbstractSocket
::
SocketError
)));
connect
(
m_adapter
,
SIGNAL
(
connected
()),
SLOT
(
connectionEstablished
()));
connect
(
m_adapter
,
SIGNAL
(
connectionStartupFailed
()),
SLOT
(
connectionStartupFailed
()));
...
...
src/plugins/debugger/qml/qmlengine.h
View file @
31c8b444
...
...
@@ -122,7 +122,7 @@ signals:
private
slots
:
void
connectionEstablished
();
void
connectionStartupFailed
();
void
connectionError
();
void
connectionError
(
QAbstractSocket
::
SocketError
error
);
void
slotMessage
(
QString
,
bool
);
void
slotAddToOutputWindow
(
QString
,
bool
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment