From 9b0c0123af88bf0b863cadf0fd08d296cc213740 Mon Sep 17 00:00:00 2001 From: Andrei Popa Date: Wed, 22 Nov 2023 11:34:06 +0200 Subject: [PATCH] plugins: adrv9002: moved temporary profile gen files - windows required admin privileges to save within Program Files Signed-off-by: Andrei Popa --- plugins/adrv9002.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/adrv9002.c b/plugins/adrv9002.c index fd711418..f2233cec 100644 --- a/plugins/adrv9002.c +++ b/plugins/adrv9002.c @@ -2041,7 +2041,9 @@ static int profile_gen_save_to_file(gchar *filename, struct adrv9002_config *cfg // run profile gen cli command FILE *file; int ret = 0; - char command[BUFSIZ], *config_filename = "adrv9002_config.json"; + char command[BUFSIZ]; + char *config_filename = g_build_filename(getenv("HOME") ?: getenv("LOCALAPPDATA"), "adrv9002_config.json", NULL); + profile_gen_write_config_to_file(config_filename, cfg); if (file_type) { // profile @@ -2178,8 +2180,10 @@ static void profile_gen_load_config_to_device(GtkButton *self, gpointer data) // run profile gen cli command FILE *file; - char command[BUFSIZ], *config_filename = "adrv9002_config.json", *profile_filename = "adrv9002_profile.json", - *stream_filename = "adrv9002_stream.stream"; + char command[BUFSIZ]; + char *config_filename = g_build_filename(getenv("HOME") ?: getenv("LOCALAPPDATA"), "adrv9002_config.json", NULL); + char *profile_filename = g_build_filename(getenv("HOME") ?: getenv("LOCALAPPDATA"), "adrv9002_profile.json", NULL); + char *stream_filename = g_build_filename(getenv("HOME") ?: getenv("LOCALAPPDATA"), "adrv9002_stream.json", NULL); profile_gen_write_config_to_file(config_filename, &cfg); sprintf(command, "%s --config %s --profile %s --stream %s",