MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / LoadSettings

Function LoadSettings

src/Notepad2.c:4261–4565  ·  view source on GitHub ↗

============================================================================= LoadSettings()

Source from the content-addressed store, hash-verified

4259//
4260//
4261void LoadSettings()
4262{
4263 WCHAR *pIniSection = LocalAlloc ( LPTR, sizeof ( WCHAR ) * 32 * 1024 );
4264 int cchIniSection = ( int ) LocalSize ( pIniSection ) / sizeof ( WCHAR );
4265 LoadIniSection(L"Settings", pIniSection, cchIniSection);
4266 WCHAR *pHlIniSection = LocalAlloc(LPTR, sizeof (WCHAR)* 32 * 1024);
4267 int cchHlIniSection = (int)LocalSize(pIniSection) / sizeof (WCHAR);
4268 LoadIniSection(HL_INI_SECTION, pHlIniSection, cchHlIniSection);
4269 bSaveSettings =
4270 IniSectionGetInt(pHlIniSection, L"SaveSettings", 1);
4271 if ( bSaveSettings ) {
4272 bSaveSettings = 1;
4273 }
4274 // haccel
4275 b_HL_highlight_selection =
4276 IniSectionGetInt(pHlIniSection, L"HightLightSelection", 1);
4277 if ( b_HL_highlight_selection ) {
4278 b_HL_highlight_selection = 1;
4279 }
4280 b_HL_ctrl_wheel_scroll =
4281 IniSectionGetInt ( pIniSection, L"WheelScroll", 1 );
4282 if ( b_HL_ctrl_wheel_scroll ) {
4283 b_HL_ctrl_wheel_scroll = 1;
4284 }
4285 LocalFree(pHlIniSection);
4286 pHlIniSection = NULL;
4287 //
4288 bSaveRecentFiles =
4289 IniSectionGetInt ( pIniSection, L"SaveRecentFiles", 0 );
4290 if ( bSaveRecentFiles ) {
4291 bSaveRecentFiles = 1;
4292 }
4293 bSaveFindReplace =
4294 IniSectionGetInt ( pIniSection, L"SaveFindReplace", 0 );
4295 if ( bSaveFindReplace ) {
4296 bSaveFindReplace = 1;
4297 }
4298 efrData.bFindClose = IniSectionGetInt ( pIniSection, L"CloseFind", 0 );
4299 if ( efrData.bFindClose ) {
4300 efrData.bReplaceClose = TRUE;
4301 }
4302 efrData.bReplaceClose = IniSectionGetInt ( pIniSection, L"CloseReplace", 0 );
4303 if ( efrData.bReplaceClose ) {
4304 efrData.bReplaceClose = TRUE;
4305 }
4306 efrData.bNoFindWrap = IniSectionGetInt ( pIniSection, L"NoFindWrap", 0 );
4307 if ( efrData.bNoFindWrap ) {
4308 efrData.bNoFindWrap = TRUE;
4309 }
4310 if ( !IniSectionGetString ( pIniSection, L"OpenWithDir", L"",
4311 tchOpenWithDir, COUNTOF ( tchOpenWithDir ) ) ) {
4312 SHGetSpecialFolderPath ( NULL, tchOpenWithDir, CSIDL_DESKTOPDIRECTORY, TRUE );
4313 } else {
4314 PathAbsoluteFromApp ( tchOpenWithDir, NULL, COUNTOF ( tchOpenWithDir ), TRUE );
4315 }
4316 if ( !IniSectionGetString ( pIniSection, L"Favorites", L"",
4317 tchFavoritesDir, COUNTOF ( tchFavoritesDir ) ) ) {
4318 SHGetFolderPath ( NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, tchFavoritesDir );

Callers 2

WinMainFunction · 0.85
MainWndProcFunction · 0.85

Calls 6

IniSectionGetIntFunction · 0.85
IniSectionGetStringFunction · 0.85
PathAbsoluteFromAppFunction · 0.85
Encoding_MapIniSettingFunction · 0.85
Encoding_IsValidFunction · 0.85
Style_LoadFunction · 0.85

Tested by

no test coverage detected