mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
tweaks (#1846)
* opt: live extra * opt: remove addPointer * opt: use ssd * opt: cache svg * opt: localToGlobal * opt: disabled icon * opt: onVideoDetailChange switch * fix --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
4a3d827f7a
commit
e707764f84
@@ -5,10 +5,6 @@
|
||||
#include <gdk/gdkx.h>
|
||||
#endif
|
||||
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
#include "flutter/generated_plugin_registrant.h"
|
||||
|
||||
struct _MyApplication {
|
||||
@@ -50,22 +46,9 @@ static void my_application_activate(GApplication *application) {
|
||||
// if future cases occur).
|
||||
|
||||
const gboolean use_header_bar = [window]() -> gboolean {
|
||||
auto UseSSD = []() -> bool {
|
||||
const gchar *config_root = g_get_user_data_dir();
|
||||
gchar *full_path_c = g_build_filename(config_root, "com.example.piliplus",
|
||||
"settings.json", NULL);
|
||||
std::string config_path(full_path_c);
|
||||
g_free(full_path_c);
|
||||
std::ifstream f(config_path);
|
||||
if (!f.is_open()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string content{std::istreambuf_iterator<char>(f), {}};
|
||||
return (content.find("\"useSSD\": true,") != std::string::npos);
|
||||
// user choose to use SSD
|
||||
};
|
||||
if (UseSSD())
|
||||
if (g_file_test(
|
||||
g_build_filename(g_get_user_data_dir(), "com.example.piliplus", "use_ssd", NULL),
|
||||
G_FILE_TEST_EXISTS))
|
||||
return FALSE;
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
|
||||
Reference in New Issue
Block a user