diff --git a/.gitignore b/.gitignore index 6562ce7..aafaea9 100644 --- a/.gitignore +++ b/.gitignore @@ -72,6 +72,8 @@ Thumbs.db *.exe generated/ +obj/ +build/ .vscode/settings.json soundboard diff --git a/include/config.h b/include/config.h index 85d9bcc..9916574 100644 --- a/include/config.h +++ b/include/config.h @@ -33,7 +33,7 @@ public: std::vector samples; bool isValid() const; - const static uint8_t DEFAULTWIDTH = 6; + const static uint8_t DEFAULTWIDTH; }; struct RootConfig { diff --git a/include/soundbutton.h b/include/soundbutton.h index 43b2509..76c84d5 100644 --- a/include/soundbutton.h +++ b/include/soundbutton.h @@ -6,7 +6,6 @@ #include #include "qxtglobalshortcut.h" - class SoundButton : public QPushButton { Q_OBJECT @@ -53,4 +52,4 @@ private: const static uint8_t HIGHLIGHTBORDEROFFSET = 5; QxtGlobalShortcut* globalShortcut = nullptr; -}; \ No newline at end of file +}; diff --git a/soundboard.pro b/soundboard.pro index c5bc8d9..52b7ecc 100644 --- a/soundboard.pro +++ b/soundboard.pro @@ -5,7 +5,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++17 CONFIG += debug_info CONFIG += force_debug_info -LIBS += -lX11 -ldl +unix:LIBS += -lX11 -ldl # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings diff --git a/src/config.cpp b/src/config.cpp index 57fc4a8..2690867 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -16,7 +16,10 @@ using json = nlohmann::json; #include "config_json.cpp" // json parsing in diffrent file +const uint8_t Config::ButtonConfig::DEFAULTWIDTH = 6; + Config::Config(const std::string binaryArgument) { +#if __unix__ char* buff = realpath(binaryArgument.c_str(), NULL); // buff needs free ! //ssize_t read = readlink(binaryArgument.c_str(), buf, MAXBUF); if(buff) { @@ -28,6 +31,10 @@ Config::Config(const std::string binaryArgument) { // error Log::error << "unable to read path of the binaryFile"; } +#else + (void) binaryArgument; + binaryPath = "./"; +#endif } Config::~Config() { @@ -68,4 +75,4 @@ void Config::save() { } else { Log::error << "could not write configfile"; } -} \ No newline at end of file +}