]> Some of my projects - anidbudpclient.git/commitdiff
Make RawCommand more useful by allowing it to be sent without a session.
authorAPTX <marek321@gmail.com>
Mon, 11 Oct 2010 00:32:01 +0000 (02:32 +0200)
committerAPTX <marek321@gmail.com>
Mon, 11 Oct 2010 00:32:01 +0000 (02:32 +0200)
rawcommand.cpp
rawcommand.h

index 50f7660fb6414ec4b868fad4f08ad7be13b92760..8cce13238cbde0267e25b3a57737680a20849469 100644 (file)
@@ -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
index 0795cc56030b5e6e9958b3c76752a7d1ea53116f..5b088be3729f17c761ceba3496094963c1340d06 100644 (file)
@@ -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