Prechádzať zdrojové kódy

Move HttpServer init to ComponentManager

We will need this for roku stuff later.
Tobias Hieta 9 rokov pred
rodič
commit
c2842aa430

+ 7 - 0
src/ComponentManager.cpp

@@ -15,6 +15,8 @@
 #include "remote/RemoteComponent.h"
 #include "remote/RokuRemoteComponent.h"
 
+#include "server/HTTPServer.h"
+
 #if KONVERGO_OPENELEC
 #include "system/openelec/OESystemComponent.h"
 #endif
@@ -56,6 +58,11 @@ void ComponentManager::initialize()
   // might have some settings
   //
   registerComponent(&SettingsComponent::Get());
+
+  // start our web server
+  auto server = new HttpServer(this);
+  server->start();
+
   registerComponent(&InputComponent::Get());
   registerComponent(&SystemComponent::Get());
   registerComponent(&DisplayComponent::Get());

+ 0 - 4
src/remote/RemoteComponent.cpp

@@ -39,10 +39,6 @@ RemoteComponent::RemoteComponent(QObject* parent) : ComponentBase(parent), m_com
 /////////////////////////////////////////////////////////////////////////////////////////
 bool RemoteComponent::componentInitialize()
 {
-  m_server = new HttpServer(this);
-  if (!m_server->start())
-    return false;
-
   m_gdmManager->startAnnouncing();
 
   // check for timed out subscribers

+ 0 - 1
src/remote/RemoteComponent.h

@@ -59,7 +59,6 @@ private:
   void handleSubscription(QHttpRequest * request, QHttpResponse * response, bool poll=false);
   void subscribeToWeb(bool subscribe);
 
-  HttpServer* m_server;
   GDMManager* m_gdmManager;
 
   quint64 m_commandId;