- 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
This commit is contained in:
Kirill Lipatov (Leency) 2022-02-06 16:41:02 +00:00
parent dd4011f6d1
commit 2e3c29de7d
3 changed files with 26 additions and 17 deletions

View File

@ -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()

View File

@ -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++;

View File

@ -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)
{