UPD: replace with fspSaveableLoadable for better compatibility with various FileSources in TFileView.SaveConfiguration()

This commit is contained in:
rich2014 2026-06-08 11:37:51 +08:00
commit 733fb94cd7
4 changed files with 9 additions and 4 deletions

View file

@ -818,7 +818,8 @@ end;
function TFileSystemFileSource.GetProperties: TFileSourceProperties;
begin
Result := [
fspDirectAccess, fspListFlatView, fspNoneParent, fspSearchable
fspDirectAccess, fspListFlatView, fspNoneParent,
fspSearchable, fspSaveableLoadable
{$IFDEF UNIX}
, fspCaseSensitive
{$ENDIF}

View file

@ -115,7 +115,7 @@ end;
function TSearchResultFileSource.GetProperties: TFileSourceProperties;
begin
Result := inherited GetProperties;
Result -= [fspNoneParent, fspListFlatView];
Result -= [fspNoneParent, fspListFlatView, fspSaveableLoadable];
Result += [fspDontChangePath, fspDontCreateDirectory, fspSearchable];
if (fspDirectAccess in Result) then Result+= [fspLinksToLocalFiles];
end;

View file

@ -89,6 +89,11 @@ type
}
fspSearchable,
{en
Set, if the file source supports save to ConfigFile and load from ConfigFile.
}
fspSaveableLoadable,
{en
Set, if the file source has default columns view
}

View file

@ -2843,8 +2843,7 @@ begin
for i := 0 to FileSourcesCount - 1 do
begin
// Currently saves only FileSystem.
if FHistory.FileSource[i].IsClass(TFileSystemFileSource) then
if fspSaveableLoadable in FHistory.FileSource[i].Properties then
begin
EntryNode := AConfig.AddNode(HistoryNode, 'Entry');
if FHistory.CurrentFileSourceIndex = i then