Fixed issues hopefully

This commit is contained in:
AlexandreRouma 2022-02-24 21:01:51 +01:00
parent 2779516378
commit 9bbc50ff3c
8 changed files with 11 additions and 11 deletions

View File

@ -35,7 +35,7 @@ namespace backend {
int PollUnicodeChars();
void doPartialInit() {
std::string root = core::args["root"];
std::string root = (std::string)core::args["root"];
backend::init();
style::loadFonts(root + "/res"); // TODO: Don't hardcode, use config
icons::load(root + "/res");

View File

@ -74,14 +74,14 @@ int sdrpp_main(int argc, char* argv[]) {
return 0;
}
bool serverMode = core::args["server"];
bool serverMode = (bool)core::args["server"];
#ifdef _WIN32
if (!core::args["con"].b() && !serverMode) { FreeConsole(); }
#endif
// Check root directory
std::string root = core::args["root"];
std::string root = (std::string)core::args["root"];
if (!std::filesystem::exists(root)) {
spdlog::warn("Root directory {0} does not exist, creating it", root);
if (!std::filesystem::create_directories(root)) {

View File

@ -6,7 +6,7 @@
FileSelect::FileSelect(std::string defaultPath, std::vector<std::string> filter) {
_filter = filter;
root = core::args["root"];
root = (std::string)core::args["root"];
setPath(defaultPath);
}

View File

@ -5,7 +5,7 @@
#include <core.h>
FolderSelect::FolderSelect(std::string defaultPath) {
root = core::args["root"];
root = (std::string)core::args["root"];
setPath(defaultPath);
}

View File

@ -148,8 +148,8 @@ namespace server {
sigpath::sourceManager.selectSource(sourceList[sourceId]);
// TODO: Use command line option
std::string host = core::args["addr"];
int port = core::args["port"];
std::string host = (std::string)core::args["addr"];
int port = (int)core::args["port"];
listener = net::listen(host, port);
listener->acceptAsync(_clientHandler, NULL);

View File

@ -243,7 +243,7 @@ private:
MOD_EXPORT void _INIT_() {
// Create default recording directory
std::string root = core::args["root"];
std::string root = (std::string)core::args["root"];
if (!std::filesystem::exists(root + "/recordings")) {
spdlog::warn("Recordings directory does not exist, creating it");
if (!std::filesystem::create_directory(root + "/recordings")) {

View File

@ -46,7 +46,7 @@ public:
RecorderModule(std::string name) : folderSelect("%ROOT%/recordings") {
this->name = name;
root = core::args["root"];
root = (std::string)core::args["root"];
// Load config
config.acquire();
@ -518,7 +518,7 @@ struct RecorderContext_t {
MOD_EXPORT void _INIT_() {
// Create default recording directory
std::string root = core::args["root"];
std::string root = (std::string)core::args["root"];
if (!std::filesystem::exists(root + "/recordings")) {
spdlog::warn("Recordings directory does not exist, creating it");
if (!std::filesystem::create_directory(root + "/recordings")) {

View File

@ -59,7 +59,7 @@ public:
RTLSDRSourceModule(std::string name) {
this->name = name;
serverMode = core::args["server"];
serverMode = (bool)core::args["server"];
sampleRate = sampleRates[0];