Refactored code order to make it more readable

This commit is contained in:
Jerry (Xinyu Hou) 2015-07-10 12:59:12 -07:00
parent 9800bec857
commit a44e9832c5
2 changed files with 12 additions and 11 deletions

View File

@ -557,7 +557,11 @@ ServerProxy::setClipboard()
int r = ClipboardChunk::assemble(m_stream, dataCached, id, seq); 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())); LOG((CLOG_DEBUG "received clipboard %d size=%d", id, dataCached.size()));
// forward // forward
@ -567,10 +571,6 @@ ServerProxy::setClipboard()
LOG((CLOG_INFO "clipboard was updated")); 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 void

View File

@ -79,8 +79,13 @@ ClientProxy1_6::recvClipboard()
int r = ClipboardChunk::assemble(getStream(), dataCached, id, seq); int r = ClipboardChunk::assemble(getStream(), dataCached, id, seq);
if (r == kFinish) { if (r == kStart) {
LOG((CLOG_DEBUG "received client \"%s\" clipboard %d seqnum=%d, size=%d", getName().c_str(), id, seq, dataCached.size())); 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 // save clipboard
m_clipboard[id].m_clipboard.unmarshall(dataCached, 0); m_clipboard[id].m_clipboard.unmarshall(dataCached, 0);
m_clipboard[id].m_sequenceNumber = seq; m_clipboard[id].m_sequenceNumber = seq;
@ -92,10 +97,6 @@ ClientProxy1_6::recvClipboard()
m_events->addEvent(Event(m_events->forClipboard().clipboardChanged(), m_events->addEvent(Event(m_events->forClipboard().clipboardChanged(),
getEventTarget(), info)); getEventTarget(), info));
} }
else if (r == kStart) {
size_t size = ClipboardChunk::getExpectedSize();
LOG((CLOG_DEBUG "receiving clipboard %d size=%d", id, size));
}
return true; return true;
} }