From f98a16dcadb03ed87de1b6b984ea168379aabd23 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 10 Mar 2019 19:46:52 +0000 Subject: [PATCH] Appearance 2.3: always use a real path git-svn-id: svn://kolibrios.org@7594 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/appearance/appearance.c | 23 +++++++++++++++++------ programs/cmm/appearance/ini.h | 12 ------------ 2 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 programs/cmm/appearance/ini.h diff --git a/programs/cmm/appearance/appearance.c b/programs/cmm/appearance/appearance.c index 0521ba9382..d38e72d1cb 100644 --- a/programs/cmm/appearance/appearance.c +++ b/programs/cmm/appearance/appearance.c @@ -1,5 +1,5 @@ //11.03.12 - start! -//ver 2.21 +//ver 2.3 #ifndef AUTOBUILD ?include "lang.h--" @@ -14,12 +14,11 @@ #include "..\lib\obj\box_lib.h" #include "..\lib\obj\proc_lib.h" +#include "..\lib\obj\libini.h" #include "..\lib\patterns\select_list.h" #include "..\lib\patterns\simple_open_dialog.h" -#include "ini.h" - //===================================================// // // // DATA // @@ -42,8 +41,8 @@ #define PANEL_H 40 #define LP 10 //LIST_PADDING -char skins_folder_path[4096] = "/kolibrios/res/skins"; -char wallp_folder_path[4096] = "/kolibrios/res/wallpapers"; +char skins_folder_path[4096]; +char wallp_folder_path[4096]; signed int active_skin=-1, active_wallpaper=-1; enum { @@ -82,10 +81,21 @@ od_filter filter2 = { 8, "TXT\0\0" }; // // //===================================================// +void GetRealFolderPathes() +{ + char real_skin_path[4096]; + SetCurDir("/kolibrios"); + GetCurDir(#real_skin_path, sizeof(real_skin_path)); + sprintf(#skins_folder_path, "%s/res/skins", #real_skin_path); + sprintf(#wallp_folder_path, "%s/res/wallpapers", #real_skin_path); +} + void main() { int id, mouse_clicked; + GetRealFolderPathes(); + load_dll(boxlib, #box_lib_init,0); load_dll(libini, #lib_init,1); load_dll(Proc_lib, #OpenDialog_init,0); @@ -377,10 +387,11 @@ void EventOpenFile() if (tabs.active_tab==WALLPAPERS) RunProgram("/sys/media/kiv", #cur_file_path); } +_ini ini = { "/sys/settings/eskin.ini", "main" }; void EventExit() { + ini.SetString("skin", #cur_skin_path, strlen(#cur_skin_path)); ExitProcess(); - SaveSkinSettings(#cur_skin_path); } stop: diff --git a/programs/cmm/appearance/ini.h b/programs/cmm/appearance/ini.h deleted file mode 100644 index 40c45d1d1b..0000000000 --- a/programs/cmm/appearance/ini.h +++ /dev/null @@ -1,12 +0,0 @@ -#include "../lib/obj/libini.h" - -_ini ini = { "/sys/settings/eskin.ini", "main" }; - -void SaveSkinSettings(dword skin_path) -{ - char real_skin_path[4096]; - SetCurDir("/kolibrios"); - GetCurDir(#real_skin_path, sizeof(real_skin_path)); - strcat(#real_skin_path, skin_path+10); - ini.SetString("skin", #real_skin_path, strlen(#real_skin_path)); -}