From: APTX Date: Mon, 11 Oct 2010 00:32:01 +0000 (+0200) Subject: Make RawCommand more useful by allowing it to be sent without a session. X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=68bf28a3c3f55858b6f76415beb7be6524c6656a;p=anidbudpclient.git Make RawCommand more useful by allowing it to be sent without a session. --- diff --git a/rawcommand.cpp b/rawcommand.cpp index 50f7660..8cce132 100644 --- a/rawcommand.cpp +++ b/rawcommand.cpp @@ -2,9 +2,20 @@ namespace AniDBUdpClient { -RawCommand::RawCommand(const QString &command) : AbstractCommand() +RawCommand::RawCommand(const QString &command, bool requireAuthentication) : AbstractCommand() { m_command = command; + m_requiresSession = requireAuthentication; +} + +void RawCommand::setRequiresSession(bool requiresSession) +{ + m_requiresSession = requiresSession; +} + +bool RawCommand::requiresSession() const +{ + return m_requiresSession; } Command RawCommand::rawCommand() const diff --git a/rawcommand.h b/rawcommand.h index 0795cc5..5b088be 100644 --- a/rawcommand.h +++ b/rawcommand.h @@ -5,18 +5,22 @@ namespace AniDBUdpClient { -class RawReply; +class ANIDBUDPCLIENTSHARED_EXPORT RawReply; class ANIDBUDPCLIENTSHARED_EXPORT RawCommand : public AbstractCommand { public: typedef RawReply ReplyType; - RawCommand(const QString &command); + RawCommand(const QString &command, bool requiresSession = true); + void setRequiresSession(bool requiresSession); + + bool requiresSession() const; Command rawCommand() const; private: QString m_command; + bool m_requiresSession; }; class ANIDBUDPCLIENTSHARED_EXPORT RawReply : public AbstractReply