inetcpl.cpl: Added support for clearing cookies and history cache.

This commit is contained in:
Piotr Caban 2012-09-25 18:12:48 +02:00 committed by Alexandre Julliard
parent 306f53cbf2
commit 04453937e5
2 changed files with 22 additions and 6 deletions

View File

@ -1,6 +1,6 @@
MODULE = inetcpl.cpl
IMPORTS = comctl32 shlwapi user32 advapi32
DELAYIMPORTS = cryptui wininet ole32 urlmon
DELAYIMPORTS = cryptui wininet ole32 urlmon shell32
C_SRCS = \
content.c \

View File

@ -29,6 +29,7 @@
#include <winreg.h>
#include <shlwapi.h>
#include <prsht.h>
#include <shlobj.h>
#include "inetcpl.h"
#include "wine/debug.h"
@ -47,9 +48,7 @@ static DWORD disabled_general_buttons[] = {IDC_HOME_CURRENT,
IDC_HOME_DEFAULT,
IDC_HISTORY_SETTINGS,
0};
static DWORD disabled_delhist_buttons[] = {IDC_DELETE_COOKIES,
IDC_DELETE_HISTORY,
IDC_DELETE_FORM_DATA,
static DWORD disabled_delhist_buttons[] = {IDC_DELETE_FORM_DATA,
IDC_DELETE_PASSWORDS,
0};
@ -64,8 +63,25 @@ static INT_PTR delhist_on_command(HWND hdlg, WPARAM wparam)
switch (wparam)
{
case MAKEWPARAM(IDOK, BN_CLICKED):
if (!FreeUrlCacheSpaceW(NULL, 100, FCS_PERCENT_CACHE_SPACE))
break; /* Don't close the dialog. */
if (IsDlgButtonChecked(hdlg, IDC_DELETE_TEMP_FILES))
FreeUrlCacheSpaceW(NULL, 100, 0);
if (IsDlgButtonChecked(hdlg, IDC_DELETE_COOKIES))
{
WCHAR pathW[MAX_PATH];
if(SHGetSpecialFolderPathW(NULL, pathW, CSIDL_COOKIES, TRUE))
FreeUrlCacheSpaceW(pathW, 100, 0);
}
if (IsDlgButtonChecked(hdlg, IDC_DELETE_HISTORY))
{
WCHAR pathW[MAX_PATH];
if(SHGetSpecialFolderPathW(NULL, pathW, CSIDL_HISTORY, TRUE))
FreeUrlCacheSpaceW(pathW, 100, 0);
}
EndDialog(hdlg, IDOK);
return TRUE;