From a44e9832c5deea04c4596e3909661dc5827973e6 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 10 Jul 2015 12:59:12 -0700 Subject: [PATCH] Refactored code order to make it more readable --- src/lib/client/ServerProxy.cpp | 10 +++++----- src/lib/server/ClientProxy1_6.cpp | 13 +++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/lib/client/ServerProxy.cpp b/src/lib/client/ServerProxy.cpp index ac50815b..9c2b9c75 100644 --- a/src/lib/client/ServerProxy.cpp +++ b/src/lib/client/ServerProxy.cpp @@ -557,7 +557,11 @@ ServerProxy::setClipboard() int r = ClipboardChunk::assemble(m_stream, dataCached, id, seq); - if (r == kFinish) { + if (r == kStart) { + size_t size = ClipboardChunk::getExpectedSize(); + LOG((CLOG_DEBUG "receiving clipboard %d size=%d", id, size)); + } + else if (r == kFinish) { LOG((CLOG_DEBUG "received clipboard %d size=%d", id, dataCached.size())); // forward @@ -567,10 +571,6 @@ ServerProxy::setClipboard() LOG((CLOG_INFO "clipboard was updated")); } - else if (r == kStart) { - size_t size = ClipboardChunk::getExpectedSize(); - LOG((CLOG_DEBUG "receiving clipboard %d size=%d", id, size)); - } } void diff --git a/src/lib/server/ClientProxy1_6.cpp b/src/lib/server/ClientProxy1_6.cpp index 60d4f0c0..bdd0f23f 100644 --- a/src/lib/server/ClientProxy1_6.cpp +++ b/src/lib/server/ClientProxy1_6.cpp @@ -79,8 +79,13 @@ ClientProxy1_6::recvClipboard() int r = ClipboardChunk::assemble(getStream(), dataCached, id, seq); - if (r == kFinish) { - LOG((CLOG_DEBUG "received client \"%s\" clipboard %d seqnum=%d, size=%d", getName().c_str(), id, seq, dataCached.size())); + if (r == kStart) { + size_t size = ClipboardChunk::getExpectedSize(); + LOG((CLOG_DEBUG "receiving clipboard %d size=%d", id, size)); + } + else if (r == kFinish) { + LOG((CLOG_DEBUG "received client \"%s\" clipboard %d seqnum=%d, size=%d", + getName().c_str(), id, seq, dataCached.size())); // save clipboard m_clipboard[id].m_clipboard.unmarshall(dataCached, 0); m_clipboard[id].m_sequenceNumber = seq; @@ -92,10 +97,6 @@ ClientProxy1_6::recvClipboard() m_events->addEvent(Event(m_events->forClipboard().clipboardChanged(), getEventTarget(), info)); } - else if (r == kStart) { - size_t size = ClipboardChunk::getExpectedSize(); - LOG((CLOG_DEBUG "receiving clipboard %d size=%d", id, size)); - } return true; }