mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-06-14 21:01:39 -05:00
Add helper fromatJsonString()
obs_data_get_json() will now dump the json data in JSON_COMPACT format which makes it rather difficult to read.
This commit is contained in:
parent
0975ffabfa
commit
baa158bb33
|
|
@ -28,6 +28,8 @@ bool compareSourceSettings(const OBSWeakSource &source,
|
|||
std::vector<obs_scene_item *> getSceneItemsWithName(OBSScene scene,
|
||||
std::string &name);
|
||||
std::string getDataFilePath(const std::string &file);
|
||||
QString fromatJsonString(std::string);
|
||||
QString fromatJsonString(const char *);
|
||||
|
||||
/**
|
||||
* Populate layout with labels and widgets based on provided text
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <QGraphicsColorizeEffect>
|
||||
#include <QTimer>
|
||||
#include <QMessageBox>
|
||||
#include <QJsonDocument>
|
||||
#include <unordered_map>
|
||||
#include <regex>
|
||||
#include <set>
|
||||
|
|
@ -291,6 +292,17 @@ std::string getDataFilePath(const std::string &file)
|
|||
return "";
|
||||
}
|
||||
|
||||
QString fromatJsonString(std::string s)
|
||||
{
|
||||
return fromatJsonString(s.c_str());
|
||||
}
|
||||
|
||||
QString fromatJsonString(const char *json)
|
||||
{
|
||||
QJsonDocument doc = QJsonDocument::fromJson(json);
|
||||
return doc.toJson(QJsonDocument::Indented);
|
||||
}
|
||||
|
||||
bool DisplayMessage(const QString &msg, bool question)
|
||||
{
|
||||
if (question) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user