diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-14 19:50:23 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-14 19:50:23 -0500 |
commit | 663e2f7a3d1ae0a40f45e760c3ae6998d79c1a2f (patch) | |
tree | 88d87fd5190e03dc6237d5ae5ad13df490ee1545 /lib/libtqtrla/src | |
parent | c50fa83bfd137b6b5aa7f9c1e4c310ddde75e585 (diff) | |
download | ulab-663e2f7a3d1ae0a40f45e760c3ae6998d79c1a2f.tar.gz ulab-663e2f7a3d1ae0a40f45e760c3ae6998d79c1a2f.zip |
Fix scope
Diffstat (limited to 'lib/libtqtrla/src')
-rw-r--r-- | lib/libtqtrla/src/tqtrla.cpp | 36 | ||||
-rw-r--r-- | lib/libtqtrla/src/tqtrla.h | 1 |
2 files changed, 34 insertions, 3 deletions
diff --git a/lib/libtqtrla/src/tqtrla.cpp b/lib/libtqtrla/src/tqtrla.cpp index cf26012..3fdea05 100644 --- a/lib/libtqtrla/src/tqtrla.cpp +++ b/lib/libtqtrla/src/tqtrla.cpp @@ -191,6 +191,8 @@ namespace KParts connToServerConnecting = false; disconnectFromServer(); KMessageBox::error(0, i18n("<qt>Unable to establish connection to remote server</qt>"), i18n("Connection Failed")); + close(); + return; } } else { @@ -199,12 +201,16 @@ namespace KParts m_socket->setDataTimeout(SERVER_TIMEOUT_MS); m_socket->setUsingKerberos(true); connToServerState = 1; + connToServerTimeoutTimer->stop(); + connToServerTimeoutTimer->start(SERVER_TIMEOUT_MS, TRUE); } else { connToServerState = -1; connToServerConnecting = false; disconnectFromServer(); KMessageBox::error(0, i18n("<qt>Unable to establish connection to remote server</qt>"), i18n("Connection Failed")); + close(); + return; } } break; @@ -218,16 +224,19 @@ namespace KParts connToServerConnecting = false; disconnectFromServer(); KMessageBox::error(0, i18n("<qt>Unable to establish Kerberos protocol with remote server<p>Please verify that you currently hold a valid Kerberos ticket</qt>"), i18n("Connection Failed")); + close(); + return; } else { connToServerState = 2; + connToServerTimeoutTimer->stop(); + connToServerTimeoutTimer->start(SERVER_TIMEOUT_MS, TRUE); } } break; case 2: // Connection established! // Read magic number and proto version from server - m_socket->processPendingData(); if (m_socket->canReadFrame()) { TQDataStream ds(m_socket); ds.setPrintableData(true); @@ -244,12 +253,23 @@ namespace KParts ds << m_clientLibraryName; m_socket->writeEndOfFrame(); connToServerState = 3; + connToServerTimeoutTimer->stop(); + connToServerTimeoutTimer->start(SERVER_TIMEOUT_MS, TRUE); + } + else { + if ((!connToServerTimeoutTimer->isActive()) || (m_socket->state() != TQSocket::Connected)) { + connToServerState = -1; + connToServerConnecting = false; + disconnectFromServer(); + KMessageBox::error(0, i18n("<qt>Connection with remote server terminated<p>This may indicate that the requested service is not functional</qt>"), i18n("Connection Failed")); + close(); + return; + } } break; case 3: // Read response from server - m_socket->processPendingData(); - if (m_socket->bytesAvailable() > 0) { + if (m_socket->canReadFrame()) { TQDataStream ds(m_socket); ds.setPrintableData(true); TQString response; @@ -271,6 +291,16 @@ namespace KParts return; } } + else { + if ((!connToServerTimeoutTimer->isActive()) || (m_socket->state() != TQSocket::Connected)) { + connToServerState = -1; + connToServerConnecting = false; + disconnectFromServer(); + KMessageBox::error(0, i18n("<qt>Connection with remote server terminated<p>This may indicate that the requested service is not functional</qt>"), i18n("Connection Failed")); + close(); + return; + } + } break; } diff --git a/lib/libtqtrla/src/tqtrla.h b/lib/libtqtrla/src/tqtrla.h index fcc1285..129eac9 100644 --- a/lib/libtqtrla/src/tqtrla.h +++ b/lib/libtqtrla/src/tqtrla.h @@ -76,6 +76,7 @@ namespace KParts signals: void statusMessageSet(const TQString&); void usingFixedSizeChanged(bool); + void resizeToHintRequested(); protected: KURL m_url; |