made JsonApiServer an singleton through static method instance()

This commit is contained in:
csoler 2019-11-12 22:32:18 +01:00
parent 3b45fc5199
commit d19d1685de
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
9 changed files with 129 additions and 95 deletions

View file

@ -30,6 +30,9 @@
#include "rsharesettings.h"
#include "gui/MainWindow.h"
// for this one, we'd rather use a file in retroshare/*h list.
#include <jsonapi/jsonapi.h>
#include <retroshare/rsnotify.h>
#include <retroshare/rspeers.h>
@ -1208,7 +1211,7 @@ void RshareSettings::setJsonApiEnabled(bool enabled)
uint16_t RshareSettings::getJsonApiPort()
{
return valueFromGroup("JsonApi", "port", 9092).toUInt();
return valueFromGroup("JsonApi", "port", JsonApiServer::DEFAULT_PORT).toUInt();
}
void RshareSettings::setJsonApiPort(uint16_t port)