mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
FIX: Bug [0000788] "Software does not make use of drag n drop"
This commit is contained in:
parent
25f98c32cf
commit
8bc9e61b1e
2 changed files with 23 additions and 4 deletions
|
|
@ -18,6 +18,8 @@ function GetArchiveFileSource(SourceFileSource: IFileSource;
|
|||
|
||||
procedure TestArchive(aFileView: TFileView; aFiles: TFiles);
|
||||
|
||||
function FileIsArchive(const FileName: UTF8String): Boolean;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
|
|
@ -235,5 +237,14 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
function FileIsArchive(const FileName: UTF8String): Boolean;
|
||||
var
|
||||
ArchiveType: UTF8String;
|
||||
begin
|
||||
ArchiveType:= ExtractOnlyFileExt(FileName);
|
||||
Result:= TWcxArchiveFileSource.CheckPluginByExt(ArchiveType) or
|
||||
TMultiArchiveFileSource.CheckAddonByExt(ArchiveType);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
|
|
|||
|
|
@ -160,7 +160,8 @@ uses
|
|||
{$ENDIF}
|
||||
LCLIntf, LCLProc, Forms, Dialogs,
|
||||
fMain, uShowMsg, uLng, uFileProperty, uFileSource, uFileSourceOperationTypes,
|
||||
uGlobs, uInfoToolTip, uDisplayFile, uFileSystemFileSource, uFileSourceUtil;
|
||||
uGlobs, uInfoToolTip, uDisplayFile, uFileSystemFileSource, uFileSourceUtil,
|
||||
uArchiveFileSourceUtil;
|
||||
|
||||
type
|
||||
TControlHandlersHack = class(TWinControl)
|
||||
|
|
@ -281,7 +282,12 @@ begin
|
|||
end
|
||||
else
|
||||
TargetPath := TargetPath + AFile.FSFile.Name + DirectorySeparator;
|
||||
end;
|
||||
end
|
||||
else if FileIsArchive(AFile.FSFile.FullPath) then
|
||||
begin
|
||||
TargetFileSource:= GetArchiveFileSource(FileSource, AFile.FSFile);
|
||||
if Assigned(TargetFileSource) then TargetPath:= TargetFileSource.GetRootDir;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -430,7 +436,8 @@ begin
|
|||
|
||||
AFile := FFiles[FileIndex];
|
||||
|
||||
if (AFile.FSFile.IsDirectory or AFile.FSFile.IsLinkToDirectory) then
|
||||
if AFile.FSFile.IsDirectory or AFile.FSFile.IsLinkToDirectory or
|
||||
FileIsArchive(AFile.FSFile.FullPath) then
|
||||
begin
|
||||
if State = dsDragLeave then
|
||||
// Mouse is leaving the control or drop will occur immediately.
|
||||
|
|
@ -906,7 +913,8 @@ begin
|
|||
AFile := FFiles[FileIndex];
|
||||
|
||||
// If it is a directory or link mark possibility of drop.
|
||||
if (AFile.FSFile.IsDirectory or AFile.FSFile.IsLinkToDirectory) then
|
||||
if AFile.FSFile.IsDirectory or AFile.FSFile.IsLinkToDirectory or
|
||||
FileIsArchive(AFile.FSFile.FullPath) then
|
||||
SetDropFileIndex(FileIndex)
|
||||
else
|
||||
SetDropFileIndex(-1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue