From b533776ce717957e473625aaf24bf4c6c259a393 Mon Sep 17 00:00:00 2001 From: turbocat Date: Wed, 10 Feb 2021 20:35:30 +0000 Subject: [PATCH] Weather: Fix config filepath git-svn-id: svn://kolibrios.org@8589 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/Tupfile.lua | 2 +- programs/develop/tinypad/trunk/tp-common.asm | 4 +++- programs/other/Weather/weather.c | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/data/Tupfile.lua b/data/Tupfile.lua index 0927002d48..29b70d1f89 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -67,7 +67,7 @@ img_files = { {"SETTINGS/NETWORK.INI", "common/settings/network.ini"}, {"SETTINGS/SYSTEM.INI", "common/settings/system.ini"}, {"SETTINGS/TASKBAR.INI", "common/settings/taskbar.ini"}, - {"SETTINGS/WEATHER.JSON", PROGS .. "/other/Weather/weather.json"}, + {"SETTINGS/weather.json", PROGS .. "/other/Weather/weather.json"}, } -- For russian build, add russian-only files. diff --git a/programs/develop/tinypad/trunk/tp-common.asm b/programs/develop/tinypad/trunk/tp-common.asm index ed17bb0fa0..0dab036bfd 100644 --- a/programs/develop/tinypad/trunk/tp-common.asm +++ b/programs/develop/tinypad/trunk/tp-common.asm @@ -1,5 +1,5 @@ diff16 'tp-common.asm',0,$ - +include '../../../debug.inc' ;----------------------------------------------------------------------------- proc clear_selection ;//////////////////////////////////////////////////////// ;----------------------------------------------------------------------------- @@ -71,6 +71,8 @@ endp proc get_real_length ;//////////////////////////////////////////////////////// ;----------------------------------------------------------------------------- mov eax,[esi+EDITOR_LINE_DATA.Size] + debug_print_dec eax + debug_print "|" @@: cmp byte[esi+eax+sizeof.EDITOR_LINE_DATA-1],' ' jne @f dec eax diff --git a/programs/other/Weather/weather.c b/programs/other/Weather/weather.c index e7a5914076..8120051739 100644 --- a/programs/other/Weather/weather.c +++ b/programs/other/Weather/weather.c @@ -45,6 +45,7 @@ unsigned WINDOW_W = 230; #define IMAGE_URL "openweathermap.org/img/w/%s.png" Image *blend=NULL; +const char *config_name = "/sys/Settings/weather.json"; unsigned char char_size=1; uint64_t AutoUpdateTime = 0; @@ -228,12 +229,12 @@ void RedrawGUI() // Перересовываем интерфейс void get_config(char **City, char **Token, char **Units) // Загружаем конфиг { - FILE *config_j = fopen("/sys/Settings/weather.json", "rb"); + FILE *config_j = fopen(config_name, "rb"); if(config_j==NULL){ notify_show("'Configuration file not found!' -E"); exit(0); } - size_t size = _ksys_get_filesize("weather.json"); // Получаем размер файла + size_t size = _ksys_get_filesize((char*)config_name); // Получаем размер файла char *config_buff = safe_malloc(size+1); if(size != fread(config_buff, sizeof(char), size, config_j)){ notify_show("'The configuration file was not fully read!' -E");