projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed highlighting of buffers caused by ignored messages.
[quassel.git]
/
src
/
client
/
coreconnection.cpp
diff --git
a/src/client/coreconnection.cpp
b/src/client/coreconnection.cpp
index
8ad692e
..
717fff3
100644
(file)
--- a/
src/client/coreconnection.cpp
+++ b/
src/client/coreconnection.cpp
@@
-42,7
+42,9
@@
CoreConnection::CoreConnection(CoreAccountModel *model, QObject *parent)
_wantReconnect(false),
_progressMinimum(0),
_progressMaximum(-1),
_wantReconnect(false),
_progressMinimum(0),
_progressMaximum(-1),
- _progressValue(-1)
+ _progressValue(-1),
+ _wasReconnect(false),
+ _requestedDisconnect(false)
{
qRegisterMetaType<ConnectionState>("CoreConnection::ConnectionState");
}
{
qRegisterMetaType<ConnectionState>("CoreConnection::ConnectionState");
}
@@
-256,6
+258,7
@@
void CoreConnection::coreSocketError(QAbstractSocket::SocketError) {
void CoreConnection::coreSocketDisconnected() {
// qDebug() << Q_FUNC_INFO;
void CoreConnection::coreSocketDisconnected() {
// qDebug() << Q_FUNC_INFO;
+ _wasReconnect = !_requestedDisconnect;
resetConnection(true);
// FIXME handle disconnects gracefully
}
resetConnection(true);
// FIXME handle disconnects gracefully
}
@@
-304,6
+307,7
@@
void CoreConnection::coreHasData() {
}
void CoreConnection::disconnectFromCore() {
}
void CoreConnection::disconnectFromCore() {
+ _requestedDisconnect = true;
disconnectFromCore(QString(), false); // requested disconnect, so don't try to reconnect
}
disconnectFromCore(QString(), false); // requested disconnect, so don't try to reconnect
}
@@
-311,6
+315,8
@@
void CoreConnection::disconnectFromCore(const QString &errorString, bool wantRec
if(!wantReconnect)
_reconnectTimer.stop();
if(!wantReconnect)
_reconnectTimer.stop();
+ _wasReconnect = wantReconnect; // store if disconnect was requested
+
if(errorString.isEmpty())
emit connectionError(tr("Disconnected"));
else
if(errorString.isEmpty())
emit connectionError(tr("Disconnected"));
else
@@
-328,6
+334,7
@@
void CoreConnection::resetConnection(bool wantReconnect) {
_socket->deleteLater();
_socket = 0;
}
_socket->deleteLater();
_socket = 0;
}
+ _requestedDisconnect = false;
_blockSize = 0;
_coreMsgBuffer.clear();
_blockSize = 0;
_coreMsgBuffer.clear();