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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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