This commit is contained in:
Malte Jürgens
2022-10-14 23:16:34 +02:00
parent 1eda9d75b0
commit 100f9bf58e
13 changed files with 224 additions and 58 deletions

35
src/webclass.cpp Normal file
View File

@@ -0,0 +1,35 @@
#include "webclass.h"
#include <QDesktopServices>
#include <QUrl>
QVariant WebClass::vencordSend(QString event, QVariantList args) {
if (event == "VencordGetRepo") {
return true;
}
if (event == "VencordGetSettingsDir") {
return "~/.config/discord-screenaudio/vencord";
}
if (event == "VencordGetQuickCss") {
// TODO
return "";
}
if (event == "VencordGetSettings") {
return m_vencordSettings;
}
if (event == "VencordSetSettings") {
m_vencordSettings = args[0].toString();
return true;
}
if (event == "VencordGetUpdates") {
return QVariantMap{{"ok", true}, {"value", QVariantList()}};
}
if (event == "VencordOpenExternal") {
QDesktopServices::openUrl(QUrl(args[0].toString()));
return true;
}
if (event == "VencordOpenQuickCss") {
return true;
}
assert(false);
}