minimal windows compatability

This commit is contained in:
MrBesen 2022-02-26 16:00:02 +01:00
parent c8ce6cc0d1
commit 98c60bfc4c
5 changed files with 13 additions and 5 deletions

2
.gitignore vendored
View File

@ -72,6 +72,8 @@ Thumbs.db
*.exe
generated/
obj/
build/
.vscode/settings.json
soundboard

View File

@ -33,7 +33,7 @@ public:
std::vector<SampleConfig> samples;
bool isValid() const;
const static uint8_t DEFAULTWIDTH = 6;
const static uint8_t DEFAULTWIDTH;
};
struct RootConfig {

View File

@ -6,7 +6,6 @@
#include <QPushButton>
#include "qxtglobalshortcut.h"
class SoundButton : public QPushButton
{
Q_OBJECT
@ -53,4 +52,4 @@ private:
const static uint8_t HIGHLIGHTBORDEROFFSET = 5;
QxtGlobalShortcut* globalShortcut = nullptr;
};
};

View File

@ -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

View File

@ -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";
}
}
}