RequestHandler.cpp   RequestHandler.cpp 
skipping to change at line 39 skipping to change at line 39
#include "ScriptService.hpp" #include "ScriptService.hpp"
#include "SimbadService.hpp" #include "SimbadService.hpp"
#include "StelActionService.hpp" #include "StelActionService.hpp"
#include "StelPropertyService.hpp" #include "StelPropertyService.hpp"
#include "ViewService.hpp" #include "ViewService.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelModuleMgr.hpp"
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
#include <QPluginLoader>
const QByteArray RequestHandler::AUTH_REALM = "Basic realm=\"Stellarium rem ote control\""; const QByteArray RequestHandler::AUTH_REALM = "Basic realm=\"Stellarium rem ote control\"";
class HtmlTranslationProvider : public ITemplateTranslationProvider class HtmlTranslationProvider : public ITemplateTranslationProvider
{ {
public: public:
HtmlTranslationProvider(StelTranslator* localInstance) HtmlTranslationProvider(StelTranslator* localInstance)
{ {
rcTranslator = localInstance; rcTranslator = localInstance;
} }
skipping to change at line 93 skipping to change at line 95
StelTranslator* rcTranslator; StelTranslator* rcTranslator;
}; };
RequestHandler::RequestHandler(const StaticFileControllerSettings& settings , QObject* parent) : HttpRequestHandler(parent), usePassword(false), templa teMutex(QMutex::Recursive) RequestHandler::RequestHandler(const StaticFileControllerSettings& settings , QObject* parent) : HttpRequestHandler(parent), usePassword(false), templa teMutex(QMutex::Recursive)
{ {
apiController = new APIController(QByteArray("/api/").size(),this); apiController = new APIController(QByteArray("/api/").size(),this);
//register the services //register the services
//they "live" in the main thread in the QObject sense, but their ser vice methods are actually //they "live" in the main thread in the QObject sense, but their ser vice methods are actually
//executed in the HTTP handler threads //executed in the HTTP handler threads
apiController->registerService(new MainService("main",apiController) apiController->registerService(new MainService(apiController));
); apiController->registerService(new ObjectService(apiController));
apiController->registerService(new ObjectService("objects",apiContro apiController->registerService(new ScriptService(apiController));
ller)); apiController->registerService(new SimbadService(apiController));
apiController->registerService(new ScriptService("scripts",apiContro apiController->registerService(new StelActionService(apiController))
ller)); ;
apiController->registerService(new SimbadService("simbad",apiControl apiController->registerService(new StelPropertyService(apiController
ler)); ));
apiController->registerService(new StelActionService("stelaction",ap apiController->registerService(new LocationService(apiController));
iController)); apiController->registerService(new LocationSearchService(apiControll
apiController->registerService(new StelPropertyService("stelproperty er));
",apiController)); apiController->registerService(new ViewService(apiController));
apiController->registerService(new LocationService("location",apiCon
troller)); connect(&StelApp::getInstance().getModuleMgr(), SIGNAL(extensionsAdd
apiController->registerService(new LocationSearchService("locationse ed(QObjectList)), this, SLOT(addExtensionServices(QObjectList)));
arch",apiController)); addExtensionServices(StelApp::getInstance().getModuleMgr().getExtens
apiController->registerService(new ViewService("view",apiController) ionList());
);
staticFiles = new StaticFileController(settings,this); staticFiles = new StaticFileController(settings,this);
connect(&StelApp::getInstance(),SIGNAL(languageChanged()),this,SLOT( refreshTemplates())); connect(&StelApp::getInstance(),SIGNAL(languageChanged()),this,SLOT( refreshTemplates()));
refreshTemplates(); refreshTemplates();
} }
RequestHandler::~RequestHandler() RequestHandler::~RequestHandler()
{ {
} }
void RequestHandler::addExtensionServices(QObjectList services)
{
foreach(QObject* obj, services)
{
RemoteControlServiceInterface* sv = qobject_cast<RemoteContr
olServiceInterface*>(obj);
if(sv)
{
qDebug()<<"Registering RemoteControl extension servi
ce:"<<sv->getPath();
apiController->registerService(sv);
}
}
}
void RequestHandler::update(double deltaTime) void RequestHandler::update(double deltaTime)
{ {
apiController->update(deltaTime); apiController->update(deltaTime);
} }
void RequestHandler::service(HttpRequest &request, HttpResponse &response) void RequestHandler::service(HttpRequest &request, HttpResponse &response)
{ {
#define SERVER_HEADER "Stellarium RemoteControl " REMOTECONTROL_VERSION #define SERVER_HEADER "Stellarium RemoteControl " REMOTECONTROL_VERSION
response.setHeader("Server",SERVER_HEADER); response.setHeader("Server",SERVER_HEADER);
 End of changes. 4 change blocks. 
18 lines changed or deleted 34 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/