1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 13:47:01 -04:00

HttpServer: use settings structures in place of QSettings

This commit is contained in:
f4exb
2017-11-13 01:01:15 +01:00
parent bc793b4095
commit 9a77311b2a
7 changed files with 165 additions and 2 deletions
+8
View File
@@ -42,6 +42,8 @@ namespace qtwebapp {
received a related HTTP request.
*/
class HttpDocrootSettings;
class DECLSPEC StaticFileController : public HttpRequestHandler {
Q_OBJECT
Q_DISABLE_COPY(StaticFileController)
@@ -50,6 +52,9 @@ public:
/** Constructor */
StaticFileController(QSettings* settings, QObject* parent = NULL);
/** Constructor */
StaticFileController(HttpDocrootSettings* settings, QObject* parent = NULL);
/** Generates the response */
void service(HttpRequest& request, HttpResponse& response);
@@ -82,6 +87,9 @@ private:
/** Used to synchronize cache access for threads */
QMutex mutex;
/** Settings flag */
bool useQtSettings;
/** Set a content-type header in the response depending on the ending of the filename */
void setContentType(QString file, HttpResponse& response) const;
};