forked from MrBesen/soundboard
minimal windows compatability
This commit is contained in:
parent
c8ce6cc0d1
commit
98c60bfc4c
|
@ -72,6 +72,8 @@ Thumbs.db
|
||||||
*.exe
|
*.exe
|
||||||
|
|
||||||
generated/
|
generated/
|
||||||
|
obj/
|
||||||
|
build/
|
||||||
|
|
||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
soundboard
|
soundboard
|
||||||
|
|
|
@ -33,7 +33,7 @@ public:
|
||||||
std::vector<SampleConfig> samples;
|
std::vector<SampleConfig> samples;
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
const static uint8_t DEFAULTWIDTH = 6;
|
const static uint8_t DEFAULTWIDTH;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RootConfig {
|
struct RootConfig {
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include "qxtglobalshortcut.h"
|
#include "qxtglobalshortcut.h"
|
||||||
|
|
||||||
|
|
||||||
class SoundButton : public QPushButton
|
class SoundButton : public QPushButton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -53,4 +52,4 @@ private:
|
||||||
const static uint8_t HIGHLIGHTBORDEROFFSET = 5;
|
const static uint8_t HIGHLIGHTBORDEROFFSET = 5;
|
||||||
|
|
||||||
QxtGlobalShortcut* globalShortcut = nullptr;
|
QxtGlobalShortcut* globalShortcut = nullptr;
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
CONFIG += c++17
|
CONFIG += c++17
|
||||||
CONFIG += debug_info
|
CONFIG += debug_info
|
||||||
CONFIG += force_debug_info
|
CONFIG += force_debug_info
|
||||||
LIBS += -lX11 -ldl
|
unix:LIBS += -lX11 -ldl
|
||||||
|
|
||||||
# The following define makes your compiler emit warnings if you use
|
# The following define makes your compiler emit warnings if you use
|
||||||
# any Qt feature that has been marked deprecated (the exact warnings
|
# any Qt feature that has been marked deprecated (the exact warnings
|
||||||
|
|
|
@ -16,7 +16,10 @@ using json = nlohmann::json;
|
||||||
|
|
||||||
#include "config_json.cpp" // json parsing in diffrent file
|
#include "config_json.cpp" // json parsing in diffrent file
|
||||||
|
|
||||||
|
const uint8_t Config::ButtonConfig::DEFAULTWIDTH = 6;
|
||||||
|
|
||||||
Config::Config(const std::string binaryArgument) {
|
Config::Config(const std::string binaryArgument) {
|
||||||
|
#if __unix__
|
||||||
char* buff = realpath(binaryArgument.c_str(), NULL); // buff needs free !
|
char* buff = realpath(binaryArgument.c_str(), NULL); // buff needs free !
|
||||||
//ssize_t read = readlink(binaryArgument.c_str(), buf, MAXBUF);
|
//ssize_t read = readlink(binaryArgument.c_str(), buf, MAXBUF);
|
||||||
if(buff) {
|
if(buff) {
|
||||||
|
@ -28,6 +31,10 @@ Config::Config(const std::string binaryArgument) {
|
||||||
// error
|
// error
|
||||||
Log::error << "unable to read path of the binaryFile";
|
Log::error << "unable to read path of the binaryFile";
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void) binaryArgument;
|
||||||
|
binaryPath = "./";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Config::~Config() {
|
Config::~Config() {
|
||||||
|
@ -68,4 +75,4 @@ void Config::save() {
|
||||||
} else {
|
} else {
|
||||||
Log::error << "could not write configfile";
|
Log::error << "could not write configfile";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue