From 2e3c29de7de1b9243992fc47fb99ad13814255b3 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 6 Feb 2022 16:41:02 +0000 Subject: [PATCH] Eolite: - do not autorefresh folder on FD and CD disks - if /kolibrios is mounted than set a var and do not reread it further - increase refresh disk and folder timeout to 1.5 seconds git-svn-id: svn://kolibrios.org@9689 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 21 +++++++++++++-------- programs/cmm/eolite/include/left_panel.h | 9 ++++++++- programs/cmm/lib/fs.h | 13 +++++-------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index ad0eb46600..2a0a4b533f 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -1,4 +1,4 @@ -//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2021 +//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2022 //GNU GPL license. /* @@ -11,9 +11,9 @@ TODO: http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334 */ -#define ABOUT_TITLE "EOLITE 5.21" -#define TITLE_EOLITE "Eolite File Manager 5.21" -#define TITLE_KFM "Kolibri File Manager 2.21"; +#define ABOUT_TITLE "EOLITE 5.22" +#define TITLE_EOLITE "Eolite File Manager 5.22" +#define TITLE_KFM "Kolibri File Manager 2.22"; #define MEMSIZE 1024 * 250 #include "../lib/clipboard.h" @@ -197,7 +197,7 @@ void main() OpenDir(ONLY_OPEN); llist_copy(#files_inactive, #files); SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); - loop() switch(@WaitEventTimeout(100)) + loop() switch(@WaitEventTimeout(150)) { case evMouse: if (Form.status_window&ROLLED_UP) break; @@ -511,7 +511,10 @@ void main() if (CheckActiveProcess(Form.ID)) && (GetMenuClick()) break; break; default: - if (!Form.status_window&ROLLED_UP) EventRefreshDisksAndFolders(); + if (!Form.status_window&ROLLED_UP) + && (ESBYTE[path+1]!='f') && (ESBYTE[path+1]!='c') { + EventRefreshDisksAndFolders(); + } } if(cmd_free) @@ -1277,12 +1280,14 @@ void EventRefreshDisksAndFolders() return; } } else { - if (GetRealFileCountInFolder("/")+dir_exists("/kolibrios") != SystemDiscs.dev_num) { + if (GetRealFileCountInFolder("/")+KolibriosMounted() != SystemDiscs.dev_num) { SystemDiscs.Get(); SystemDiscs.Draw(); } } - if(GetRealFileCountInFolder(path) != files.count) OpenDir(WITH_REDRAW); + if(GetRealFileCountInFolder(path) != files.count) { + OpenDir(WITH_REDRAW); + } } void EventManualFolderRefresh() diff --git a/programs/cmm/eolite/include/left_panel.h b/programs/cmm/eolite/include/left_panel.h index ecf72ffa06..6f0736507d 100644 --- a/programs/cmm/eolite/include/left_panel.h +++ b/programs/cmm/eolite/include/left_panel.h @@ -1,3 +1,10 @@ +bool KolibriosMounted() +{ + static bool kolibrios_mounted; + if (kolibrios_mounted) return true; + kolibrios_mounted = real_dir_exists("/kolibrios"); + return kolibrios_mounted; +} struct _SystemDiscs { @@ -23,7 +30,7 @@ void _SystemDiscs::Get() list.add("/sys"); dev_num++; - if (dir_exists("/kolibrios")) { + if (KolibriosMounted()) { //need to check that /sys != /kolibrios list.add("/kolibrios"); dev_num++; diff --git a/programs/cmm/lib/fs.h b/programs/cmm/lib/fs.h index 83e8822551..c96eb54690 100644 --- a/programs/cmm/lib/fs.h +++ b/programs/cmm/lib/fs.h @@ -256,19 +256,16 @@ inline fastcall void GetCurDir( ECX, EDX) else return bdvk.sizelo; } -/* -// This implementation of dir_exists() is faster than -// previous but here virtual folders like -// '/' and '/tmp' are not recognised as FOLDERS -// by GetFileInfo() => BDVK.isfolder attribute :( - -:bool dir_exists(dword fpath) +/* This implementation of dir_exists() is faster than + previous but here virtual folders like + '/' and '/tmp' are not recognised as FOLDERS + by GetFileInfo() => BDVK.isfolder attribute :( */ +bool real_dir_exists(dword fpath) { BDVK fpath_atr; if (GetFileInfo(fpath, #fpath_atr) != 0) return false; return fpath_atr.isfolder; } -*/ :bool file_exists(dword fpath) {