diff --git a/src/xvaga/xvaga.cpp b/src/xvaga/xvaga.cpp index 6e15803ea..c826be031 100755 --- a/src/xvaga/xvaga.cpp +++ b/src/xvaga/xvaga.cpp @@ -3742,6 +3742,28 @@ BOOLEAN xvt_sys_set_profile_string(const char* file, const char* paragraph, cons #endif } +XVTDLL BOOLEAN xvt_sys_remove_profile_string(const char* file, const char* paragraph, const char* name) +{ + if (file == NULL || *file == '\0') + file = xvt_fsys_get_campo_ini(); + + if (paragraph == NULL || *paragraph == '\0') + paragraph = "Main"; + +#ifdef __WXMSW__ + return ::WritePrivateProfileString(paragraph, name, nullptr, file) > 0; +#else + wxFileConfig ini("", "", file, "", wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH); + ini.SetUmask(0x0); + + wxString path; + path << "/" << paragraph; + ini.SetPath(path); + + return ini.DeleteEntry(name); +#endif +} + BOOLEAN xvt_sys_find_editor(const char* file, char* editor) { BOOLEAN ok = FALSE; diff --git a/src/xvaga/xvt.h b/src/xvaga/xvt.h index 288d91009..b442c9074 100755 --- a/src/xvaga/xvt.h +++ b/src/xvaga/xvt.h @@ -432,6 +432,7 @@ XVTDLL int xvt_sys_get_profile_string(const char* file, const char* paragra const char* defval, char* value, int maxsize); XVTDLL BOOLEAN xvt_sys_set_profile_int(const char* file, const char* paragraph, const char* name, long value); XVTDLL BOOLEAN xvt_sys_set_profile_string(const char* file, const char* paragraph, const char* name, const char* value); +XVTDLL BOOLEAN xvt_sys_remove_profile_string(const char* file, const char* paragraph, const char* name); XVTDLL int xvt_sys_get_session_id(); XVTDLL unsigned long xvt_sys_get_free_memory();