Logo Search packages:      
Sourcecode: qtemu version File versions  Download package

void RemoteView::setStatus ( RemoteView::RemoteStatus  s  )  [protected, virtual]

Set the status of the connection. Emits a statusChanged() signal. Note that the states need to be set in a certain order, see Status. setStatus() will try to do this transition automatically, so if you are in Connecting and call setStatus(Preparing), setStatus() will emit a Authenticating and then Preparing. If you transition backwards, it will emit a Disconnected before doing the transition.

Parameters:
s the new status

Definition at line 62 of file remoteview.cpp.

References m_status, and statusChanged().

{
    if (m_status == s)
        return;

    if (((1+ m_status) != s) && (s != Disconnected)) {
        // follow state transition rules

        if (s == Disconnecting) {
            if (m_status == Disconnected)
                return;
        } else {
            Q_ASSERT(((int) s) >= 0);
            if (m_status > s) {
                m_status = Disconnected;
                emit statusChanged(Disconnected);
            }
            // smooth state transition
            RemoteStatus origState = m_status;
            for (int i = origState; i < s; ++i) {
                m_status = (RemoteStatus) i;
                emit statusChanged((RemoteStatus) i);
            }
        }
    }
    m_status = s;
    emit statusChanged(m_status);
}


Generated by  Doxygen 1.6.0   Back to index