From 8d5fa6bc3b21c94fd89690d2c8eb629ac0491aae Mon Sep 17 00:00:00 2001 From: psychon Date: Fri, 18 Apr 2008 09:25:28 +0000 Subject: [PATCH] Break some way too long lines into way less long lines git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1025 726aef4b-f618-498e-8847-2d620e286838 --- DCCSock.cpp | 11 +++++++---- Utils.h | 9 ++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/DCCSock.cpp b/DCCSock.cpp index d4088fe6..a71f2746 100644 --- a/DCCSock.cpp +++ b/DCCSock.cpp @@ -69,17 +69,20 @@ void CDCCSock::Connected() { } void CDCCSock::Disconnected() { + const CString sStart = ((m_bSend) ? "DCC -> [" : "DCC <- [") + m_sRemoteNick + "][" + m_sFileName + "] - "; + DEBUG_ONLY(cout << GetSockName() << " == Disconnected()" << endl); + if (m_uBytesSoFar > m_uFileSize) { - m_pUser->PutModule(m_sModuleName, ((m_bSend) ? "DCC -> [" : "DCC <- [") + m_sRemoteNick + "][" + m_sFileName + "] - TooMuchData!"); + m_pUser->PutModule(m_sModuleName, sStart + "TooMuchData!"); } else if (m_uBytesSoFar == m_uFileSize) { if (m_bSend) { - m_pUser->PutModule(m_sModuleName, ((m_bSend) ? "DCC -> [" : "DCC <- [") + m_sRemoteNick + "][" + m_sFileName + "] - Completed! - Sent [" + m_sLocalFile + "] at [" + CString::ToKBytes(GetAvgWrite() / 1000.0) + "]"); + m_pUser->PutModule(m_sModuleName, sStart + "Completed! - Sent [" + m_sLocalFile + "] at [" + CString::ToKBytes(GetAvgWrite() / 1000.0) + "]"); } else { - m_pUser->PutModule(m_sModuleName, ((m_bSend) ? "DCC -> [" : "DCC <- [") + m_sRemoteNick + "][" + m_sFileName + "] - Completed! - Saved to [" + m_sLocalFile + "] at [" + CString::ToKBytes(GetAvgRead() / 1000.0) + "]"); + m_pUser->PutModule(m_sModuleName, sStart + "Completed! - Saved to [" + m_sLocalFile + "] at [" + CString::ToKBytes(GetAvgRead() / 1000.0) + "]"); } } else { - m_pUser->PutModule(m_sModuleName, ((m_bSend) ? "DCC -> [" : "DCC <- [") + m_sRemoteNick + "][" + m_sFileName + "] - Incomplete!"); + m_pUser->PutModule(m_sModuleName, sStart + "Incomplete!"); } } diff --git a/Utils.h b/Utils.h index 3797761f..2803c0e0 100644 --- a/Utils.h +++ b/Utils.h @@ -422,7 +422,14 @@ private: /** * @class CSafePtr * @author prozac - * @brief This class is intended to be created on the stack and hold a pointer which will be deleted upon destruction. It is useful for functions where you need an allocated pointer and have many return paths. It prevents copying to get around the exclusive ownership situation which makes std::auto_ptr invalidate the first pointer on copy. This is intended to be used in simplistic situations such as local variables. + * @brief Safe deletion of a pointer. + * + * This class is intended to be created on the stack and hold a pointer which + * will be deleted upon destruction. It is useful for functions where you need + * an allocated pointer and have many return paths. It prevents copying to get + * around the exclusive ownership situation which makes std::auto_ptr + * invalidate the first pointer on copy. This is intended to be used in + * simplistic situations such as local variables. */ template class CSafePtr : private CNoCopy {