Eolite 1.51: do not sort big folders (this is hack, because there are some errors with sorting)

git-svn-id: svn://kolibrios.org@3150 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2013-01-06 17:18:53 +00:00
parent 161e024c27
commit c26000cc10
4 changed files with 21 additions and 15 deletions

View File

@ -20,7 +20,7 @@ int BUTTON_HEIGHT=18;
#define ONLY_OPEN 2 #define ONLY_OPEN 2
//ïåðåìåííûå //ïåðåìåííûå
#define title "Eolite File Manager v1.5" dword title[] = "Eolite File Manager v1.51";
dword col_work = 0xE4DFE1; dword col_work = 0xE4DFE1;
dword col_border = 0x819FC5; dword col_border = 0x819FC5;
dword col_padding = 0xC8C9C9; dword col_padding = 0xC8C9C9;
@ -62,7 +62,8 @@ int scroll_size;
int toolbar_buttons_x[7]={9,46,85,134,167,203}; int toolbar_buttons_x[7]={9,46,85,134,167,203};
char tmp_disk_del_param[3]="d0\0"; char tmp_disk_del_param[3]="d0\0";
dword file_mas[6898]; dword file_mas[65535];
int j, i, mouse_dd; int j, i, mouse_dd;
int scroll_used; int scroll_used;
@ -420,9 +421,9 @@ inline fastcall void draw_window()
int min_size_y = disc_num*16+195; int min_size_y = disc_num*16+195;
if (GetScreenHeight()<480) if (GetScreenHeight()<480)
DefineAndDrawWindow(20,0,582,GetScreenHeight()-30,0x73,col_work,title); DefineAndDrawWindow(20,0,582,GetScreenHeight()-30,0x73,col_work,#title);
else else
DefineAndDrawWindow(98,90,582,482,0x73,col_work,title); DefineAndDrawWindow(98,90,582,482,0x73,col_work,#title);
GetProcessInfo(#Form, SelfInfo); GetProcessInfo(#Form, SelfInfo);
if (Form.status_window>2) return; if (Form.status_window>2) return;
if (Form.height<min_size_y) MoveSize(OLD,OLD,OLD,min_size_y); if (Form.height<min_size_y) MoveSize(OLD,OLD,OLD,min_size_y);
@ -591,7 +592,7 @@ void Open_Dir(dword temp_, redraw){
if (somelen) path_[somelen]=NULL; if (somelen) path_[somelen]=NULL;
if (buf) free(buf); if (buf) free(buf);
buf = malloc(32); buf = malloc(512);
errornum=ReadDir(0, buf, #path_); errornum=ReadDir(0, buf, #path_);
if (errornum<>0) //îøèáêà ïðè ÷òåíèè ïàïêè if (errornum<>0) //îøèáêà ïðè ÷òåíèè ïàïêè
{ {
@ -601,10 +602,10 @@ void Open_Dir(dword temp_, redraw){
return; return;
} }
count = ESDWORD[buf+8]; count = ESDWORD[buf+8];
buf = realloc(count * 304 + 32, buf); //ïî÷åìó 32? buf = realloc(count * 304 + 512, buf); //ïî÷åìó 32?
ReadDir(count, buf, #path_); ReadDir(count, buf, #path_);
IF (EBX>6897) && (EBX<>-1) EBX=6897; //1 íà óäà÷ó ;)
count=EBX; count=EBX;
if (count>sizeof(file_mas)) count=sizeof(file_mas);
} }
if (count<>-1) if (count<>-1)
{ {
@ -631,11 +632,13 @@ void Open_Dir(dword temp_, redraw){
inline Sorting() inline Sorting()
{ {
dword k=0, l=1; dword k=0, l=1;
if (!strcmp(#path,"/")) //íå ñîğòèğîâàòü ïàïêè è íå ìåíÿòü ğåãèñòğ â "/"
if (!strcmp(#path,"/")) //|| (count > 5000) //íå ñîðòèðîâàòü ïàïêè è íå ìåíÿòü ðåãèñòð â "/"
{ {
FOR(k=1;k<count;k++;) file_mas[k]=k; FOR(k=1;k<count;k++;) file_mas[k]=k;
return; return;
} }
FOR (j=count-1, off=count-1*304+buf+32; j>=0; j--, off-=304;) //ïàïêè ââåðõ, ôàéëû âíèç FOR (j=count-1, off=count-1*304+buf+32; j>=0; j--, off-=304;) //ïàïêè ââåðõ, ôàéëû âíèç
{ {
TitleCase(off+40); TitleCase(off+40);
@ -650,13 +653,16 @@ inline Sorting()
l++; l++;
} }
} }
//Ñîáñòâåííî ñîðòèðîâêà: âíà÷àëå ïàïêè, ïîòîì ôàéëû //Ñîáñòâåííî ñîðòèðîâêà: âíà÷àëå ïàïêè, ïîòîì ôàéëû
Sort_by_Name(0,k-1); Sort_by_Name(0,k-1);
IF (sort_num==1) Sort_by_Name(k,count-1); IF (sort_num==1) Sort_by_Name(k,count-1);
IF (sort_num==2) Sort_by_Type(k,count-1); IF (sort_num==2) Sort_by_Type(k,count-1);
IF (sort_num==3) Sort_by_Size(k,count-1); IF (sort_num==3) Sort_by_Size(k,count-1);
//åñëè ïàïêà ".." íå ïåğâàÿ, ñòàâèì å¸ òóäà if (strcmp(file_mas[0]*304+buf+72,"..")<>0) //åñëè ïàïêà ".." íå ïåðâàÿ, ñòàâèì å¸ òóäà
IF (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")<>0) FOR(k--; k>0; k--;) IF (!strcmp(file_mas[k]*304+buf+72,"..")) file_mas[k]><file_mas[0]; {
FOR(k--; k>0; k--;) { IF (!strcmp(file_mas[k]*304+buf+72,"..")) file_mas[k]><file_mas[0]; }
}
} }

View File

@ -36,7 +36,7 @@ void about_dialog()
DefineAndDrawWindow(600,150,181,232+GetSkinHeight(),0x34,col_work,"About Eolite"); DefineAndDrawWindow(600,150,181,232+GetSkinHeight(),0x34,col_work,"About Eolite");
DrawBar(0,0,172,50,0x8494C4); //ãîëóáîå ñçàäè DrawBar(0,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
PutPaletteImage(#logo,85,85,43,7,#logo_pal); PutPaletteImage(#logo,85,85,43,7,#logo_pal);
WriteText(46,100,0x90,0xBF40BF,"Eolite v1.50",0); WriteText(46,100,0x90,0xBF40BF,"Eolite v1.51",0);
$add ebx, 1<<16 $add ebx, 1<<16
$int 0x40 $int 0x40
WriteText(55,120,0x80,0,"Developers:",0); WriteText(55,120,0x80,0,"Developers:",0);

View File

@ -19,8 +19,8 @@ unsigned char *ERROR_TEXT[]={
"Error #9 - FAT table is destroyed", "Error #9 - FAT table is destroyed",
"Error #10 - Access denied", "Error #10 - Access denied",
"Error #11 - Device error", "Error #11 - Device error",
"", "", "", "", "", "", "", "", "", 0, 0, 0, 0, 0, 0, 0, 0, 0,
"", "", "", "", "", "", "", "", "", 0, 0, 0, 0, 0, 0, 0, 0, 0,
"Error #30 - Not enough memory", "Error #30 - Not enough memory",
"Error #31 - File is not executable", "Error #31 - File is not executable",
"Error #32 - Too many processes", "Error #32 - Too many processes",

View File

@ -7,8 +7,8 @@ byte os_name[8] = {'M','E','N','U','E','T','0','1'};
dword os_version = 0x00000001; dword os_version = 0x00000001;
dword start_addr = #main; dword start_addr = #main;
dword final_addr = #stop+32; dword final_addr = #stop+32;
dword alloc_mem = 0x00080000; dword alloc_mem = 0x000b0000;
dword x86esp_reg = 0x00080000; dword x86esp_reg = 0x000b0000;
dword I_Param = #param; dword I_Param = #param;
dword I_Path = #program_path; dword I_Path = #program_path;