refacor media widget, apply clang format rule

This commit is contained in:
2026-02-07 14:14:50 +01:00
parent 64b3babd3d
commit d9ac353a0d
54 changed files with 642 additions and 878 deletions

View File

@@ -1,17 +1,17 @@
#pragma once
#include <array>
#include <cstdio>
#include <memory>
#include <stdexcept>
#include <string>
#include <cstdio>
class CommandHelper {
public:
static std::string exec(const char *cmd) {
std::array<char, 128> buffer;
std::string result;
std::unique_ptr<FILE, int(*)(FILE*)> pipe(popen(cmd, "r"), pclose);
std::unique_ptr<FILE, int (*)(FILE *)> pipe(popen(cmd, "r"), pclose);
if (!pipe) {
throw std::runtime_error("popen() failed!");
}
@@ -23,7 +23,7 @@ class CommandHelper {
static void execNoOutput(std::string cmd) {
std::string command = cmd + " > /dev/null 2>&1";
int ret = std::system(command.c_str());
int ret = std::system(command.c_str());
if (ret != 0) {
throw std::runtime_error("Command failed with return code: " + std::to_string(ret));
}