mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Add helper getDataFilePath()
Used to get absolute file path to files in the plugin's data directory
This commit is contained in:
parent
b9f6e47a49
commit
38161f63a3
|
|
@ -10,6 +10,7 @@
|
|||
#include <obs-frontend-api.h>
|
||||
#include <deque>
|
||||
#include <unordered_map>
|
||||
#include <filesystem>
|
||||
#include "scene-group.hpp"
|
||||
|
||||
bool WeakSourceValid(obs_weak_source_t *ws);
|
||||
|
|
@ -22,6 +23,7 @@ OBSWeakSource GetWeakFilterByName(OBSWeakSource source, const char *name);
|
|||
OBSWeakSource GetWeakFilterByQString(OBSWeakSource source, const QString &name);
|
||||
bool compareIgnoringLineEnding(QString &s1, QString &s2);
|
||||
std::string getSourceSettings(OBSWeakSource ws);
|
||||
std::filesystem::path getDataFilePath(const std::string &file);
|
||||
|
||||
/**
|
||||
* Populate layout with labels and widgets based on provided text
|
||||
|
|
|
|||
|
|
@ -218,6 +218,17 @@ std::string getSourceSettings(OBSWeakSource ws)
|
|||
return settings;
|
||||
}
|
||||
|
||||
std::filesystem::path getDataFilePath(const std::string &file)
|
||||
{
|
||||
const char *root_path = obs_get_module_data_path(obs_current_module());
|
||||
if (root_path) {
|
||||
auto ret = std::filesystem::u8path(root_path);
|
||||
ret.append(file.data());
|
||||
return ret;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
bool DisplayMessage(const QString &msg, bool question)
|
||||
{
|
||||
if (question) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user