Subversion Repositories Kolibri OS

Rev

Rev 6635 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6278 leency 1
int del_error;
2
int Del_File2(dword way, sh_progr)
3
{
4
	dword dirbuf, fcount, i, filename;
5
	int error;
6
	char del_from[4096];
7
	if (dir_exists(way))
8
	{
9
		if (error = GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL)) del_error = error;
10
		for (i=0; i
11
		{
12
			if (CheckEvent()==evReDraw) draw_window();
13
			filename = i*304+dirbuf+72;
14
			sprintf(#del_from,"%s/%s",way,filename);
15
			if ( TestBit(ESDWORD[filename-40], 4) )
16
			{
17
				Del_File2(#del_from, 1);
18
			}
19
			else
20
			{
21
				if (sh_progr) Operation_Draw_Progress(filename);
22
				if (error = DeleteFile(#del_from)) del_error = error;
23
			}
24
		}
25
	}
26
	if (error = DeleteFile(way)) del_error = error;
27
}
28
 
29
void Del_File_Thread()
30
{
31
	byte del_from[4096];
32
	int tst, count, i;
33
 
34
	file_count_copy = 0;
35
	copy_bar.value = 0;
36
	operation_flag = DELETE_FLAG;
37
 
38
	if (selected_count)
39
	{
40
	   for (i=0; i
41
		{
6646 leency 42
			if (getElementSelectedFlag(i) == true) {
6635 leency 43
				sprintf(#del_from,"%s/%s",#path,file_mas[i]*304+buf+72);
6278 leency 44
				GetFileInfo(#del_from, #file_info_count);
45
				if ( file_info_count.isfolder ) DirFileCount(#del_from);
46
				else file_count_copy++;
47
			}
48
		}
49
	}
50
	else
51
	{
52
		if (itdir) DirFileCount(#file_path);
53
		else file_count_copy++;
54
	}
55
 
56
	copy_bar.max = file_count_copy;
57
 
58
	del_error = 0;
59
	DisplayOperationForm();
60
	if (selected_count)
61
	{
62
		for (i=0; i
63
		{
6646 leency 64
			if (getElementSelectedFlag(i) == true) {
6635 leency 65
				sprintf(#del_from,"%s/%s",#path,file_mas[i]*304+buf+72);
6278 leency 66
				Del_File2(#del_from, 1);
67
			}
68
		}
69
	}
70
	else
71
	{
72
		Del_File2(#file_path, 1);
73
	}
74
	if (del_error) Write_Error(del_error);
75
	cmd_free = 6;
76
	DialogExit();
77
}
78
 
79
void Del_File(byte dodel) {
80
	del_active=0;
81
	if (dodel)
82
	{
83
		delete_stak = malloc(40000);
84
		CreateThread(#Del_File_Thread,delete_stak+40000-4);
85
	}
86
	else draw_window();
87
}