Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Split Command into more abstract Command and concrete SocketCommand

  • Loading branch information...
commit 95732ad7964c2b5c5f142508c1c474834e181a02 1 parent d9b1898
@jferris jferris authored
Showing with 162 additions and 140 deletions.
  1. +1 −1  src/Authenticate.cpp
  2. +2 −2 src/Authenticate.h
  3. +2 −2 src/Body.h
  4. +1 −1  src/ClearCookies.cpp
  5. +2 −2 src/ClearCookies.h
  6. +2 −21 src/Command.cpp
  7. +2 −16 src/Command.h
  8. +2 −4 src/CommandFactory.cpp
  9. +1 −1  src/CommandParser.cpp
  10. +1 −1  src/Connection.cpp
  11. +1 −1  src/ConsoleMessages.cpp
  12. +2 −2 src/ConsoleMessages.h
  13. +1 −1  src/CurrentUrl.cpp
  14. +2 −2 src/CurrentUrl.h
  15. +1 −1  src/EnableLogging.cpp
  16. +2 −2 src/EnableLogging.h
  17. +1 −1  src/Evaluate.cpp
  18. +2 −2 src/Evaluate.h
  19. +1 −1  src/Execute.cpp
  20. +2 −2 src/Execute.h
  21. +2 −2 src/Find.cpp
  22. +2 −2 src/Find.h
  23. +2 −2 src/FrameFocus.cpp
  24. +2 −2 src/FrameFocus.h
  25. +1 −1  src/GetCookies.cpp
  26. +2 −2 src/GetCookies.h
  27. +1 −1  src/GetWindowHandle.cpp
  28. +2 −2 src/GetWindowHandle.h
  29. +1 −1  src/GetWindowHandles.cpp
  30. +2 −2 src/GetWindowHandles.h
  31. +1 −1  src/Header.cpp
  32. +2 −2 src/Header.h
  33. +1 −1  src/Headers.cpp
  34. +2 −2 src/Headers.h
  35. +1 −1  src/IgnoreSslErrors.cpp
  36. +2 −2 src/IgnoreSslErrors.h
  37. +1 −1  src/Node.cpp
  38. +2 −2 src/Node.h
  39. +4 −2 src/NullCommand.cpp
  40. +4 −1 src/NullCommand.h
  41. +1 −1  src/PageLoadingCommand.cpp
  42. +1 −1  src/Render.cpp
  43. +2 −2 src/Render.h
  44. +1 −1  src/RequestedUrl.cpp
  45. +2 −2 src/RequestedUrl.h
  46. +1 −1  src/Reset.cpp
  47. +2 −2 src/Reset.h
  48. +1 −1  src/ResizeWindow.cpp
  49. +2 −2 src/ResizeWindow.h
  50. +1 −1  src/SetCookie.cpp
  51. +2 −2 src/SetCookie.h
  52. +1 −1  src/SetProxy.cpp
  53. +2 −2 src/SetProxy.h
  54. +1 −1  src/SetSkipImageLoading.cpp
  55. +2 −2 src/SetSkipImageLoading.h
  56. +21 −0 src/SocketCommand.cpp
  57. +29 −0 src/SocketCommand.h
  58. +1 −1  src/Source.cpp
  59. +2 −2 src/Source.h
  60. +1 −1  src/Status.cpp
  61. +2 −2 src/Status.h
  62. +1 −1  src/Url.cpp
  63. +2 −2 src/Url.h
  64. +2 −2 src/Visit.cpp
  65. +2 −2 src/Visit.h
  66. +2 −2 src/WindowFocus.cpp
  67. +2 −2 src/WindowFocus.h
  68. +1 −1  src/body.cpp
  69. +2 −0  src/webkit_server.pro
  70. +1 −1  templates/Command.cpp
  71. +1 −1  templates/Command.h
View
2  src/Authenticate.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "NetworkAccessManager.h"
-Authenticate::Authenticate(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Authenticate::Authenticate(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Authenticate::start() {
View
4 src/Authenticate.h
@@ -1,8 +1,8 @@
-#include "Command.h"
+#include "SocketCommand.h"
class WebPage;
-class Authenticate : public Command {
+class Authenticate : public SocketCommand {
Q_OBJECT
public:
View
4 src/Body.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class Body : public Command {
+class Body : public SocketCommand {
Q_OBJECT
public:
View
2  src/ClearCookies.cpp
@@ -4,7 +4,7 @@
#include "NetworkCookieJar.h"
#include <QNetworkCookie>
-ClearCookies::ClearCookies(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {}
+ClearCookies::ClearCookies(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {}
void ClearCookies::start()
{
View
4 src/ClearCookies.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class ClearCookies : public Command {
+class ClearCookies : public SocketCommand {
Q_OBJECT;
public:
View
23 src/Command.cpp
@@ -1,27 +1,8 @@
-#include "Command.h"
-#include "WebPage.h"
-#include "WebPageManager.h"
+#include "SocketCommand.h"
-Command::Command(WebPageManager *manager, QStringList &arguments, QObject *parent) : QObject(parent) {
- m_manager = manager;
- m_arguments = arguments;
-}
-
-void Command::start() {
+Command::Command(QObject *parent) : QObject(parent) {
}
QString Command::toString() const {
return metaObject()->className();
}
-
-WebPage *Command::page() const {
- return m_manager->currentPage();
-}
-
-const QStringList &Command::arguments() const {
- return m_arguments;
-}
-
-WebPageManager *Command::manager() const {
- return m_manager;
-}
View
18 src/Command.h
@@ -2,32 +2,18 @@
#define COMMAND_H
#include <QObject>
-#include <QStringList>
#include "Response.h"
-class WebPage;
-class WebPageManager;
-
class Command : public QObject {
Q_OBJECT
public:
- Command(WebPageManager *, QStringList &arguments, QObject *parent = 0);
- virtual void start();
+ Command(QObject *parent = 0);
+ virtual void start() = 0;
virtual QString toString() const;
signals:
void finished(Response *response);
-
- protected:
- WebPage *page() const;
- const QStringList &arguments() const;
- WebPageManager *manager() const;
-
- private:
- QStringList m_arguments;
- WebPageManager *m_manager;
-
};
#endif
View
6 src/CommandFactory.cpp
@@ -1,8 +1,8 @@
#include "CommandFactory.h"
#include "NullCommand.h"
+#include "SocketCommand.h"
#include "Visit.h"
#include "Find.h"
-#include "Command.h"
#include "Reset.h"
#include "Node.h"
#include "Url.h"
@@ -38,7 +38,5 @@ CommandFactory::CommandFactory(WebPageManager *manager, QObject *parent) : QObje
Command *CommandFactory::createCommand(const char *name, QStringList &arguments) {
#include "find_command.h"
- arguments.clear();
- arguments.append(QString(name));
- return new NullCommand(m_manager, arguments);
+ return new NullCommand(QString(name));
}
View
2  src/CommandParser.cpp
@@ -1,6 +1,6 @@
#include "CommandParser.h"
#include "CommandFactory.h"
-#include "Command.h"
+#include "SocketCommand.h"
#include <QIODevice>
View
2  src/Connection.cpp
@@ -4,7 +4,7 @@
#include "CommandParser.h"
#include "CommandFactory.h"
#include "PageLoadingCommand.h"
-#include "Command.h"
+#include "SocketCommand.h"
#include <QTcpSocket>
View
2  src/ConsoleMessages.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-ConsoleMessages::ConsoleMessages(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+ConsoleMessages::ConsoleMessages(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void ConsoleMessages::start() {
View
4 src/ConsoleMessages.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class ConsoleMessages : public Command {
+class ConsoleMessages : public SocketCommand {
Q_OBJECT
public:
View
2  src/CurrentUrl.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-CurrentUrl::CurrentUrl(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+CurrentUrl::CurrentUrl(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
/*
View
4 src/CurrentUrl.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class CurrentUrl : public Command {
+class CurrentUrl : public SocketCommand {
Q_OBJECT
public:
View
2  src/EnableLogging.cpp
@@ -1,7 +1,7 @@
#include "EnableLogging.h"
#include "WebPageManager.h"
-EnableLogging::EnableLogging(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+EnableLogging::EnableLogging(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void EnableLogging::start() {
View
4 src/EnableLogging.h
@@ -1,8 +1,8 @@
-#include "Command.h"
+#include "SocketCommand.h"
class WebPageManager;
-class EnableLogging : public Command {
+class EnableLogging : public SocketCommand {
Q_OBJECT
public:
View
2  src/Evaluate.cpp
@@ -3,7 +3,7 @@
#include "WebPageManager.h"
#include <iostream>
-Evaluate::Evaluate(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Evaluate::Evaluate(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
m_buffer = "";
}
View
4 src/Evaluate.h
@@ -1,8 +1,8 @@
-#include "Command.h"
+#include "SocketCommand.h"
#include <QVariantList>
-class Evaluate : public Command {
+class Evaluate : public SocketCommand {
Q_OBJECT
public:
View
2  src/Execute.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-Execute::Execute(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Execute::Execute(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Execute::start() {
View
4 src/Execute.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class Execute : public Command {
+class Execute : public SocketCommand {
Q_OBJECT
public:
View
4 src/Find.cpp
@@ -1,9 +1,9 @@
#include "Find.h"
-#include "Command.h"
+#include "SocketCommand.h"
#include "WebPage.h"
#include "WebPageManager.h"
-Find::Find(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Find::Find(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Find::start() {
View
4 src/Find.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class Find : public Command {
+class Find : public SocketCommand {
Q_OBJECT
public:
View
4 src/FrameFocus.cpp
@@ -1,9 +1,9 @@
#include "FrameFocus.h"
-#include "Command.h"
+#include "SocketCommand.h"
#include "WebPage.h"
#include "WebPageManager.h"
-FrameFocus::FrameFocus(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+FrameFocus::FrameFocus(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void FrameFocus::start() {
View
4 src/FrameFocus.h
@@ -1,8 +1,8 @@
-#include "Command.h"
+#include "SocketCommand.h"
class QWebFrame;
-class FrameFocus : public Command {
+class FrameFocus : public SocketCommand {
Q_OBJECT
public:
View
2  src/GetCookies.cpp
@@ -3,7 +3,7 @@
#include "WebPageManager.h"
#include "NetworkCookieJar.h"
-GetCookies::GetCookies(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent)
+GetCookies::GetCookies(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent)
{
m_buffer = "";
}
View
4 src/GetCookies.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class GetCookies : public Command {
+class GetCookies : public SocketCommand {
Q_OBJECT;
public:
View
2  src/GetWindowHandle.cpp
@@ -3,7 +3,7 @@
#include "WebPageManager.h"
#include <QStringList>
-GetWindowHandle::GetWindowHandle(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+GetWindowHandle::GetWindowHandle(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void GetWindowHandle::start() {
View
4 src/GetWindowHandle.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class GetWindowHandle : public Command {
+class GetWindowHandle : public SocketCommand {
Q_OBJECT
public:
View
2  src/GetWindowHandles.cpp
@@ -4,7 +4,7 @@
#include "WebPage.h"
#include <QStringList>
-GetWindowHandles::GetWindowHandles(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+GetWindowHandles::GetWindowHandles(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void GetWindowHandles::start() {
View
4 src/GetWindowHandles.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class GetWindowHandles : public Command {
+class GetWindowHandles : public SocketCommand {
Q_OBJECT
public:
View
2  src/Header.cpp
@@ -3,7 +3,7 @@
#include "WebPageManager.h"
#include "NetworkAccessManager.h"
-Header::Header(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Header::Header(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Header::start() {
View
4 src/Header.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class Header : public Command {
+class Header : public SocketCommand {
Q_OBJECT
public:
View
2  src/Headers.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-Headers::Headers(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Headers::Headers(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Headers::start() {
View
4 src/Headers.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class Headers : public Command {
+class Headers : public SocketCommand {
Q_OBJECT
public:
View
2  src/IgnoreSslErrors.cpp
@@ -3,7 +3,7 @@
#include "WebPageManager.h"
IgnoreSslErrors::IgnoreSslErrors(WebPageManager *manager, QStringList &arguments, QObject *parent) :
- Command(manager, arguments, parent) {
+ SocketCommand(manager, arguments, parent) {
}
void IgnoreSslErrors::start() {
View
4 src/IgnoreSslErrors.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class IgnoreSslErrors : public Command {
+class IgnoreSslErrors : public SocketCommand {
Q_OBJECT
public:
View
2  src/Node.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-Node::Node(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Node::Node(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Node::start() {
View
4 src/Node.h
@@ -1,7 +1,7 @@
-#include "Command.h"
+#include "SocketCommand.h"
#include <QStringList>
-class Node : public Command {
+class Node : public SocketCommand {
Q_OBJECT
public:
View
6 src/NullCommand.cpp
@@ -2,10 +2,12 @@
#include "WebPage.h"
#include "WebPageManager.h"
-NullCommand::NullCommand(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {}
+NullCommand::NullCommand(QString name, QObject *parent) : Command(parent) {
+ m_name = name;
+}
void NullCommand::start() {
- QString failure = QString("[Capybara WebKit] Unknown command: ") + arguments()[0] + "\n";
+ QString failure = QString("[Capybara WebKit] Unknown command: ") + m_name + "\n";
emit finished(new Response(false, failure));
}
View
5 src/NullCommand.h
@@ -4,6 +4,9 @@ class NullCommand : public Command {
Q_OBJECT
public:
- NullCommand(WebPageManager *, QStringList &arguments, QObject *parent = 0);
+ NullCommand(QString name, QObject *parent = 0);
virtual void start();
+
+ private:
+ QString m_name;
};
View
2  src/PageLoadingCommand.cpp
@@ -1,5 +1,5 @@
#include "PageLoadingCommand.h"
-#include "Command.h"
+#include "SocketCommand.h"
#include "WebPage.h"
#include "WebPageManager.h"
View
2  src/Render.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-Render::Render(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Render::Render(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Render::start() {
View
4 src/Render.h
@@ -1,7 +1,7 @@
-#include "Command.h"
+#include "SocketCommand.h"
#include <QStringList>
-class Render : public Command {
+class Render : public SocketCommand {
Q_OBJECT
public:
View
2  src/RequestedUrl.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-RequestedUrl::RequestedUrl(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+RequestedUrl::RequestedUrl(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void RequestedUrl::start() {
View
4 src/RequestedUrl.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class RequestedUrl : public Command {
+class RequestedUrl : public SocketCommand {
Q_OBJECT
public:
View
2  src/Reset.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-Reset::Reset(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Reset::Reset(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Reset::start() {
View
4 src/Reset.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class Reset : public Command {
+class Reset : public SocketCommand {
Q_OBJECT
public:
View
2  src/ResizeWindow.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-ResizeWindow::ResizeWindow(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+ResizeWindow::ResizeWindow(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void ResizeWindow::start() {
View
4 src/ResizeWindow.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class ResizeWindow : public Command {
+class ResizeWindow : public SocketCommand {
Q_OBJECT
public:
View
2  src/SetCookie.cpp
@@ -4,7 +4,7 @@
#include "NetworkCookieJar.h"
#include <QNetworkCookie>
-SetCookie::SetCookie(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {}
+SetCookie::SetCookie(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {}
void SetCookie::start()
{
View
4 src/SetCookie.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class SetCookie : public Command {
+class SetCookie : public SocketCommand {
Q_OBJECT;
public:
View
2  src/SetProxy.cpp
@@ -4,7 +4,7 @@
#include <QNetworkAccessManager>
#include <QNetworkProxy>
-SetProxy::SetProxy(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {}
+SetProxy::SetProxy(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {}
void SetProxy::start()
{
View
4 src/SetProxy.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class SetProxy : public Command {
+class SetProxy : public SocketCommand {
Q_OBJECT;
public:
View
2  src/SetSkipImageLoading.cpp
@@ -3,7 +3,7 @@
#include "WebPageManager.h"
SetSkipImageLoading::SetSkipImageLoading(WebPageManager *manager, QStringList &arguments, QObject *parent) :
- Command(manager, arguments, parent) {
+ SocketCommand(manager, arguments, parent) {
}
void SetSkipImageLoading::start() {
View
4 src/SetSkipImageLoading.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class SetSkipImageLoading : public Command {
+class SetSkipImageLoading : public SocketCommand {
Q_OBJECT
public:
View
21 src/SocketCommand.cpp
@@ -0,0 +1,21 @@
+#include "SocketCommand.h"
+#include "WebPage.h"
+#include "WebPageManager.h"
+
+SocketCommand::SocketCommand(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(parent) {
+ m_manager = manager;
+ m_arguments = arguments;
+}
+
+WebPage *SocketCommand::page() const {
+ return m_manager->currentPage();
+}
+
+const QStringList &SocketCommand::arguments() const {
+ return m_arguments;
+}
+
+WebPageManager *SocketCommand::manager() const {
+ return m_manager;
+}
+
View
29 src/SocketCommand.h
@@ -0,0 +1,29 @@
+#ifndef SOCKET_COMMAND_H
+#define SOCKET_COMMAND_H
+
+#include <QObject>
+#include <QStringList>
+#include "Command.h"
+
+class WebPage;
+class WebPageManager;
+class Response;
+
+class SocketCommand : public Command {
+ Q_OBJECT
+
+ public:
+ SocketCommand(WebPageManager *, QStringList &arguments, QObject *parent = 0);
+
+ protected:
+ WebPage *page() const;
+ const QStringList &arguments() const;
+ WebPageManager *manager() const;
+
+ private:
+ QStringList m_arguments;
+ WebPageManager *m_manager;
+
+};
+
+#endif
View
2  src/Source.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-Source::Source(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Source::Source(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Source::start() {
View
4 src/Source.h
@@ -1,8 +1,8 @@
-#include "Command.h"
+#include "SocketCommand.h"
class QNetworkReply;
-class Source : public Command {
+class Source : public SocketCommand {
Q_OBJECT
public:
View
2  src/Status.cpp
@@ -3,7 +3,7 @@
#include "WebPageManager.h"
#include <sstream>
-Status::Status(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Status::Status(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Status::start() {
View
4 src/Status.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class Status : public Command {
+class Status : public SocketCommand {
Q_OBJECT
public:
View
2  src/Url.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-Url::Url(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Url::Url(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Url::start() {
View
4 src/Url.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class Url : public Command {
+class Url : public SocketCommand {
Q_OBJECT
public:
View
4 src/Visit.cpp
@@ -1,9 +1,9 @@
#include "Visit.h"
-#include "Command.h"
+#include "SocketCommand.h"
#include "WebPage.h"
#include "WebPageManager.h"
-Visit::Visit(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Visit::Visit(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Visit::start() {
View
4 src/Visit.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class Visit : public Command {
+class Visit : public SocketCommand {
Q_OBJECT
public:
View
4 src/WindowFocus.cpp
@@ -1,10 +1,10 @@
#include "WindowFocus.h"
-#include "Command.h"
+#include "SocketCommand.h"
#include "WebPage.h"
#include "CommandFactory.h"
#include "WebPageManager.h"
-WindowFocus::WindowFocus(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+WindowFocus::WindowFocus(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void WindowFocus::start() {
View
4 src/WindowFocus.h
@@ -1,6 +1,6 @@
-#include "Command.h"
+#include "SocketCommand.h"
-class WindowFocus : public Command {
+class WindowFocus : public SocketCommand {
Q_OBJECT
public:
View
2  src/body.cpp
@@ -2,7 +2,7 @@
#include "WebPage.h"
#include "WebPageManager.h"
-Body::Body(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+Body::Body(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void Body::start() {
View
2  src/webkit_server.pro
@@ -13,6 +13,7 @@ HEADERS = \
Server.h \
Connection.h \
Command.h \
+ SocketCommand.h \
Visit.h \
Find.h \
Reset.h \
@@ -59,6 +60,7 @@ SOURCES = \
Server.cpp \
Connection.cpp \
Command.cpp \
+ SocketCommand.cpp \
Visit.cpp \
Find.cpp \
Reset.cpp \
View
2  templates/Command.cpp
@@ -1,7 +1,7 @@
#include "NAME.h"
#include "WebPage.h"
-NAME::NAME(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
+NAME::NAME(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void NAME::start() {
View
2  templates/Command.h
@@ -2,7 +2,7 @@
class WebPage;
-class NAME : public Command {
+class NAME : public SocketCommand {
Q_OBJECT
public:
Please sign in to comment.
Something went wrong with that request. Please try again.