Removed useless 'constCast's.
This commit is contained in:
parent
f173b0a535
commit
d4c386beda
@ -414,11 +414,11 @@ size_t IMAPMessage::extractImpl
|
|||||||
IMAPCommand::FETCH(
|
IMAPCommand::FETCH(
|
||||||
m_uid.empty() ? messageSet::byNumber(m_num) : messageSet::byUID(m_uid),
|
m_uid.empty() ? messageSet::byNumber(m_num) : messageSet::byUID(m_uid),
|
||||||
fetchParams
|
fetchParams
|
||||||
)->send(constCast <IMAPFolder>(folder)->m_connection);
|
)->send(folder->m_connection);
|
||||||
|
|
||||||
// Get the response
|
// Get the response
|
||||||
scoped_ptr <IMAPParser::response> resp
|
scoped_ptr <IMAPParser::response> resp
|
||||||
(constCast <IMAPFolder>(folder)->m_connection->readResponse(&literalHandler));
|
(folder->m_connection->readResponse(&literalHandler));
|
||||||
|
|
||||||
if (resp->isBad() || resp->response_done()->response_tagged()->
|
if (resp->isBad() || resp->response_done()->response_tagged()->
|
||||||
resp_cond_state()->status() != IMAPParser::resp_cond_state::OK)
|
resp_cond_state()->status() != IMAPParser::resp_cond_state::OK)
|
||||||
|
@ -52,17 +52,15 @@ IMAPMessagePartContentHandler::IMAPMessagePartContentHandler
|
|||||||
shared_ptr <contentHandler> IMAPMessagePartContentHandler::clone() const
|
shared_ptr <contentHandler> IMAPMessagePartContentHandler::clone() const
|
||||||
{
|
{
|
||||||
return make_shared <IMAPMessagePartContentHandler>
|
return make_shared <IMAPMessagePartContentHandler>
|
||||||
(constCast <IMAPMessage>(m_message.lock()),
|
(m_message.lock(), m_part.lock(), m_encoding);
|
||||||
constCast <messagePart>(m_part.lock()),
|
|
||||||
m_encoding);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IMAPMessagePartContentHandler::generate
|
void IMAPMessagePartContentHandler::generate
|
||||||
(utility::outputStream& os, const vmime::encoding& enc, const size_t maxLineLength) const
|
(utility::outputStream& os, const vmime::encoding& enc, const size_t maxLineLength) const
|
||||||
{
|
{
|
||||||
shared_ptr <IMAPMessage> msg = constCast <IMAPMessage>(m_message.lock());
|
shared_ptr <IMAPMessage> msg = m_message.lock();
|
||||||
shared_ptr <messagePart> part = constCast <messagePart>(m_part.lock());
|
shared_ptr <messagePart> part = m_part.lock();
|
||||||
|
|
||||||
// Data is already encoded
|
// Data is already encoded
|
||||||
if (isEncoded())
|
if (isEncoded())
|
||||||
@ -128,8 +126,8 @@ void IMAPMessagePartContentHandler::generate
|
|||||||
void IMAPMessagePartContentHandler::extract
|
void IMAPMessagePartContentHandler::extract
|
||||||
(utility::outputStream& os, utility::progressListener* progress) const
|
(utility::outputStream& os, utility::progressListener* progress) const
|
||||||
{
|
{
|
||||||
shared_ptr <IMAPMessage> msg = constCast <IMAPMessage>(m_message.lock());
|
shared_ptr <IMAPMessage> msg = m_message.lock();
|
||||||
shared_ptr <messagePart> part = constCast <messagePart>(m_part.lock());
|
shared_ptr <messagePart> part = m_part.lock();
|
||||||
|
|
||||||
// No decoding to perform
|
// No decoding to perform
|
||||||
if (!isEncoded())
|
if (!isEncoded())
|
||||||
@ -158,8 +156,8 @@ void IMAPMessagePartContentHandler::extract
|
|||||||
void IMAPMessagePartContentHandler::extractRaw
|
void IMAPMessagePartContentHandler::extractRaw
|
||||||
(utility::outputStream& os, utility::progressListener* progress) const
|
(utility::outputStream& os, utility::progressListener* progress) const
|
||||||
{
|
{
|
||||||
shared_ptr <IMAPMessage> msg = constCast <IMAPMessage>(m_message.lock());
|
shared_ptr <IMAPMessage> msg = m_message.lock();
|
||||||
shared_ptr <messagePart> part = constCast <messagePart>(m_part.lock());
|
shared_ptr <messagePart> part = m_part.lock();
|
||||||
|
|
||||||
msg->extractPart(part, os, progress);
|
msg->extractPart(part, os, progress);
|
||||||
}
|
}
|
||||||
|
@ -56,9 +56,9 @@ maildirFormat::context::context(const shared_ptr <maildirStore>& store)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
shared_ptr <maildirStore> maildirFormat::context::getStore() const
|
shared_ptr <maildirStore> maildirFormat::context::getStore()
|
||||||
{
|
{
|
||||||
return constCast <maildirStore>(m_store.lock());
|
return m_store.lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -72,13 +72,7 @@ maildirFormat::maildirFormat(const shared_ptr <context>& ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
shared_ptr <maildirFormat::context> maildirFormat::getContext()
|
shared_ptr <maildirFormat::context> maildirFormat::getContext() const
|
||||||
{
|
|
||||||
return m_context;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
shared_ptr <const maildirFormat::context> maildirFormat::getContext() const
|
|
||||||
{
|
{
|
||||||
return m_context;
|
return m_context;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
|
|
||||||
context(const shared_ptr <maildirStore>& store);
|
context(const shared_ptr <maildirStore>& store);
|
||||||
|
|
||||||
shared_ptr <maildirStore> getStore() const;
|
shared_ptr <maildirStore> getStore();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -162,13 +162,7 @@ protected:
|
|||||||
*
|
*
|
||||||
* @return current context
|
* @return current context
|
||||||
*/
|
*/
|
||||||
shared_ptr <context> getContext();
|
shared_ptr <context> getContext() const;
|
||||||
|
|
||||||
/** Returns the current context (const version).
|
|
||||||
*
|
|
||||||
* @return current context
|
|
||||||
*/
|
|
||||||
shared_ptr <const context> getContext() const;
|
|
||||||
|
|
||||||
/** Quick checks whether this implementation can read the Maildir
|
/** Quick checks whether this implementation can read the Maildir
|
||||||
* format in the specified directory.
|
* format in the specified directory.
|
||||||
|
@ -149,7 +149,7 @@ void POP3Message::extract
|
|||||||
throw exceptions::partial_fetch_not_supported();
|
throw exceptions::partial_fetch_not_supported();
|
||||||
|
|
||||||
// Emit the "RETR" command
|
// Emit the "RETR" command
|
||||||
shared_ptr <POP3Store> store = constCast <POP3Folder>(folder)->m_store.lock();
|
shared_ptr <POP3Store> store = folder->m_store.lock();
|
||||||
|
|
||||||
POP3Command::RETR(m_num)->send(store->getConnection());
|
POP3Command::RETR(m_num)->send(store->getConnection());
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ void defaultSASLAuthenticator::setSASLSession(const shared_ptr <SASLSession>& se
|
|||||||
|
|
||||||
shared_ptr <SASLSession> defaultSASLAuthenticator::getSASLSession() const
|
shared_ptr <SASLSession> defaultSASLAuthenticator::getSASLSession() const
|
||||||
{
|
{
|
||||||
return constCast <SASLSession>(m_saslSession.lock());
|
return m_saslSession.lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user