Subversion Repositories recyclebinunit

Compare Revisions

Regard whitespace Rev 87 → Rev 88

/trunk/Recycle Bin Unit v2/RecBinUnit2.pas
98,7 → 98,7
property IndexFile: string read FIndexFile;
property RemovedEntry: boolean read FRemovedEntry; // the file is NOT in the recycle bin anymore!
 
// Attention: There are not an official API calls. The delete and recover
// Attention: There are no official API calls. The delete and recover
// functions might fail and/or damage the shell cache. Handle with care!
function DeleteFile: boolean; virtual; abstract;
function RecoverFile: boolean; virtual; abstract;
369,6 → 369,18
TSHGetSettings = procedure(var lpss: SHELLSTATE; dwMask: DWORD); stdcall;
TSHGetSetSettings = procedure(var lpss: SHELLSTATE; dwMask: DWORD; bSet: BOOL); stdcall;
 
procedure AnsiRemoveNulChars(var s: AnsiString);
begin
while (Length(s) > 0) and (s[Length(s)] = #0) do
s := Copy(s, 1, Length(s)-1);
end;
 
procedure UnicodeRemoveNulChars(var s: WideString);
begin
while (Length(s) > 0) and (s[Length(s)] = #0) do
s := Copy(s, 1, Length(s)-1);
end;
 
function GetDriveGUID(driveLetter: Char; var guid: TGUID): DWORD;
var
Buffer: array[0..50] of AnsiChar;
1372,6 → 1384,11
FID := IntToStr(r.recordNumber);
FDeletionTime := FileTimeToDateTime(r.deletionTime);
FOriginalSize := r.originalSize;
 
// Remove #0 at the end. There are some bugs where #0 is added to ANSI/Unicode read paths?! (probably in the ReadVista stuff)
// TODO: Instead of using this workaround, fix "SourceUnicode" and "SourceAnsi" in the first place!
AnsiRemoveNulChars(FSourceAnsi);
UnicodeRemoveNulChars(FSourceUnicode);
end;
 
function TRbInfoAItem.DeleteFile: boolean;
1433,6 → 1450,11
FSourceDrive := Chr(Ord('A') + r.sourceDrive);
FDeletionTime := FileTimeToDateTime(r.deletionTime);
FOriginalSize := r.originalSize;
 
// Remove #0 at the end. There are some bugs where #0 is added to ANSI/Unicode read paths?! (probably in the ReadVista stuff)
// TODO: Instead of using this workaround, fix "SourceUnicode" and "SourceAnsi" in the first place!
AnsiRemoveNulChars(FSourceAnsi);
UnicodeRemoveNulChars(FSourceUnicode);
end;
 
function TRbInfoWItem.DeleteFile: boolean;
1530,6 → 1552,11
begin
raise Exception.CreateFmt('Invalid Vista index format version %d', [version]);
end;
 
// Remove #0 at the end. There are some bugs where #0 is added to ANSI/Unicode read paths?! (probably in the ReadVista stuff)
// TODO: Instead of using this workaround, fix "SourceUnicode" and "SourceAnsi" in the first place!
AnsiRemoveNulChars(FSourceAnsi);
UnicodeRemoveNulChars(FSourceUnicode);
end;
 
function TRbVistaItem.DeleteFile: boolean;
2390,11 → 2417,6
{$ELSE}
result := SourceAnsi;
{$ENDIF}
 
// Remove #0 at the end. There are some bugs where #0 is added to ANSI/Unicode read paths?! (probably in the ReadVista stuff)
// TODO: Instead of using this workaround, fix "SourceUnicode" and "SourceAnsi"!
while (Length(result) > 0) and (result[Length(result)] = #0) do
result := Copy(result, 1, Length(result)-1);
end;
 
end.
/trunk/Recycle Bin Unit v2/RecyclerListing.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/Recycle Bin Unit v2/RecyclerListing.res
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/Recycle Bin Unit v2/RecyclerListingMain.dfm
46,9 → 46,9
object CheckBox1: TCheckBox
Left = 8
Top = 6
Width = 129
Width = 137
Height = 17
Caption = 'Only own recyclers'
Caption = 'Only own recycler bins'
Checked = True
State = cbChecked
TabOrder = 1
75,7 → 75,7
TabOrder = 3
end
object CheckBox2: TCheckBox
Left = 143
Left = 183
Top = 6
Width = 146
Height = 17
/trunk/Recycle Bin Unit v2/RecyclerListingMain.pas
198,6 → 198,7
// File
item := TRbRecycleBinItem(TreeView1.Selected.Data);
// TODO: Does not work if the file type is unknown
// TODO: Maybe we should add a feature to drag'n'drop a file/folder out of RecycleBinUnit into the explorer (With options copy or move, depending on the ShiftState)
ShellExecute(Handle, 'open', PChar(item.PhysicalFile), '', '', SW_NORMAL);
end;
if TreeView1.Selected.ImageIndex = 10 then